diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a5c813 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +AUTHORS +CONTRIBUTING.md +COPYING +HACKING +INSTALL.in +NEWS +NEWS.pre-1-3 +README +README.md +README.rationale +README.win32 +README.win32.md +check-abis.sh +clang-format-diff.py +config.h +docs +fuzzing +gio +glib +glib-gettextize.in +glib.doap +glib.supp +glibmemdfx +gmodule +gobject +gthread +m4macros +meson.build +meson_options.txt +msvc_recommended_pragmas.h +po +subprojects +template-tap.test.in +template.test.in +tests \ No newline at end of file diff --git a/install.sh b/install.sh index 80f12d5..3c1da2e 100755 --- a/install.sh +++ b/install.sh @@ -3,8 +3,7 @@ set -e cd $1 -# tar -zcvf patch.tar.gz *.patch -find . ! -path "*/\.*" ! \( -name patch.tar.gz -o -name glib-2.68.1.tar.xz\ +find . ! -path "*/\.*" ! -path "./patch*" ! \( -name glib-2.68.1.tar.xz\ -o -name BUILD.gn\ -o -name config.gni\ -o -name install.sh\ @@ -18,7 +17,6 @@ find . ! -path "*/\.*" ! \( -name patch.tar.gz -o -name glib-2.68.1.tar.xz\ -o -name CONTRIBUTING.md\ -o -name ".*" \)\ -prune -print -exec rm -rf {} \; -tar -zxvf patch.tar.gz tar -xvf glib-2.68.1.tar.xz mv glib-2.68.1/* . rm -rf glib-2.68.1 @@ -27,9 +25,9 @@ file="backport-patch.log" exec < $file while read line do - line=${line:15} + line=${line:16} echo $line - patch -p1 < $line --fuzz=0 --no-backup-if-mismatch + patch -p1 < patch/$line --fuzz=0 --no-backup-if-mismatch done echo "all file patch success!" exit 0 diff --git a/patch/backport-Add-D-Bus-object-subtree-unregistration-tests.patch b/patch/backport-Add-D-Bus-object-subtree-unregistration-tests.patch new file mode 100644 index 0000000..75d9591 --- /dev/null +++ b/patch/backport-Add-D-Bus-object-subtree-unregistration-tests.patch @@ -0,0 +1,219 @@ +From 34ce204fd758e2ce0ab6bf152051534f46cdb336 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 24 Sep 2021 10:57:20 +0100 +Subject: [PATCH] tests: Add D-Bus object/subtree unregistration tests + +These tests cover the fixes from the previous two commits. + +Signed-off-by: Philip Withnall + +Helps: #2400 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/34ce204fd758e2ce0ab6bf152051534f46cdb336 + +--- + gio/tests/gdbus-export.c | 180 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 180 insertions(+) + +diff --git a/gio/tests/gdbus-export.c b/gio/tests/gdbus-export.c +index aec21d7d0b..4cdc244924 100644 +--- a/gio/tests/gdbus-export.c ++++ b/gio/tests/gdbus-export.c +@@ -1792,6 +1792,184 @@ test_async_properties (void) + g_object_unref (c); + } + ++typedef struct ++{ ++ GDBusConnection *connection; /* (owned) */ ++ guint registration_id; ++ guint subtree_registration_id; ++} ThreadedUnregistrationData; ++ ++static gpointer ++unregister_thread_cb (gpointer user_data) ++{ ++ ThreadedUnregistrationData *data = user_data; ++ ++ /* Sleeping here makes the race more likely to be hit, as it balances the ++ * time taken to set up the thread and unregister, with the time taken to ++ * make and handle the D-Bus call. This will likely change with future kernel ++ * versions, but there isn’t a more deterministic synchronisation point that ++ * I can think of to use instead. */ ++ usleep (330); ++ ++ if (data->registration_id > 0) ++ g_assert_true (g_dbus_connection_unregister_object (data->connection, data->registration_id)); ++ ++ if (data->subtree_registration_id > 0) ++ g_assert_true (g_dbus_connection_unregister_subtree (data->connection, data->subtree_registration_id)); ++ ++ return NULL; ++} ++ ++static void ++async_result_cb (GObject *source_object, ++ GAsyncResult *result, ++ gpointer user_data) ++{ ++ GAsyncResult **result_out = user_data; ++ ++ *result_out = g_object_ref (result); ++ g_main_context_wakeup (NULL); ++} ++ ++/* Returns %TRUE if this iteration resolved the race with the unregistration ++ * first, %FALSE if the call handler was invoked first. */ ++static gboolean ++test_threaded_unregistration_iteration (gboolean subtree) ++{ ++ ThreadedUnregistrationData data = { NULL, 0, 0 }; ++ ObjectRegistrationData object_registration_data = { 0, 0, 2 }; ++ GError *local_error = NULL; ++ GThread *unregister_thread = NULL; ++ const gchar *object_path; ++ GVariant *value = NULL; ++ const gchar *value_str; ++ GAsyncResult *call_result = NULL; ++ gboolean unregistration_was_first; ++ ++ data.connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &local_error); ++ g_assert_no_error (local_error); ++ g_assert_nonnull (data.connection); ++ ++ /* Register an object or a subtree */ ++ if (!subtree) ++ { ++ data.registration_id = g_dbus_connection_register_object (data.connection, ++ "/foo/boss", ++ (GDBusInterfaceInfo *) &foo_interface_info, ++ &foo_vtable, ++ &object_registration_data, ++ on_object_unregistered, ++ &local_error); ++ g_assert_no_error (local_error); ++ g_assert_cmpint (data.registration_id, >, 0); ++ ++ object_path = "/foo/boss"; ++ } ++ else ++ { ++ data.subtree_registration_id = g_dbus_connection_register_subtree (data.connection, ++ "/foo/boss/executives", ++ &subtree_vtable, ++ G_DBUS_SUBTREE_FLAGS_NONE, ++ &object_registration_data, ++ on_subtree_unregistered, ++ &local_error); ++ g_assert_no_error (local_error); ++ g_assert_cmpint (data.subtree_registration_id, >, 0); ++ ++ object_path = "/foo/boss/executives/vp0"; ++ } ++ ++ /* Allow the registrations to go through. */ ++ g_main_context_iteration (NULL, FALSE); ++ ++ /* Spawn a thread to unregister the object/subtree. This will race with ++ * the call we subsequently make. */ ++ unregister_thread = g_thread_new ("unregister-object", ++ unregister_thread_cb, &data); ++ ++ /* Call a method on the object (or an object in the subtree). The callback ++ * will be invoked in this main context. */ ++ g_dbus_connection_call (data.connection, ++ g_dbus_connection_get_unique_name (data.connection), ++ object_path, ++ "org.example.Foo", ++ "Method1", ++ g_variant_new ("(s)", "winwinwin"), ++ NULL, ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, ++ async_result_cb, ++ &call_result); ++ ++ while (call_result == NULL) ++ g_main_context_iteration (NULL, TRUE); ++ ++ value = g_dbus_connection_call_finish (data.connection, call_result, &local_error); ++ ++ /* The result of the method could either be an error (that the object doesn’t ++ * exist) or a valid result, depending on how the thread was scheduled ++ * relative to the call. */ ++ unregistration_was_first = (value == NULL); ++ if (value != NULL) ++ { ++ g_assert_no_error (local_error); ++ g_assert_true (g_variant_is_of_type (value, G_VARIANT_TYPE ("(s)"))); ++ g_variant_get (value, "(&s)", &value_str); ++ g_assert_cmpstr (value_str, ==, "You passed the string 'winwinwin'. Jolly good!"); ++ } ++ else ++ { ++ g_assert_null (value); ++ g_assert_error (local_error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD); ++ } ++ ++ g_clear_pointer (&value, g_variant_unref); ++ g_clear_error (&local_error); ++ ++ /* Tidy up. */ ++ g_thread_join (g_steal_pointer (&unregister_thread)); ++ ++ g_clear_object (&call_result); ++ g_clear_object (&data.connection); ++ ++ return unregistration_was_first; ++} ++ ++static void ++test_threaded_unregistration (gconstpointer test_data) ++{ ++ gboolean subtree = GPOINTER_TO_INT (test_data); ++ guint i; ++ guint n_iterations_unregistration_first = 0; ++ guint n_iterations_call_first = 0; ++ ++ g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2400"); ++ g_test_summary ("Test that object/subtree unregistration from one thread " ++ "doesn’t cause problems when racing with method callbacks " ++ "in another thread for that object or subtree"); ++ ++ /* Run iterations of the test until it’s likely we’ve hit the race. Limit the ++ * number of iterations so the test doesn’t run forever if not. The choice of ++ * 100 is arbitrary. */ ++ for (i = 0; i < 1000 && (n_iterations_unregistration_first < 100 || n_iterations_call_first < 100); i++) ++ { ++ if (test_threaded_unregistration_iteration (subtree)) ++ n_iterations_unregistration_first++; ++ else ++ n_iterations_call_first++; ++ } ++ ++ /* If the condition below is met, we probably failed to reproduce the race. ++ * Don’t fail the test, though, as we can’t always control whether we hit the ++ * race, and spurious test failures are annoying. */ ++ if (n_iterations_unregistration_first < 100 || ++ n_iterations_call_first < 100) ++ g_strdup_printf ("Failed to reproduce race (%u iterations with unregistration first, %u with call first); skipping test", ++ n_iterations_unregistration_first, n_iterations_call_first); ++} ++ + /* ---------------------------------------------------------------------------------------------------- */ + + int +@@ -1809,6 +1987,8 @@ main (int argc, + g_test_add_func ("/gdbus/object-registration-with-closures", test_object_registration_with_closures); + g_test_add_func ("/gdbus/registered-interfaces", test_registered_interfaces); + g_test_add_func ("/gdbus/async-properties", test_async_properties); ++ g_test_add_data_func ("/gdbus/threaded-unregistration/object", GINT_TO_POINTER (FALSE), test_threaded_unregistration); ++ g_test_add_data_func ("/gdbus/threaded-unregistration/subtree", GINT_TO_POINTER (TRUE), test_threaded_unregistration); + + /* TODO: check that we spit out correct introspection data */ + /* TODO: check that registering a whole subtree works */ +-- +GitLab + diff --git a/patch/backport-Add-lock-in-_g_get_unix_mount_points-around-fsent-functions.patch b/patch/backport-Add-lock-in-_g_get_unix_mount_points-around-fsent-functions.patch new file mode 100644 index 0000000..4c52f54 --- /dev/null +++ b/patch/backport-Add-lock-in-_g_get_unix_mount_points-around-fsent-functions.patch @@ -0,0 +1,69 @@ +From f43cf341511dd684a58c09e104e28c11987cbff1 Mon Sep 17 00:00:00 2001 +From: Rozhuk Ivan +Date: Sat, 25 Jun 2022 18:46:08 +0300 +Subject: [PATCH] [PATCH] Add lock in _g_get_unix_mount_points() around + *fsent() functions + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/f43cf341511dd684a58c09e104e28c11987cbff1 + +--- + gio/gunixmounts.c | 22 +++++++++++++--------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c +index 563bdba3b2..3005aa7af3 100644 +--- a/gio/gunixmounts.c ++++ b/gio/gunixmounts.c +@@ -1410,17 +1410,13 @@ _g_get_unix_mount_points (void) + { + struct fstab *fstab = NULL; + GUnixMountPoint *mount_point; +- GList *return_list; ++ GList *return_list = NULL; ++ G_LOCK_DEFINE_STATIC (fsent); + #ifdef HAVE_SYS_SYSCTL_H + int usermnt = 0; + struct stat sb; + #endif +- +- if (!setfsent ()) +- return NULL; + +- return_list = NULL; +- + #ifdef HAVE_SYS_SYSCTL_H + #if defined(HAVE_SYSCTLBYNAME) + { +@@ -1448,7 +1444,14 @@ _g_get_unix_mount_points (void) + } + #endif + #endif +- ++ ++ G_LOCK (fsent); ++ if (!setfsent ()) ++ { ++ G_UNLOCK (fsent); ++ return NULL; ++ } ++ + while ((fstab = getfsent ()) != NULL) + { + gboolean is_read_only = FALSE; +@@ -1482,9 +1485,10 @@ _g_get_unix_mount_points (void) + + return_list = g_list_prepend (return_list, mount_point); + } +- ++ + endfsent (); +- ++ G_UNLOCK (fsent); ++ + return g_list_reverse (return_list); + } + /* Interix {{{2 */ +-- +GitLab + diff --git a/patch/backport-CVE-2023-24593_CVE-2023-25180-1.patch b/patch/backport-CVE-2023-24593_CVE-2023-25180-1.patch new file mode 100644 index 0000000..8143ad9 --- /dev/null +++ b/patch/backport-CVE-2023-24593_CVE-2023-25180-1.patch @@ -0,0 +1,2974 @@ +From 1deacdd4e8e35a5cf1417918ca4f6b0afa6409b1 Mon Sep 17 00:00:00 2001 +From: William Manley +Date: Tue, 23 Jun 2020 22:59:58 +0100 +Subject: [PATCH 01/18] gvariant-core: Consolidate construction of + `GVariantSerialised` + +So I only need to change it in one place. + +This introduces no functional changes. + +Helps: #2121 +--- + glib/gvariant-core.c | 49 ++++++++++++++++++++++---------------------- + 1 file changed, 25 insertions(+), 24 deletions(-) + +diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c +index 89ea54c013..d5d78da88b 100644 +--- a/glib/gvariant-core.c ++++ b/glib/gvariant-core.c +@@ -351,6 +351,27 @@ g_variant_ensure_size (GVariant *value) + } + } + ++/* < private > ++ * g_variant_to_serialised: ++ * @value: a #GVariant ++ * ++ * Gets a GVariantSerialised for a GVariant in state STATE_SERIALISED. ++ */ ++inline static GVariantSerialised ++g_variant_to_serialised (GVariant *value) ++{ ++ g_assert (value->state & STATE_SERIALISED); ++ { ++ GVariantSerialised serialised = { ++ value->type_info, ++ (gpointer) value->contents.serialised.data, ++ value->size, ++ value->depth, ++ }; ++ return serialised; ++ } ++} ++ + /* < private > + * g_variant_serialise: + * @value: a #GVariant +@@ -1009,16 +1030,8 @@ g_variant_n_children (GVariant *value) + g_variant_lock (value); + + if (value->state & STATE_SERIALISED) +- { +- GVariantSerialised serialised = { +- value->type_info, +- (gpointer) value->contents.serialised.data, +- value->size, +- value->depth, +- }; +- +- n_children = g_variant_serialised_n_children (serialised); +- } ++ n_children = g_variant_serialised_n_children ( ++ g_variant_to_serialised (value)); + else + n_children = value->contents.tree.n_children; + +@@ -1085,12 +1098,7 @@ g_variant_get_child_value (GVariant *value, + } + + { +- GVariantSerialised serialised = { +- value->type_info, +- (gpointer) value->contents.serialised.data, +- value->size, +- value->depth, +- }; ++ GVariantSerialised serialised = g_variant_to_serialised (value); + GVariantSerialised s_child; + GVariant *child; + +@@ -1203,14 +1211,7 @@ g_variant_is_normal_form (GVariant *value) + + if (value->state & STATE_SERIALISED) + { +- GVariantSerialised serialised = { +- value->type_info, +- (gpointer) value->contents.serialised.data, +- value->size, +- value->depth +- }; +- +- if (g_variant_serialised_is_normal (serialised)) ++ if (g_variant_serialised_is_normal (g_variant_to_serialised (value))) + value->state |= STATE_TRUSTED; + } + else +-- +GitLab + + +From 446e69f5edd72deb2196dee36bbaf8056caf6948 Mon Sep 17 00:00:00 2001 +From: William Manley +Date: Thu, 25 Jun 2020 17:08:21 +0100 +Subject: [PATCH 02/18] gvariant-serialiser: Factor out functions for dealing + with framing offsets + +This introduces no functional changes. + +Helps: #2121 +--- + glib/gvariant-serialiser.c | 108 +++++++++++++++++++------------------ + 1 file changed, 57 insertions(+), 51 deletions(-) + +diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c +index 6ebaec7d40..1eaa80b29f 100644 +--- a/glib/gvariant-serialiser.c ++++ b/glib/gvariant-serialiser.c +@@ -635,30 +635,62 @@ gvs_calculate_total_size (gsize body_size, + return body_size + 8 * offsets; + } + ++struct Offsets ++{ ++ gsize data_size; ++ ++ guchar *array; ++ gsize length; ++ guint offset_size; ++ ++ gboolean is_normal; ++}; ++ + static gsize +-gvs_variable_sized_array_n_children (GVariantSerialised value) ++gvs_offsets_get_offset_n (struct Offsets *offsets, ++ gsize n) ++{ ++ return gvs_read_unaligned_le ( ++ offsets->array + (offsets->offset_size * n), offsets->offset_size); ++} ++ ++static struct Offsets ++gvs_variable_sized_array_get_frame_offsets (GVariantSerialised value) + { ++ struct Offsets out = { 0, }; + gsize offsets_array_size; +- gsize offset_size; + gsize last_end; + + if (value.size == 0) +- return 0; +- +- offset_size = gvs_get_offset_size (value.size); ++ { ++ out.is_normal = TRUE; ++ return out; ++ } + +- last_end = gvs_read_unaligned_le (value.data + value.size - +- offset_size, offset_size); ++ out.offset_size = gvs_get_offset_size (value.size); ++ last_end = gvs_read_unaligned_le (value.data + value.size - out.offset_size, ++ out.offset_size); + + if (last_end > value.size) +- return 0; ++ return out; /* offsets not normal */ + + offsets_array_size = value.size - last_end; + +- if (offsets_array_size % offset_size) +- return 0; ++ if (offsets_array_size % out.offset_size) ++ return out; /* offsets not normal */ ++ ++ out.data_size = last_end; ++ out.array = value.data + last_end; ++ out.length = offsets_array_size / out.offset_size; ++ out.is_normal = TRUE; + +- return offsets_array_size / offset_size; ++ return out; ++} ++ ++static gsize ++gvs_variable_sized_array_n_children (GVariantSerialised value) ++{ ++ return gvs_variable_sized_array_get_frame_offsets (value).length; + } + + static GVariantSerialised +@@ -666,8 +698,9 @@ gvs_variable_sized_array_get_child (GVariantSerialised value, + gsize index_) + { + GVariantSerialised child = { 0, }; +- gsize offset_size; +- gsize last_end; ++ ++ struct Offsets offsets = gvs_variable_sized_array_get_frame_offsets (value); ++ + gsize start; + gsize end; + +@@ -675,18 +708,11 @@ gvs_variable_sized_array_get_child (GVariantSerialised value, + g_variant_type_info_ref (child.type_info); + child.depth = value.depth + 1; + +- offset_size = gvs_get_offset_size (value.size); +- +- last_end = gvs_read_unaligned_le (value.data + value.size - +- offset_size, offset_size); +- + if (index_ > 0) + { + guint alignment; + +- start = gvs_read_unaligned_le (value.data + last_end + +- (offset_size * (index_ - 1)), +- offset_size); ++ start = gvs_offsets_get_offset_n (&offsets, index_ - 1); + + g_variant_type_info_query (child.type_info, &alignment, NULL); + start += (-start) & alignment; +@@ -694,11 +720,9 @@ gvs_variable_sized_array_get_child (GVariantSerialised value, + else + start = 0; + +- end = gvs_read_unaligned_le (value.data + last_end + +- (offset_size * index_), +- offset_size); ++ end = gvs_offsets_get_offset_n (&offsets, index_); + +- if (start < end && end <= value.size && end <= last_end) ++ if (start < end && end <= value.size && end <= offsets.data_size) + { + child.data = value.data + start; + child.size = end - start; +@@ -770,34 +794,16 @@ static gboolean + gvs_variable_sized_array_is_normal (GVariantSerialised value) + { + GVariantSerialised child = { 0, }; +- gsize offsets_array_size; +- guchar *offsets_array; +- guint offset_size; + guint alignment; +- gsize last_end; +- gsize length; + gsize offset; + gsize i; + +- if (value.size == 0) +- return TRUE; +- +- offset_size = gvs_get_offset_size (value.size); +- last_end = gvs_read_unaligned_le (value.data + value.size - +- offset_size, offset_size); ++ struct Offsets offsets = gvs_variable_sized_array_get_frame_offsets (value); + +- if (last_end > value.size) ++ if (!offsets.is_normal) + return FALSE; + +- offsets_array_size = value.size - last_end; +- +- if (offsets_array_size % offset_size) +- return FALSE; +- +- offsets_array = value.data + value.size - offsets_array_size; +- length = offsets_array_size / offset_size; +- +- if (length == 0) ++ if (value.size != 0 && offsets.length == 0) + return FALSE; + + child.type_info = g_variant_type_info_element (value.type_info); +@@ -805,14 +811,14 @@ gvs_variable_sized_array_is_normal (GVariantSerialised value) + child.depth = value.depth + 1; + offset = 0; + +- for (i = 0; i < length; i++) ++ for (i = 0; i < offsets.length; i++) + { + gsize this_end; + +- this_end = gvs_read_unaligned_le (offsets_array + offset_size * i, +- offset_size); ++ this_end = gvs_read_unaligned_le (offsets.array + offsets.offset_size * i, ++ offsets.offset_size); + +- if (this_end < offset || this_end > last_end) ++ if (this_end < offset || this_end > offsets.data_size) + return FALSE; + + while (offset & alignment) +@@ -834,7 +840,7 @@ gvs_variable_sized_array_is_normal (GVariantSerialised value) + offset = this_end; + } + +- g_assert (offset == last_end); ++ g_assert (offset == offsets.data_size); + + return TRUE; + } +-- +GitLab + + +From 298a537d5f6783e55d87e40011ee3fd3b22b72f9 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Tue, 25 Oct 2022 18:05:52 +0100 +Subject: [PATCH 03/18] gvariant: Zero-initialise various GVariantSerialised + objects + +The following few commits will add a couple of new fields to +`GVariantSerialised`, and they should be zero-filled by default. + +Try and pre-empt that a bit by zero-filling `GVariantSerialised` by +default in a few places. + +Signed-off-by: Philip Withnall + +Helps: #2121 +--- + glib/gvariant.c | 2 +- + glib/tests/gvariant.c | 12 ++++++------ + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/glib/gvariant.c b/glib/gvariant.c +index 6863f341d6..e4c85ca636 100644 +--- a/glib/gvariant.c ++++ b/glib/gvariant.c +@@ -6002,7 +6002,7 @@ g_variant_byteswap (GVariant *value) + if (alignment) + /* (potentially) contains multi-byte numeric data */ + { +- GVariantSerialised serialised; ++ GVariantSerialised serialised = { 0, }; + GVariant *trusted; + GBytes *bytes; + +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c +index 058d02ad22..18fa855aeb 100644 +--- a/glib/tests/gvariant.c ++++ b/glib/tests/gvariant.c +@@ -1440,7 +1440,7 @@ test_maybe (void) + + for (flavour = 0; flavour < 8; flavour += alignment) + { +- GVariantSerialised serialised; ++ GVariantSerialised serialised = { 0, }; + GVariantSerialised child; + + serialised.type_info = type_info; +@@ -1564,7 +1564,7 @@ test_array (void) + + for (flavour = 0; flavour < 8; flavour += alignment) + { +- GVariantSerialised serialised; ++ GVariantSerialised serialised = { 0, }; + + serialised.type_info = array_info; + serialised.data = flavoured_malloc (needed_size, flavour); +@@ -1728,7 +1728,7 @@ test_tuple (void) + + for (flavour = 0; flavour < 8; flavour += alignment) + { +- GVariantSerialised serialised; ++ GVariantSerialised serialised = { 0, }; + + serialised.type_info = type_info; + serialised.data = flavoured_malloc (needed_size, flavour); +@@ -1823,7 +1823,7 @@ test_variant (void) + + for (flavour = 0; flavour < 8; flavour += alignment) + { +- GVariantSerialised serialised; ++ GVariantSerialised serialised = { 0, }; + GVariantSerialised child; + + serialised.type_info = type_info; +@@ -2270,7 +2270,7 @@ serialise_tree (TreeInstance *tree, + static void + test_byteswap (void) + { +- GVariantSerialised one, two; ++ GVariantSerialised one = { 0, }, two = { 0, }; + TreeInstance *tree; + + tree = tree_instance_new (NULL, 3); +@@ -2344,7 +2344,7 @@ test_serialiser_children (void) + static void + test_fuzz (gdouble *fuzziness) + { +- GVariantSerialised serialised; ++ GVariantSerialised serialised = { 0, }; + TreeInstance *tree; + + /* make an instance */ +-- +GitLab + + +From ade71fb544391b2e33e1859645726bfee0d5eaaf Mon Sep 17 00:00:00 2001 +From: William Manley +Date: Mon, 29 Jun 2020 16:59:44 +0100 +Subject: [PATCH 04/18] =?UTF-8?q?gvariant:=20Don=E2=80=99t=20allow=20child?= + =?UTF-8?q?=20elements=20to=20overlap=20with=20each=20other?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If different elements of a variable sized array can overlap with each +other then we can cause a `GVariant` to normalise to a much larger type. + +This commit changes the behaviour of `GVariant` with non-normal form data. If +an invalid frame offset is found all subsequent elements are given their +default value. + +When retrieving an element at index `n` we scan the frame offsets up to index +`n` and if they are not in order we return an element with the default value +for that type. This guarantees that elements don't overlap with each +other. We remember the offset we've scanned up to so we don't need to +repeat this work on subsequent accesses. We skip these checks for trusted +data. + +Unfortunately this makes random access of untrusted data O(n) — at least +on first access. It doesn't affect the algorithmic complexity of accessing +elements in order, such as when using the `GVariantIter` interface. Also: +the cost of validation will be amortised as the `GVariant` instance is +continued to be used. + +I've implemented this with 4 different functions, 1 for each element size, +rather than looping calling `gvs_read_unaligned_le` in the hope that the +compiler will find it easy to optimise and should produce fairly tight +code. + +Fixes: #2121 +--- + glib/gvariant-core.c | 35 ++++++++++++++++ + glib/gvariant-serialiser.c | 86 ++++++++++++++++++++++++++++++++++++-- + glib/gvariant-serialiser.h | 9 ++++ + glib/tests/gvariant.c | 45 ++++++++++++++++++++ + 4 files changed, 172 insertions(+), 3 deletions(-) + +diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c +index d5d78da88b..f25d472794 100644 +--- a/glib/gvariant-core.c ++++ b/glib/gvariant-core.c +@@ -67,6 +67,7 @@ struct _GVariant + { + GBytes *bytes; + gconstpointer data; ++ gsize ordered_offsets_up_to; + } serialised; + + struct +@@ -164,6 +165,24 @@ struct _GVariant + * if .data pointed to the appropriate number of nul + * bytes. + * ++ * .ordered_offsets_up_to: If ordered_offsets_up_to == n this means that all ++ * the frame offsets up to and including the frame ++ * offset determining the end of element n are in ++ * order. This guarantees that the bytes of element ++ * n don't overlap with any previous element. ++ * ++ * For trusted data this is set to G_MAXSIZE and we ++ * don't check that the frame offsets are in order. ++ * ++ * Note: This doesn't imply the offsets are good in ++ * any way apart from their ordering. In particular ++ * offsets may be out of bounds for this value or ++ * may imply that the data overlaps the frame ++ * offsets themselves. ++ * ++ * This field is only relevant for arrays of non ++ * fixed width types. ++ * + * .tree: Only valid when the instance is in tree form. + * + * Note that accesses from other threads could result in +@@ -367,6 +386,7 @@ g_variant_to_serialised (GVariant *value) + (gpointer) value->contents.serialised.data, + value->size, + value->depth, ++ value->contents.serialised.ordered_offsets_up_to, + }; + return serialised; + } +@@ -398,6 +418,7 @@ g_variant_serialise (GVariant *value, + serialised.size = value->size; + serialised.data = data; + serialised.depth = value->depth; ++ serialised.ordered_offsets_up_to = 0; + + children = (gpointer *) value->contents.tree.children; + n_children = value->contents.tree.n_children; +@@ -441,6 +462,15 @@ g_variant_fill_gvs (GVariantSerialised *serialised, + g_assert (serialised->size == value->size); + serialised->depth = value->depth; + ++ if (value->state & STATE_SERIALISED) ++ { ++ serialised->ordered_offsets_up_to = value->contents.serialised.ordered_offsets_up_to; ++ } ++ else ++ { ++ serialised->ordered_offsets_up_to = 0; ++ } ++ + if (serialised->data) + /* g_variant_store() is a public API, so it + * it will reacquire the lock if it needs to. +@@ -483,6 +513,7 @@ g_variant_ensure_serialised (GVariant *value) + bytes = g_bytes_new_take (data, value->size); + value->contents.serialised.data = g_bytes_get_data (bytes, NULL); + value->contents.serialised.bytes = bytes; ++ value->contents.serialised.ordered_offsets_up_to = G_MAXSIZE; + value->state |= STATE_SERIALISED; + } + } +@@ -563,6 +594,7 @@ g_variant_new_from_bytes (const GVariantType *type, + serialised.type_info = value->type_info; + serialised.data = (guchar *) g_bytes_get_data (bytes, &serialised.size); + serialised.depth = 0; ++ serialised.ordered_offsets_up_to = trusted ? G_MAXSIZE : 0; + + if (!g_variant_serialised_check (serialised)) + { +@@ -613,6 +645,8 @@ g_variant_new_from_bytes (const GVariantType *type, + value->contents.serialised.data = g_bytes_get_data (bytes, &value->size); + } + ++ value->contents.serialised.ordered_offsets_up_to = trusted ? G_MAXSIZE : 0; ++ + g_clear_pointer (&owned_bytes, g_bytes_unref); + + return value; +@@ -1132,6 +1166,7 @@ g_variant_get_child_value (GVariant *value, + child->contents.serialised.bytes = + g_bytes_ref (value->contents.serialised.bytes); + child->contents.serialised.data = s_child.data; ++ child->contents.serialised.ordered_offsets_up_to = s_child.ordered_offsets_up_to; + + return child; + } +diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c +index 1eaa80b29f..c33a903bff 100644 +--- a/glib/gvariant-serialiser.c ++++ b/glib/gvariant-serialiser.c +@@ -1,6 +1,7 @@ + /* + * Copyright © 2007, 2008 Ryan Lortie + * Copyright © 2010 Codethink Limited ++ * Copyright © 2020 William Manley + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -266,6 +267,7 @@ gvs_fixed_sized_maybe_get_child (GVariantSerialised value, + value.type_info = g_variant_type_info_element (value.type_info); + g_variant_type_info_ref (value.type_info); + value.depth++; ++ value.ordered_offsets_up_to = 0; + + return value; + } +@@ -297,7 +299,7 @@ gvs_fixed_sized_maybe_serialise (GVariantSerialised value, + { + if (n_children) + { +- GVariantSerialised child = { NULL, value.data, value.size, value.depth + 1 }; ++ GVariantSerialised child = { NULL, value.data, value.size, value.depth + 1, 0 }; + + gvs_filler (&child, children[0]); + } +@@ -319,6 +321,7 @@ gvs_fixed_sized_maybe_is_normal (GVariantSerialised value) + /* proper element size: "Just". recurse to the child. */ + value.type_info = g_variant_type_info_element (value.type_info); + value.depth++; ++ value.ordered_offsets_up_to = 0; + + return g_variant_serialised_is_normal (value); + } +@@ -360,6 +363,7 @@ gvs_variable_sized_maybe_get_child (GVariantSerialised value, + value.data = NULL; + + value.depth++; ++ value.ordered_offsets_up_to = 0; + + return value; + } +@@ -390,7 +394,7 @@ gvs_variable_sized_maybe_serialise (GVariantSerialised value, + { + if (n_children) + { +- GVariantSerialised child = { NULL, value.data, value.size - 1, value.depth + 1 }; ++ GVariantSerialised child = { NULL, value.data, value.size - 1, value.depth + 1, 0 }; + + /* write the data for the child. */ + gvs_filler (&child, children[0]); +@@ -410,6 +414,7 @@ gvs_variable_sized_maybe_is_normal (GVariantSerialised value) + value.type_info = g_variant_type_info_element (value.type_info); + value.size--; + value.depth++; ++ value.ordered_offsets_up_to = 0; + + return g_variant_serialised_is_normal (value); + } +@@ -693,6 +698,32 @@ gvs_variable_sized_array_n_children (GVariantSerialised value) + return gvs_variable_sized_array_get_frame_offsets (value).length; + } + ++/* Find the index of the first out-of-order element in @data, assuming that ++ * @data is an array of elements of given @type, starting at index @start and ++ * containing a further @len-@start elements. */ ++#define DEFINE_FIND_UNORDERED(type) \ ++ static gsize \ ++ find_unordered_##type (const guint8 *data, gsize start, gsize len) \ ++ { \ ++ gsize off; \ ++ type current, previous; \ ++ \ ++ memcpy (&previous, data + start * sizeof (current), sizeof (current)); \ ++ for (off = (start + 1) * sizeof (current); off < len * sizeof (current); off += sizeof (current)) \ ++ { \ ++ memcpy (¤t, data + off, sizeof (current)); \ ++ if (current < previous) \ ++ break; \ ++ previous = current; \ ++ } \ ++ return off / sizeof (current) - 1; \ ++ } ++ ++DEFINE_FIND_UNORDERED (guint8); ++DEFINE_FIND_UNORDERED (guint16); ++DEFINE_FIND_UNORDERED (guint32); ++DEFINE_FIND_UNORDERED (guint64); ++ + static GVariantSerialised + gvs_variable_sized_array_get_child (GVariantSerialised value, + gsize index_) +@@ -708,6 +739,49 @@ gvs_variable_sized_array_get_child (GVariantSerialised value, + g_variant_type_info_ref (child.type_info); + child.depth = value.depth + 1; + ++ /* If the requested @index_ is beyond the set of indices whose framing offsets ++ * have been checked, check the remaining offsets to see whether they’re ++ * normal (in order, no overlapping array elements). */ ++ if (index_ > value.ordered_offsets_up_to) ++ { ++ switch (offsets.offset_size) ++ { ++ case 1: ++ { ++ value.ordered_offsets_up_to = find_unordered_guint8 ( ++ offsets.array, value.ordered_offsets_up_to, index_ + 1); ++ break; ++ } ++ case 2: ++ { ++ value.ordered_offsets_up_to = find_unordered_guint16 ( ++ offsets.array, value.ordered_offsets_up_to, index_ + 1); ++ break; ++ } ++ case 4: ++ { ++ value.ordered_offsets_up_to = find_unordered_guint32 ( ++ offsets.array, value.ordered_offsets_up_to, index_ + 1); ++ break; ++ } ++ case 8: ++ { ++ value.ordered_offsets_up_to = find_unordered_guint64 ( ++ offsets.array, value.ordered_offsets_up_to, index_ + 1); ++ break; ++ } ++ default: ++ /* gvs_get_offset_size() only returns maximum 8 */ ++ g_assert_not_reached (); ++ } ++ } ++ ++ if (index_ > value.ordered_offsets_up_to) ++ { ++ /* Offsets are invalid somewhere, so return an empty child. */ ++ return child; ++ } ++ + if (index_ > 0) + { + guint alignment; +@@ -842,6 +916,9 @@ gvs_variable_sized_array_is_normal (GVariantSerialised value) + + g_assert (offset == offsets.data_size); + ++ /* All offsets have now been checked. */ ++ value.ordered_offsets_up_to = G_MAXSIZE; ++ + return TRUE; + } + +@@ -1078,7 +1155,7 @@ gvs_tuple_is_normal (GVariantSerialised value) + for (i = 0; i < length; i++) + { + const GVariantMemberInfo *member_info; +- GVariantSerialised child; ++ GVariantSerialised child = { 0, }; + gsize fixed_size; + guint alignment; + gsize end; +@@ -1138,6 +1215,9 @@ gvs_tuple_is_normal (GVariantSerialised value) + offset = end; + } + ++ /* All element bounds have been checked above. */ ++ value.ordered_offsets_up_to = G_MAXSIZE; ++ + { + gsize fixed_size; + guint alignment; +diff --git a/glib/gvariant-serialiser.h b/glib/gvariant-serialiser.h +index 6ced7e3d6c..a1bccb834b 100644 +--- a/glib/gvariant-serialiser.h ++++ b/glib/gvariant-serialiser.h +@@ -31,6 +31,15 @@ typedef struct + guchar *data; + gsize size; + gsize depth; /* same semantics as GVariant.depth */ ++ ++ /* If ordered_offsets_up_to == n this means that all the frame offsets up to and ++ * including the frame offset determining the end of element n are in order. ++ * This guarantees that the bytes of element n don't overlap with any previous ++ * element. ++ * ++ * This is both read and set by g_variant_serialised_get_child for arrays of ++ * non-fixed-width types */ ++ gsize ordered_offsets_up_to; + } GVariantSerialised; + + /* deserialisation */ +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c +index 18fa855aeb..45e302c926 100644 +--- a/glib/tests/gvariant.c ++++ b/glib/tests/gvariant.c +@@ -1,5 +1,6 @@ + /* + * Copyright © 2010 Codethink Limited ++ * Copyright © 2020 William Manley + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -1281,6 +1282,7 @@ random_instance_filler (GVariantSerialised *serialised, + serialised->size = instance->size; + + serialised->depth = 0; ++ serialised->ordered_offsets_up_to = 0; + + g_assert_true (serialised->type_info == instance->type_info); + g_assert_cmpuint (serialised->size, ==, instance->size); +@@ -5143,6 +5145,47 @@ test_normal_checking_array_offsets (void) + g_variant_unref (variant); + } + ++/* This is a regression test that we can't have non-normal values that take up ++ * significantly more space than the normal equivalent, by specifying the ++ * offset table entries so that array elements overlap. ++ * ++ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2121#note_832242 */ ++static void ++test_normal_checking_array_offsets2 (void) ++{ ++ const guint8 data[] = { ++ 'h', 'i', '\0', ++ 0x03, 0x00, 0x03, ++ 0x06, 0x00, 0x06, ++ 0x09, 0x00, 0x09, ++ 0x0c, 0x00, 0x0c, ++ 0x0f, 0x00, 0x0f, ++ 0x12, 0x00, 0x12, ++ 0x15, 0x00, 0x15, ++ }; ++ gsize size = sizeof (data); ++ const GVariantType *aaaaaaas = G_VARIANT_TYPE ("aaaaaaas"); ++ GVariant *variant = NULL; ++ GVariant *normal_variant = NULL; ++ GVariant *expected = NULL; ++ ++ variant = g_variant_new_from_data (aaaaaaas, data, size, FALSE, NULL, NULL); ++ g_assert_nonnull (variant); ++ ++ normal_variant = g_variant_get_normal_form (variant); ++ g_assert_nonnull (normal_variant); ++ g_assert_cmpuint (g_variant_get_size (normal_variant), <=, size * 2); ++ ++ expected = g_variant_new_parsed ( ++ "[[[[[[['hi', '', ''], [], []], [], []], [], []], [], []], [], []], [], []]"); ++ g_assert_cmpvariant (expected, variant); ++ g_assert_cmpvariant (expected, normal_variant); ++ ++ g_variant_unref (expected); ++ g_variant_unref (normal_variant); ++ g_variant_unref (variant); ++} ++ + /* Test that a tuple with invalidly large values in its offset table is + * normalised successfully without looping infinitely. */ + static void +@@ -5311,6 +5354,8 @@ main (int argc, char **argv) + test_normal_checking_tuples); + g_test_add_func ("/gvariant/normal-checking/array-offsets", + test_normal_checking_array_offsets); ++ g_test_add_func ("/gvariant/normal-checking/array-offsets2", ++ test_normal_checking_array_offsets2); + g_test_add_func ("/gvariant/normal-checking/tuple-offsets", + test_normal_checking_tuple_offsets); + g_test_add_func ("/gvariant/normal-checking/empty-object-path", +-- +GitLab + + +From 345cae9c1aa7bf6752039225ef4c8d8d69fa8d76 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 7 Jan 2022 15:03:52 +0000 +Subject: [PATCH 05/18] gvariant-serialiser: Factor out code to get bounds of a + tuple member + +This introduces no functional changes. + +Signed-off-by: Philip Withnall + +Helps: #2121 +--- + glib/gvariant-serialiser.c | 73 ++++++++++++++++++++++++-------------- + 1 file changed, 46 insertions(+), 27 deletions(-) + +diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c +index c33a903bff..5b67b3820f 100644 +--- a/glib/gvariant-serialiser.c ++++ b/glib/gvariant-serialiser.c +@@ -944,6 +944,51 @@ gvs_variable_sized_array_is_normal (GVariantSerialised value) + * for the tuple. See the notes in gvarianttypeinfo.h. + */ + ++static void ++gvs_tuple_get_member_bounds (GVariantSerialised value, ++ gsize index_, ++ gsize offset_size, ++ gsize *out_member_start, ++ gsize *out_member_end) ++{ ++ const GVariantMemberInfo *member_info; ++ gsize member_start, member_end; ++ ++ member_info = g_variant_type_info_member_info (value.type_info, index_); ++ ++ if (member_info->i + 1) ++ member_start = gvs_read_unaligned_le (value.data + value.size - ++ offset_size * (member_info->i + 1), ++ offset_size); ++ else ++ member_start = 0; ++ ++ member_start += member_info->a; ++ member_start &= member_info->b; ++ member_start |= member_info->c; ++ ++ if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_LAST) ++ member_end = value.size - offset_size * (member_info->i + 1); ++ ++ else if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_FIXED) ++ { ++ gsize fixed_size; ++ ++ g_variant_type_info_query (member_info->type_info, NULL, &fixed_size); ++ member_end = member_start + fixed_size; ++ } ++ ++ else /* G_VARIANT_MEMBER_ENDING_OFFSET */ ++ member_end = gvs_read_unaligned_le (value.data + value.size - ++ offset_size * (member_info->i + 2), ++ offset_size); ++ ++ if (out_member_start != NULL) ++ *out_member_start = member_start; ++ if (out_member_end != NULL) ++ *out_member_end = member_end; ++} ++ + static gsize + gvs_tuple_n_children (GVariantSerialised value) + { +@@ -999,33 +1044,7 @@ gvs_tuple_get_child (GVariantSerialised value, + } + } + +- if (member_info->i + 1) +- start = gvs_read_unaligned_le (value.data + value.size - +- offset_size * (member_info->i + 1), +- offset_size); +- else +- start = 0; +- +- start += member_info->a; +- start &= member_info->b; +- start |= member_info->c; +- +- if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_LAST) +- end = value.size - offset_size * (member_info->i + 1); +- +- else if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_FIXED) +- { +- gsize fixed_size; +- +- g_variant_type_info_query (child.type_info, NULL, &fixed_size); +- end = start + fixed_size; +- child.size = fixed_size; +- } +- +- else /* G_VARIANT_MEMBER_ENDING_OFFSET */ +- end = gvs_read_unaligned_le (value.data + value.size - +- offset_size * (member_info->i + 2), +- offset_size); ++ gvs_tuple_get_member_bounds (value, index_, offset_size, &start, &end); + + /* The child should not extend into the offset table. */ + if (index_ != g_variant_type_info_n_members (value.type_info) - 1) +-- +GitLab + + +From 73d0aa81c2575a5c9ae77dcb94da919579014fc0 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 7 Jan 2022 16:37:29 +0000 +Subject: [PATCH 06/18] gvariant-serialiser: Rework child size calculation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reduces a few duplicate calls to `g_variant_type_info_query()` and +explains why they’re needed. + +Signed-off-by: Philip Withnall + +Helps: #2121 +--- + glib/gvariant-serialiser.c | 31 +++++++++---------------------- + 1 file changed, 9 insertions(+), 22 deletions(-) + +diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c +index 5b67b3820f..bc131b7514 100644 +--- a/glib/gvariant-serialiser.c ++++ b/glib/gvariant-serialiser.c +@@ -1009,14 +1009,18 @@ gvs_tuple_get_child (GVariantSerialised value, + child.depth = value.depth + 1; + offset_size = gvs_get_offset_size (value.size); + ++ /* Ensure the size is set for fixed-sized children, or ++ * g_variant_serialised_check() will fail, even if we return ++ * (child.data == NULL) to indicate an error. */ ++ if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_FIXED) ++ g_variant_type_info_query (child.type_info, NULL, &child.size); ++ + /* tuples are the only (potentially) fixed-sized containers, so the + * only ones that have to deal with the possibility of having %NULL + * data with a non-zero %size if errors occurred elsewhere. + */ + if G_UNLIKELY (value.data == NULL && value.size != 0) + { +- g_variant_type_info_query (child.type_info, NULL, &child.size); +- + /* this can only happen in fixed-sized tuples, + * so the child must also be fixed sized. + */ +@@ -1034,29 +1038,12 @@ gvs_tuple_get_child (GVariantSerialised value, + else + { + if (offset_size * (member_info->i + 1) > value.size) +- { +- /* if the child is fixed size, return its size. +- * if child is not fixed-sized, return size = 0. +- */ +- g_variant_type_info_query (child.type_info, NULL, &child.size); +- +- return child; +- } ++ return child; + } + +- gvs_tuple_get_member_bounds (value, index_, offset_size, &start, &end); +- + /* The child should not extend into the offset table. */ +- if (index_ != g_variant_type_info_n_members (value.type_info) - 1) +- { +- GVariantSerialised last_child; +- last_child = gvs_tuple_get_child (value, +- g_variant_type_info_n_members (value.type_info) - 1); +- last_end = last_child.data + last_child.size - value.data; +- g_variant_type_info_unref (last_child.type_info); +- } +- else +- last_end = end; ++ gvs_tuple_get_member_bounds (value, index_, offset_size, &start, &end); ++ gvs_tuple_get_member_bounds (value, g_variant_type_info_n_members (value.type_info) - 1, offset_size, NULL, &last_end); + + if (start < end && end <= value.size && end <= last_end) + { +-- +GitLab + + +From 7cf6f5b69146d20948d42f0c476688fe17fef787 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 7 Jan 2022 16:42:14 +0000 +Subject: [PATCH 07/18] =?UTF-8?q?gvariant:=20Don=E2=80=99t=20allow=20child?= + =?UTF-8?q?=20elements=20of=20a=20tuple=20to=20overlap=20each=20other?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is similar to the earlier commit which prevents child elements of a +variable-sized array from overlapping each other, but this time for +tuples. It is based heavily on ideas by William Manley. + +Tuples are slightly different from variable-sized arrays in that they +contain a mixture of fixed and variable sized elements. All but one of +the variable sized elements have an entry in the frame offsets table. +This means that if we were to just check the ordering of the frame +offsets table, the variable sized elements could still overlap +interleaving fixed sized elements, which would be bad. + +Therefore we have to check the elements rather than the frame offsets. + +The logic of checking the elements up to the index currently being +requested, and caching the result in `ordered_offsets_up_to`, means that +the algorithmic cost implications are the same for this commit as for +variable-sized arrays: an O(N) cost for these checks is amortised out +over N accesses to O(1) per access. + +Signed-off-by: Philip Withnall + +Fixes: #2121 +--- + glib/gvariant-core.c | 6 +- + glib/gvariant-serialiser.c | 40 ++++++++ + glib/gvariant-serialiser.h | 7 +- + glib/gvariant.c | 1 + + glib/tests/gvariant.c | 181 +++++++++++++++++++++++++++++++++++++ + 5 files changed, 232 insertions(+), 3 deletions(-) + +diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c +index f25d472794..4419371136 100644 +--- a/glib/gvariant-core.c ++++ b/glib/gvariant-core.c +@@ -1,6 +1,7 @@ + /* + * Copyright © 2007, 2008 Ryan Lortie + * Copyright © 2010 Codethink Limited ++ * Copyright © 2022 Endless OS Foundation, LLC + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -181,7 +182,7 @@ struct _GVariant + * offsets themselves. + * + * This field is only relevant for arrays of non +- * fixed width types. ++ * fixed width types and for tuples. + * + * .tree: Only valid when the instance is in tree form. + * +@@ -1141,6 +1142,9 @@ g_variant_get_child_value (GVariant *value, + */ + s_child = g_variant_serialised_get_child (serialised, index_); + ++ /* Update the cached ordered_offsets_up_to, since @serialised will be thrown away when this function exits */ ++ value->contents.serialised.ordered_offsets_up_to = MAX (value->contents.serialised.ordered_offsets_up_to, serialised.ordered_offsets_up_to); ++ + /* Check whether this would cause nesting too deep. If so, return a fake + * child. The only situation we expect this to happen in is with a variant, + * as all other deeply-nested types have a static type, and hence should +diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c +index bc131b7514..263b74048c 100644 +--- a/glib/gvariant-serialiser.c ++++ b/glib/gvariant-serialiser.c +@@ -944,6 +944,10 @@ gvs_variable_sized_array_is_normal (GVariantSerialised value) + * for the tuple. See the notes in gvarianttypeinfo.h. + */ + ++/* Note: This doesn’t guarantee that @out_member_end >= @out_member_start; that ++ * condition may not hold true for invalid serialised variants. The caller is ++ * responsible for checking the returned values and handling invalid ones ++ * appropriately. */ + static void + gvs_tuple_get_member_bounds (GVariantSerialised value, + gsize index_, +@@ -1030,6 +1034,42 @@ gvs_tuple_get_child (GVariantSerialised value, + return child; + } + ++ /* If the requested @index_ is beyond the set of indices whose framing offsets ++ * have been checked, check the remaining offsets to see whether they’re ++ * normal (in order, no overlapping tuple elements). ++ * ++ * Unlike the checks in gvs_variable_sized_array_get_child(), we have to check ++ * all the tuple *elements* here, not just all the framing offsets, since ++ * tuples contain a mix of elements which use framing offsets and ones which ++ * don’t. None of them are allowed to overlap. */ ++ if (index_ > value.ordered_offsets_up_to) ++ { ++ gsize i, prev_i_end = 0; ++ ++ if (value.ordered_offsets_up_to > 0) ++ gvs_tuple_get_member_bounds (value, value.ordered_offsets_up_to - 1, offset_size, NULL, &prev_i_end); ++ ++ for (i = value.ordered_offsets_up_to; i <= index_; i++) ++ { ++ gsize i_start, i_end; ++ ++ gvs_tuple_get_member_bounds (value, i, offset_size, &i_start, &i_end); ++ ++ if (i_start > i_end || i_start < prev_i_end || i_end > value.size) ++ break; ++ ++ prev_i_end = i_end; ++ } ++ ++ value.ordered_offsets_up_to = i - 1; ++ } ++ ++ if (index_ > value.ordered_offsets_up_to) ++ { ++ /* Offsets are invalid somewhere, so return an empty child. */ ++ return child; ++ } ++ + if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_OFFSET) + { + if (offset_size * (member_info->i + 2) > value.size) +diff --git a/glib/gvariant-serialiser.h b/glib/gvariant-serialiser.h +index a1bccb834b..661bd8fd1b 100644 +--- a/glib/gvariant-serialiser.h ++++ b/glib/gvariant-serialiser.h +@@ -37,8 +37,11 @@ typedef struct + * This guarantees that the bytes of element n don't overlap with any previous + * element. + * +- * This is both read and set by g_variant_serialised_get_child for arrays of +- * non-fixed-width types */ ++ * This is both read and set by g_variant_serialised_get_child() for arrays of ++ * non-fixed-width types, and for tuples. ++ * ++ * Even when dealing with tuples, @ordered_offsets_up_to is an element index, ++ * rather than an index into the frame offsets. */ + gsize ordered_offsets_up_to; + } GVariantSerialised; + +diff --git a/glib/gvariant.c b/glib/gvariant.c +index e4c85ca636..4f0d6b83c6 100644 +--- a/glib/gvariant.c ++++ b/glib/gvariant.c +@@ -6011,6 +6011,7 @@ g_variant_byteswap (GVariant *value) + serialised.size = g_variant_get_size (trusted); + serialised.data = g_malloc (serialised.size); + serialised.depth = g_variant_get_depth (trusted); ++ serialised.ordered_offsets_up_to = G_MAXSIZE; /* operating on the normal form */ + g_variant_store (trusted, serialised.data); + g_variant_unref (trusted); + +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c +index 45e302c926..4ae52e2bb9 100644 +--- a/glib/tests/gvariant.c ++++ b/glib/tests/gvariant.c +@@ -1,6 +1,7 @@ + /* + * Copyright © 2010 Codethink Limited + * Copyright © 2020 William Manley ++ * Copyright © 2022 Endless OS Foundation, LLC + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -1449,6 +1450,7 @@ test_maybe (void) + serialised.data = flavoured_malloc (needed_size, flavour); + serialised.size = needed_size; + serialised.depth = 0; ++ serialised.ordered_offsets_up_to = 0; + + g_variant_serialiser_serialise (serialised, + random_instance_filler, +@@ -1572,6 +1574,7 @@ test_array (void) + serialised.data = flavoured_malloc (needed_size, flavour); + serialised.size = needed_size; + serialised.depth = 0; ++ serialised.ordered_offsets_up_to = 0; + + g_variant_serialiser_serialise (serialised, random_instance_filler, + (gpointer *) instances, n_children); +@@ -1736,6 +1739,7 @@ test_tuple (void) + serialised.data = flavoured_malloc (needed_size, flavour); + serialised.size = needed_size; + serialised.depth = 0; ++ serialised.ordered_offsets_up_to = 0; + + g_variant_serialiser_serialise (serialised, random_instance_filler, + (gpointer *) instances, n_children); +@@ -1832,6 +1836,7 @@ test_variant (void) + serialised.data = flavoured_malloc (needed_size, flavour); + serialised.size = needed_size; + serialised.depth = 0; ++ serialised.ordered_offsets_up_to = 0; + + g_variant_serialiser_serialise (serialised, random_instance_filler, + (gpointer *) &instance, 1); +@@ -5210,6 +5215,176 @@ test_normal_checking_tuple_offsets (void) + g_variant_unref (variant); + } + ++/* This is a regression test that we can't have non-normal values that take up ++ * significantly more space than the normal equivalent, by specifying the ++ * offset table entries so that tuple elements overlap. ++ * ++ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2121#note_838503 and ++ * https://gitlab.gnome.org/GNOME/glib/-/issues/2121#note_838513 */ ++static void ++test_normal_checking_tuple_offsets2 (void) ++{ ++ const GVariantType *data_type = G_VARIANT_TYPE ("(yyaiyyaiyy)"); ++ const guint8 data[] = { ++ 0x12, 0x34, 0x56, 0x78, 0x01, ++ /* ++ ^───────────────────┘ ++ ++ ^^^^^^^^^^ 1st yy ++ ^^^^^^^^^^ 2nd yy ++ ^^^^^^^^^^ 3rd yy ++ ^^^^ Framing offsets ++ */ ++ ++ /* If this variant was encoded normally, it would be something like this: ++ * 0x12, 0x34, pad, pad, [array bytes], 0x56, 0x78, pad, pad, [array bytes], 0x9A, 0xBC, 0xXX ++ * ^─────────────────────────────────────────────────────┘ ++ * ++ * ^^^^^^^^^^ 1st yy ++ * ^^^^^^^^^^ 2nd yy ++ * ^^^^^^^^^^ 3rd yy ++ * ^^^^ Framing offsets ++ */ ++ }; ++ gsize size = sizeof (data); ++ GVariant *variant = NULL; ++ GVariant *normal_variant = NULL; ++ GVariant *expected = NULL; ++ ++ variant = g_variant_new_from_data (data_type, data, size, FALSE, NULL, NULL); ++ g_assert_nonnull (variant); ++ ++ normal_variant = g_variant_get_normal_form (variant); ++ g_assert_nonnull (normal_variant); ++ g_assert_cmpuint (g_variant_get_size (normal_variant), <=, size * 3); ++ ++ expected = g_variant_new_parsed ( ++ "@(yyaiyyaiyy) (0x12, 0x34, [], 0x00, 0x00, [], 0x00, 0x00)"); ++ g_assert_cmpvariant (expected, variant); ++ g_assert_cmpvariant (expected, normal_variant); ++ ++ g_variant_unref (expected); ++ g_variant_unref (normal_variant); ++ g_variant_unref (variant); ++} ++ ++/* This is a regression test that overlapping entries in the offset table are ++ * decoded consistently, even though they’re non-normal. ++ * ++ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2121#note_910935 */ ++static void ++test_normal_checking_tuple_offsets3 (void) ++{ ++ /* The expected decoding of this non-normal byte stream is complex. See ++ * section 2.7.3 (Handling Non-Normal Serialised Data) of the GVariant ++ * specification. ++ * ++ * The rule “Child Values Overlapping Framing Offsets” from the specification ++ * says that the first `ay` must be decoded as `[0x01]` even though it ++ * overlaps the first byte of the offset table. However, since commit ++ * 7eedcd76f7d5b8c98fa60013e1fe6e960bf19df3, GLib explicitly doesn’t allow ++ * this as it’s exploitable. So the first `ay` must be given a default value. ++ * ++ * The second and third `ay`s must be given default values because of rule ++ * “End Boundary Precedes Start Boundary”. ++ * ++ * The `i` must be given a default value because of rule “Start or End ++ * Boundary of a Child Falls Outside the Container”. ++ */ ++ const GVariantType *data_type = G_VARIANT_TYPE ("(ayayiay)"); ++ const guint8 data[] = { ++ 0x01, 0x00, 0x02, ++ /* ++ ^──┘ ++ ++ ^^^^^^^^^^ 1st ay, bytes 0-2 (but given a default value anyway, see above) ++ 2nd ay, bytes 2-0 ++ i, bytes 0-4 ++ 3rd ay, bytes 4-1 ++ ^^^^^^^^^^ Framing offsets ++ */ ++ }; ++ gsize size = sizeof (data); ++ GVariant *variant = NULL; ++ GVariant *normal_variant = NULL; ++ GVariant *expected = NULL; ++ ++ variant = g_variant_new_from_data (data_type, data, size, FALSE, NULL, NULL); ++ g_assert_nonnull (variant); ++ ++ g_assert_false (g_variant_is_normal_form (variant)); ++ ++ normal_variant = g_variant_get_normal_form (variant); ++ g_assert_nonnull (normal_variant); ++ g_assert_cmpuint (g_variant_get_size (normal_variant), <=, size * 3); ++ ++ expected = g_variant_new_parsed ("@(ayayiay) ([], [], 0, [])"); ++ g_assert_cmpvariant (expected, variant); ++ g_assert_cmpvariant (expected, normal_variant); ++ ++ g_variant_unref (expected); ++ g_variant_unref (normal_variant); ++ g_variant_unref (variant); ++} ++ ++/* This is a regression test that overlapping entries in the offset table are ++ * decoded consistently, even though they’re non-normal. ++ * ++ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2121#note_910935 */ ++static void ++test_normal_checking_tuple_offsets4 (void) ++{ ++ /* The expected decoding of this non-normal byte stream is complex. See ++ * section 2.7.3 (Handling Non-Normal Serialised Data) of the GVariant ++ * specification. ++ * ++ * The rule “Child Values Overlapping Framing Offsets” from the specification ++ * says that the first `ay` must be decoded as `[0x01]` even though it ++ * overlaps the first byte of the offset table. However, since commit ++ * 7eedcd76f7d5b8c98fa60013e1fe6e960bf19df3, GLib explicitly doesn’t allow ++ * this as it’s exploitable. So the first `ay` must be given a default value. ++ * ++ * The second `ay` must be given a default value because of rule “End Boundary ++ * Precedes Start Boundary”. ++ * ++ * The third `ay` must be given a default value because its framing offsets ++ * overlap that of the first `ay`. ++ */ ++ const GVariantType *data_type = G_VARIANT_TYPE ("(ayayay)"); ++ const guint8 data[] = { ++ 0x01, 0x00, 0x02, ++ /* ++ ^──┘ ++ ++ ^^^^^^^^^^ 1st ay, bytes 0-2 (but given a default value anyway, see above) ++ 2nd ay, bytes 2-0 ++ 3rd ay, bytes 0-1 ++ ^^^^^^^^^^ Framing offsets ++ */ ++ }; ++ gsize size = sizeof (data); ++ GVariant *variant = NULL; ++ GVariant *normal_variant = NULL; ++ GVariant *expected = NULL; ++ ++ variant = g_variant_new_from_data (data_type, data, size, FALSE, NULL, NULL); ++ g_assert_nonnull (variant); ++ ++ g_assert_false (g_variant_is_normal_form (variant)); ++ ++ normal_variant = g_variant_get_normal_form (variant); ++ g_assert_nonnull (normal_variant); ++ g_assert_cmpuint (g_variant_get_size (normal_variant), <=, size * 3); ++ ++ expected = g_variant_new_parsed ("@(ayayay) ([], [], [])"); ++ g_assert_cmpvariant (expected, variant); ++ g_assert_cmpvariant (expected, normal_variant); ++ ++ g_variant_unref (expected); ++ g_variant_unref (normal_variant); ++ g_variant_unref (variant); ++} ++ + /* Test that an empty object path is normalised successfully to the base object + * path, ‘/’. */ + static void +@@ -5358,6 +5533,12 @@ main (int argc, char **argv) + test_normal_checking_array_offsets2); + g_test_add_func ("/gvariant/normal-checking/tuple-offsets", + test_normal_checking_tuple_offsets); ++ g_test_add_func ("/gvariant/normal-checking/tuple-offsets2", ++ test_normal_checking_tuple_offsets2); ++ g_test_add_func ("/gvariant/normal-checking/tuple-offsets3", ++ test_normal_checking_tuple_offsets3); ++ g_test_add_func ("/gvariant/normal-checking/tuple-offsets4", ++ test_normal_checking_tuple_offsets4); + g_test_add_func ("/gvariant/normal-checking/empty-object-path", + test_normal_checking_empty_object_path); + +-- +GitLab + + +From d1a293c4e29880b8d17bb826c9a426a440ca4a91 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Tue, 25 Oct 2022 15:14:14 +0100 +Subject: [PATCH 08/18] gvariant: Track checked and ordered offsets + independently + +The past few commits introduced the concept of known-good offsets in the +offset table (which is used for variable-width arrays and tuples). +Good offsets are ones which are non-overlapping with all the previous +offsets in the table. + +If a bad offset is encountered when indexing into the array or tuple, +the cached known-good offset index will not be increased. In this way, +all child variants at and beyond the first bad offset can be returned as +default values rather than dereferencing potentially invalid data. + +In this case, there was no information about the fact that the indexes +between the highest known-good index and the requested one had been +checked already. That could lead to a pathological case where an offset +table with an invalid first offset is repeatedly checked in full when +trying to access higher-indexed children. + +Avoid that by storing the index of the highest checked offset in the +table, as well as the index of the highest good/ordered offset. + +Signed-off-by: Philip Withnall + +Helps: #2121 +--- + glib/gvariant-core.c | 28 ++++++++++++++++++++++++ + glib/gvariant-serialiser.c | 44 +++++++++++++++++++++++++++----------- + glib/gvariant-serialiser.h | 9 ++++++++ + glib/gvariant.c | 1 + + glib/tests/gvariant.c | 5 +++++ + 5 files changed, 75 insertions(+), 12 deletions(-) + +diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c +index 4419371136..f660e2d578 100644 +--- a/glib/gvariant-core.c ++++ b/glib/gvariant-core.c +@@ -69,6 +69,7 @@ struct _GVariant + GBytes *bytes; + gconstpointer data; + gsize ordered_offsets_up_to; ++ gsize checked_offsets_up_to; + } serialised; + + struct +@@ -184,6 +185,24 @@ struct _GVariant + * This field is only relevant for arrays of non + * fixed width types and for tuples. + * ++ * .checked_offsets_up_to: Similarly to .ordered_offsets_up_to, this stores ++ * the index of the highest element, n, whose frame ++ * offsets (and all the preceding frame offsets) ++ * have been checked for validity. ++ * ++ * It is always the case that ++ * .checked_offsets_up_to ≥ .ordered_offsets_up_to. ++ * ++ * If .checked_offsets_up_to == .ordered_offsets_up_to, ++ * then a bad offset has not been found so far. ++ * ++ * If .checked_offsets_up_to > .ordered_offsets_up_to, ++ * then a bad offset has been found at ++ * (.ordered_offsets_up_to + 1). ++ * ++ * This field is only relevant for arrays of non ++ * fixed width types and for tuples. ++ * + * .tree: Only valid when the instance is in tree form. + * + * Note that accesses from other threads could result in +@@ -388,6 +407,7 @@ g_variant_to_serialised (GVariant *value) + value->size, + value->depth, + value->contents.serialised.ordered_offsets_up_to, ++ value->contents.serialised.checked_offsets_up_to, + }; + return serialised; + } +@@ -420,6 +440,7 @@ g_variant_serialise (GVariant *value, + serialised.data = data; + serialised.depth = value->depth; + serialised.ordered_offsets_up_to = 0; ++ serialised.checked_offsets_up_to = 0; + + children = (gpointer *) value->contents.tree.children; + n_children = value->contents.tree.n_children; +@@ -466,10 +487,12 @@ g_variant_fill_gvs (GVariantSerialised *serialised, + if (value->state & STATE_SERIALISED) + { + serialised->ordered_offsets_up_to = value->contents.serialised.ordered_offsets_up_to; ++ serialised->checked_offsets_up_to = value->contents.serialised.checked_offsets_up_to; + } + else + { + serialised->ordered_offsets_up_to = 0; ++ serialised->checked_offsets_up_to = 0; + } + + if (serialised->data) +@@ -515,6 +538,7 @@ g_variant_ensure_serialised (GVariant *value) + value->contents.serialised.data = g_bytes_get_data (bytes, NULL); + value->contents.serialised.bytes = bytes; + value->contents.serialised.ordered_offsets_up_to = G_MAXSIZE; ++ value->contents.serialised.checked_offsets_up_to = G_MAXSIZE; + value->state |= STATE_SERIALISED; + } + } +@@ -596,6 +620,7 @@ g_variant_new_from_bytes (const GVariantType *type, + serialised.data = (guchar *) g_bytes_get_data (bytes, &serialised.size); + serialised.depth = 0; + serialised.ordered_offsets_up_to = trusted ? G_MAXSIZE : 0; ++ serialised.checked_offsets_up_to = trusted ? G_MAXSIZE : 0; + + if (!g_variant_serialised_check (serialised)) + { +@@ -647,6 +672,7 @@ g_variant_new_from_bytes (const GVariantType *type, + } + + value->contents.serialised.ordered_offsets_up_to = trusted ? G_MAXSIZE : 0; ++ value->contents.serialised.checked_offsets_up_to = trusted ? G_MAXSIZE : 0; + + g_clear_pointer (&owned_bytes, g_bytes_unref); + +@@ -1144,6 +1170,7 @@ g_variant_get_child_value (GVariant *value, + + /* Update the cached ordered_offsets_up_to, since @serialised will be thrown away when this function exits */ + value->contents.serialised.ordered_offsets_up_to = MAX (value->contents.serialised.ordered_offsets_up_to, serialised.ordered_offsets_up_to); ++ value->contents.serialised.checked_offsets_up_to = MAX (value->contents.serialised.checked_offsets_up_to, serialised.checked_offsets_up_to); + + /* Check whether this would cause nesting too deep. If so, return a fake + * child. The only situation we expect this to happen in is with a variant, +@@ -1171,6 +1198,7 @@ g_variant_get_child_value (GVariant *value, + g_bytes_ref (value->contents.serialised.bytes); + child->contents.serialised.data = s_child.data; + child->contents.serialised.ordered_offsets_up_to = s_child.ordered_offsets_up_to; ++ child->contents.serialised.checked_offsets_up_to = s_child.checked_offsets_up_to; + + return child; + } +diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c +index 263b74048c..69baeeb395 100644 +--- a/glib/gvariant-serialiser.c ++++ b/glib/gvariant-serialiser.c +@@ -122,6 +122,8 @@ + * + * @depth has no restrictions; the depth of a top-level serialised #GVariant is + * zero, and it increases for each level of nested child. ++ * ++ * @checked_offsets_up_to is always ≥ @ordered_offsets_up_to + */ + + /* < private > +@@ -149,6 +151,9 @@ g_variant_serialised_check (GVariantSerialised serialised) + !(serialised.size == 0 || serialised.data != NULL)) + return FALSE; + ++ if (serialised.ordered_offsets_up_to > serialised.checked_offsets_up_to) ++ return FALSE; ++ + /* Depending on the native alignment requirements of the machine, the + * compiler will insert either 3 or 7 padding bytes after the char. + * This will result in the sizeof() the struct being 12 or 16. +@@ -268,6 +273,7 @@ gvs_fixed_sized_maybe_get_child (GVariantSerialised value, + g_variant_type_info_ref (value.type_info); + value.depth++; + value.ordered_offsets_up_to = 0; ++ value.checked_offsets_up_to = 0; + + return value; + } +@@ -299,7 +305,7 @@ gvs_fixed_sized_maybe_serialise (GVariantSerialised value, + { + if (n_children) + { +- GVariantSerialised child = { NULL, value.data, value.size, value.depth + 1, 0 }; ++ GVariantSerialised child = { NULL, value.data, value.size, value.depth + 1, 0, 0 }; + + gvs_filler (&child, children[0]); + } +@@ -322,6 +328,7 @@ gvs_fixed_sized_maybe_is_normal (GVariantSerialised value) + value.type_info = g_variant_type_info_element (value.type_info); + value.depth++; + value.ordered_offsets_up_to = 0; ++ value.checked_offsets_up_to = 0; + + return g_variant_serialised_is_normal (value); + } +@@ -364,6 +371,7 @@ gvs_variable_sized_maybe_get_child (GVariantSerialised value, + + value.depth++; + value.ordered_offsets_up_to = 0; ++ value.checked_offsets_up_to = 0; + + return value; + } +@@ -394,7 +402,7 @@ gvs_variable_sized_maybe_serialise (GVariantSerialised value, + { + if (n_children) + { +- GVariantSerialised child = { NULL, value.data, value.size - 1, value.depth + 1, 0 }; ++ GVariantSerialised child = { NULL, value.data, value.size - 1, value.depth + 1, 0, 0 }; + + /* write the data for the child. */ + gvs_filler (&child, children[0]); +@@ -415,6 +423,7 @@ gvs_variable_sized_maybe_is_normal (GVariantSerialised value) + value.size--; + value.depth++; + value.ordered_offsets_up_to = 0; ++ value.checked_offsets_up_to = 0; + + return g_variant_serialised_is_normal (value); + } +@@ -741,39 +750,46 @@ gvs_variable_sized_array_get_child (GVariantSerialised value, + + /* If the requested @index_ is beyond the set of indices whose framing offsets + * have been checked, check the remaining offsets to see whether they’re +- * normal (in order, no overlapping array elements). */ +- if (index_ > value.ordered_offsets_up_to) ++ * normal (in order, no overlapping array elements). ++ * ++ * Don’t bother checking if the highest known-good offset is lower than the ++ * highest checked offset, as that means there’s an invalid element at that ++ * index, so there’s no need to check further. */ ++ if (index_ > value.checked_offsets_up_to && ++ value.ordered_offsets_up_to == value.checked_offsets_up_to) + { + switch (offsets.offset_size) + { + case 1: + { + value.ordered_offsets_up_to = find_unordered_guint8 ( +- offsets.array, value.ordered_offsets_up_to, index_ + 1); ++ offsets.array, value.checked_offsets_up_to, index_ + 1); + break; + } + case 2: + { + value.ordered_offsets_up_to = find_unordered_guint16 ( +- offsets.array, value.ordered_offsets_up_to, index_ + 1); ++ offsets.array, value.checked_offsets_up_to, index_ + 1); + break; + } + case 4: + { + value.ordered_offsets_up_to = find_unordered_guint32 ( +- offsets.array, value.ordered_offsets_up_to, index_ + 1); ++ offsets.array, value.checked_offsets_up_to, index_ + 1); + break; + } + case 8: + { + value.ordered_offsets_up_to = find_unordered_guint64 ( +- offsets.array, value.ordered_offsets_up_to, index_ + 1); ++ offsets.array, value.checked_offsets_up_to, index_ + 1); + break; + } + default: + /* gvs_get_offset_size() only returns maximum 8 */ + g_assert_not_reached (); + } ++ ++ value.checked_offsets_up_to = index_; + } + + if (index_ > value.ordered_offsets_up_to) +@@ -918,6 +934,7 @@ gvs_variable_sized_array_is_normal (GVariantSerialised value) + + /* All offsets have now been checked. */ + value.ordered_offsets_up_to = G_MAXSIZE; ++ value.checked_offsets_up_to = G_MAXSIZE; + + return TRUE; + } +@@ -1042,14 +1059,15 @@ gvs_tuple_get_child (GVariantSerialised value, + * all the tuple *elements* here, not just all the framing offsets, since + * tuples contain a mix of elements which use framing offsets and ones which + * don’t. None of them are allowed to overlap. */ +- if (index_ > value.ordered_offsets_up_to) ++ if (index_ > value.checked_offsets_up_to && ++ value.ordered_offsets_up_to == value.checked_offsets_up_to) + { + gsize i, prev_i_end = 0; + +- if (value.ordered_offsets_up_to > 0) +- gvs_tuple_get_member_bounds (value, value.ordered_offsets_up_to - 1, offset_size, NULL, &prev_i_end); ++ if (value.checked_offsets_up_to > 0) ++ gvs_tuple_get_member_bounds (value, value.checked_offsets_up_to - 1, offset_size, NULL, &prev_i_end); + +- for (i = value.ordered_offsets_up_to; i <= index_; i++) ++ for (i = value.checked_offsets_up_to; i <= index_; i++) + { + gsize i_start, i_end; + +@@ -1062,6 +1080,7 @@ gvs_tuple_get_child (GVariantSerialised value, + } + + value.ordered_offsets_up_to = i - 1; ++ value.checked_offsets_up_to = index_; + } + + if (index_ > value.ordered_offsets_up_to) +@@ -1263,6 +1282,7 @@ gvs_tuple_is_normal (GVariantSerialised value) + + /* All element bounds have been checked above. */ + value.ordered_offsets_up_to = G_MAXSIZE; ++ value.checked_offsets_up_to = G_MAXSIZE; + + { + gsize fixed_size; +diff --git a/glib/gvariant-serialiser.h b/glib/gvariant-serialiser.h +index 661bd8fd1b..eb74fe7804 100644 +--- a/glib/gvariant-serialiser.h ++++ b/glib/gvariant-serialiser.h +@@ -43,6 +43,15 @@ typedef struct + * Even when dealing with tuples, @ordered_offsets_up_to is an element index, + * rather than an index into the frame offsets. */ + gsize ordered_offsets_up_to; ++ ++ /* Similar to @ordered_offsets_up_to. This gives the index of the child element ++ * whose frame offset is the highest in the offset table which has been ++ * checked so far. ++ * ++ * This is always ≥ @ordered_offsets_up_to. It is always an element index. ++ * ++ * See documentation in gvariant-core.c for `struct GVariant` for details. */ ++ gsize checked_offsets_up_to; + } GVariantSerialised; + + /* deserialisation */ +diff --git a/glib/gvariant.c b/glib/gvariant.c +index 4f0d6b83c6..fd066f1732 100644 +--- a/glib/gvariant.c ++++ b/glib/gvariant.c +@@ -6012,6 +6012,7 @@ g_variant_byteswap (GVariant *value) + serialised.data = g_malloc (serialised.size); + serialised.depth = g_variant_get_depth (trusted); + serialised.ordered_offsets_up_to = G_MAXSIZE; /* operating on the normal form */ ++ serialised.checked_offsets_up_to = G_MAXSIZE; + g_variant_store (trusted, serialised.data); + g_variant_unref (trusted); + +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c +index 4ae52e2bb9..d82aedd509 100644 +--- a/glib/tests/gvariant.c ++++ b/glib/tests/gvariant.c +@@ -1284,6 +1284,7 @@ random_instance_filler (GVariantSerialised *serialised, + + serialised->depth = 0; + serialised->ordered_offsets_up_to = 0; ++ serialised->checked_offsets_up_to = 0; + + g_assert_true (serialised->type_info == instance->type_info); + g_assert_cmpuint (serialised->size, ==, instance->size); +@@ -1451,6 +1452,7 @@ test_maybe (void) + serialised.size = needed_size; + serialised.depth = 0; + serialised.ordered_offsets_up_to = 0; ++ serialised.checked_offsets_up_to = 0; + + g_variant_serialiser_serialise (serialised, + random_instance_filler, +@@ -1575,6 +1577,7 @@ test_array (void) + serialised.size = needed_size; + serialised.depth = 0; + serialised.ordered_offsets_up_to = 0; ++ serialised.checked_offsets_up_to = 0; + + g_variant_serialiser_serialise (serialised, random_instance_filler, + (gpointer *) instances, n_children); +@@ -1740,6 +1743,7 @@ test_tuple (void) + serialised.size = needed_size; + serialised.depth = 0; + serialised.ordered_offsets_up_to = 0; ++ serialised.checked_offsets_up_to = 0; + + g_variant_serialiser_serialise (serialised, random_instance_filler, + (gpointer *) instances, n_children); +@@ -1837,6 +1841,7 @@ test_variant (void) + serialised.size = needed_size; + serialised.depth = 0; + serialised.ordered_offsets_up_to = 0; ++ serialised.checked_offsets_up_to = 0; + + g_variant_serialiser_serialise (serialised, random_instance_filler, + (gpointer *) &instance, 1); +-- +GitLab + + +From 6fa41d5bf61a249a395a83866c10fa4a79bbb7db Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 12 Jun 2020 18:01:13 +0100 +Subject: [PATCH 09/18] tests: Add another test for overlapping offsets in + GVariant + +Signed-off-by: Philip Withnall + +Helps: #2121 +--- + glib/tests/gvariant.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c +index d82aedd509..8ec94814e4 100644 +--- a/glib/tests/gvariant.c ++++ b/glib/tests/gvariant.c +@@ -5131,6 +5131,38 @@ test_recursion_limits_array_in_variant (void) + g_variant_unref (wrapper_variant); + } + ++/* Test that a nested array with invalid values in its offset table (which point ++ * from the inner to the outer array) is normalised successfully without ++ * looping infinitely. */ ++static void ++test_normal_checking_array_offsets_overlapped (void) ++{ ++ const guint8 data[] = { ++ 0x01, 0x00, ++ }; ++ gsize size = sizeof (data); ++ GVariant *variant = NULL; ++ GVariant *normal_variant = NULL; ++ GVariant *expected_variant = NULL; ++ ++ variant = g_variant_new_from_data (G_VARIANT_TYPE ("aay"), data, size, ++ FALSE, NULL, NULL); ++ g_assert_nonnull (variant); ++ ++ normal_variant = g_variant_get_normal_form (variant); ++ g_assert_nonnull (normal_variant); ++ ++ expected_variant = g_variant_new_parsed ("[@ay [], []]"); ++ g_assert_cmpvariant (normal_variant, expected_variant); ++ ++ g_assert_cmpmem (g_variant_get_data (normal_variant), g_variant_get_size (normal_variant), ++ g_variant_get_data (expected_variant), g_variant_get_size (expected_variant)); ++ ++ g_variant_unref (expected_variant); ++ g_variant_unref (normal_variant); ++ g_variant_unref (variant); ++} ++ + /* Test that an array with invalidly large values in its offset table is + * normalised successfully without looping infinitely. */ + static void +@@ -5532,6 +5564,8 @@ main (int argc, char **argv) + + g_test_add_func ("/gvariant/normal-checking/tuples", + test_normal_checking_tuples); ++ g_test_add_func ("/gvariant/normal-checking/array-offsets/overlapped", ++ test_normal_checking_array_offsets_overlapped); + g_test_add_func ("/gvariant/normal-checking/array-offsets", + test_normal_checking_array_offsets); + g_test_add_func ("/gvariant/normal-checking/array-offsets2", +-- +GitLab + + +From 4c0ddb26bc3f27eddf802b35c4b5229c0cdf6085 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Mon, 24 Oct 2022 16:43:23 +0100 +Subject: [PATCH 10/18] tests: Disable some random instance tests of GVariants +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Building a `GVariant` using entirely random data may result in a +non-normally-formed `GVariant`. It’s always possible to read these +`GVariant`s, but the API might return default values for some or all of +their components. + +In particular, this can easily happen when randomly generating the +offset tables for non-fixed-width container types. + +If it does happen, bytewise comparison of the parsed `GVariant` with the +original bytes will not always match. So skip those checks. + +Signed-off-by: Philip Withnall + +Helps: #2121 +--- + glib/tests/gvariant.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c +index 8ec94814e4..18aeb80f12 100644 +--- a/glib/tests/gvariant.c ++++ b/glib/tests/gvariant.c +@@ -1231,6 +1231,7 @@ random_instance_assert (RandomInstance *instance, + GRand *rand; + gsize i; + ++ g_assert_true (size == 0 || buffer != NULL); + g_assert_cmpint ((gsize) buffer & ALIGN_BITS & instance->alignment, ==, 0); + g_assert_cmpint (size, ==, instance->size); + +@@ -1457,10 +1458,13 @@ test_maybe (void) + g_variant_serialiser_serialise (serialised, + random_instance_filler, + (gpointer *) &instance, 1); ++ + child = g_variant_serialised_get_child (serialised, 0); + g_assert_true (child.type_info == instance->type_info); +- random_instance_assert (instance, child.data, child.size); ++ if (child.data != NULL) /* could be NULL if element is non-normal */ ++ random_instance_assert (instance, child.data, child.size); + g_variant_type_info_unref (child.type_info); ++ + flavoured_free (serialised.data, flavour); + } + } +@@ -1593,7 +1597,8 @@ test_array (void) + + child = g_variant_serialised_get_child (serialised, i); + g_assert_true (child.type_info == instances[i]->type_info); +- random_instance_assert (instances[i], child.data, child.size); ++ if (child.data != NULL) /* could be NULL if element is non-normal */ ++ random_instance_assert (instances[i], child.data, child.size); + g_variant_type_info_unref (child.type_info); + } + +@@ -1759,7 +1764,8 @@ test_tuple (void) + + child = g_variant_serialised_get_child (serialised, i); + g_assert_true (child.type_info == instances[i]->type_info); +- random_instance_assert (instances[i], child.data, child.size); ++ if (child.data != NULL) /* could be NULL if element is non-normal */ ++ random_instance_assert (instances[i], child.data, child.size); + g_variant_type_info_unref (child.type_info); + } + +-- +GitLab + + +From 35dee77ed887a9b4d24b7a0e45f237f813e52591 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Mon, 24 Oct 2022 18:14:57 +0100 +Subject: [PATCH 11/18] gvariant: Clarify the docs for + g_variant_get_normal_form() + +Document how non-normal parts of the `GVariant` are handled. + +Signed-off-by: Philip Withnall +--- + glib/gvariant.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/glib/gvariant.c b/glib/gvariant.c +index fd066f1732..a98f10b57a 100644 +--- a/glib/gvariant.c ++++ b/glib/gvariant.c +@@ -5936,7 +5936,9 @@ g_variant_deep_copy (GVariant *value) + * marked as trusted and a new reference to it is returned. + * + * If @value is found not to be in normal form then a new trusted +- * #GVariant is created with the same value as @value. ++ * #GVariant is created with the same value as @value. The non-normal parts of ++ * @value will be replaced with default values which are guaranteed to be in ++ * normal form. + * + * It makes sense to call this function if you've received #GVariant + * data from untrusted sources and you want to ensure your serialised +-- +GitLab + + +From e6490c84e84ba9f182fbd83b51ff4f9f5a0a1793 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Mon, 24 Oct 2022 18:43:55 +0100 +Subject: [PATCH 12/18] gvariant: Port g_variant_deep_copy() to count its + iterations directly + +This is equivalent to what `GVariantIter` does, but it means that +`g_variant_deep_copy()` is making its own `g_variant_get_child_value()` +calls. + +This will be useful in an upcoming commit, where those child values will +be inspected a little more deeply. + +Signed-off-by: Philip Withnall + +Helps: #2121 +--- + glib/gvariant.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/glib/gvariant.c b/glib/gvariant.c +index a98f10b57a..9334ec393e 100644 +--- a/glib/gvariant.c ++++ b/glib/gvariant.c +@@ -5863,14 +5863,13 @@ g_variant_deep_copy (GVariant *value) + case G_VARIANT_CLASS_VARIANT: + { + GVariantBuilder builder; +- GVariantIter iter; +- GVariant *child; ++ gsize i, n_children; + + g_variant_builder_init (&builder, g_variant_get_type (value)); +- g_variant_iter_init (&iter, value); + +- while ((child = g_variant_iter_next_value (&iter))) ++ for (i = 0, n_children = g_variant_n_children (value); i < n_children; i++) + { ++ GVariant *child = g_variant_get_child_value (value, i); + g_variant_builder_add_value (&builder, g_variant_deep_copy (child)); + g_variant_unref (child); + } +-- +GitLab + + +From 168f9b42e55053611ad473898f7afb06ce20b08a Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Tue, 25 Oct 2022 13:03:22 +0100 +Subject: [PATCH 13/18] gvariant: Add internal + g_variant_maybe_get_child_value() + +This will be used in a following commit. + +Signed-off-by: Philip Withnall + +Helps: #2540 +--- + glib/gvariant-core.c | 68 ++++++++++++++++++++++++++++++++++++++++++++ + glib/gvariant-core.h | 3 ++ + 2 files changed, 71 insertions(+) + +diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c +index f660e2d578..3fa97f91eb 100644 +--- a/glib/gvariant-core.c ++++ b/glib/gvariant-core.c +@@ -1204,6 +1204,74 @@ g_variant_get_child_value (GVariant *value, + } + } + ++/** ++ * g_variant_maybe_get_child_value: ++ * @value: a container #GVariant ++ * @index_: the index of the child to fetch ++ * ++ * Reads a child item out of a container #GVariant instance, if it is in normal ++ * form. If it is not in normal form, return %NULL. ++ * ++ * This function behaves the same as g_variant_get_child_value(), except that it ++ * returns %NULL if the child is not in normal form. g_variant_get_child_value() ++ * would instead return a new default value of the correct type. ++ * ++ * This is intended to be used internally to avoid unnecessary #GVariant ++ * allocations. ++ * ++ * The returned value is never floating. You should free it with ++ * g_variant_unref() when you're done with it. ++ * ++ * This function is O(1). ++ * ++ * Returns: (transfer full): the child at the specified index ++ * ++ * Since: 2.68 ++ */ ++GVariant * ++g_variant_maybe_get_child_value (GVariant *value, ++ gsize index_) ++{ ++ g_return_val_if_fail (index_ < g_variant_n_children (value), NULL); ++ g_return_val_if_fail (value->depth < G_MAXSIZE, NULL); ++ ++ if (~g_atomic_int_get (&value->state) & STATE_SERIALISED) ++ { ++ g_variant_lock (value); ++ ++ if (~value->state & STATE_SERIALISED) ++ { ++ GVariant *child; ++ ++ child = g_variant_ref (value->contents.tree.children[index_]); ++ g_variant_unlock (value); ++ ++ return child; ++ } ++ ++ g_variant_unlock (value); ++ } ++ ++ { ++ GVariantSerialised serialised = g_variant_to_serialised (value); ++ GVariantSerialised s_child; ++ ++ /* get the serializer to extract the serialized data for the child ++ * from the serialized data for the container ++ */ ++ s_child = g_variant_serialised_get_child (serialised, index_); ++ ++ if (!(value->state & STATE_TRUSTED) && s_child.data == NULL) ++ { ++ g_variant_type_info_unref (s_child.type_info); ++ return NULL; ++ } ++ ++ g_variant_type_info_unref (s_child.type_info); ++ return g_variant_get_child_value (value, index_); ++ } ++} ++ + /** + * g_variant_store: + * @value: the #GVariant to store +diff --git a/glib/gvariant-core.h b/glib/gvariant-core.h +index a1c34739a3..fb5f4bff45 100644 +--- a/glib/gvariant-core.h ++++ b/glib/gvariant-core.h +@@ -38,4 +38,7 @@ GVariantTypeInfo * g_variant_get_type_info (GVarian + + gsize g_variant_get_depth (GVariant *value); + ++GVariant * g_variant_maybe_get_child_value (GVariant *value, ++ gsize index_); ++ + #endif /* __G_VARIANT_CORE_H__ */ +-- +GitLab + + +From c2dc74e2ec9b846d88ac4dd4368a9e2ab377cf94 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Tue, 25 Oct 2022 13:03:45 +0100 +Subject: [PATCH 14/18] gvariant: Cut allocs of default values for children of + non-normal arrays +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This improves a slow case in `g_variant_get_normal_form()` where +allocating many identical default values for the children of a +variable-sized array which has a malformed offset table would take a lot +of time. + +The fix is to make all child values after the first invalid one be +references to the default value emitted for the first invalid one, +rather than identical new `GVariant`s. + +In particular, this fixes a case where an attacker could create an array +of length L of very large tuples of size T each, corrupt the offset table +so they don’t have to specify the array content, and then induce +`g_variant_get_normal_form()` into allocating L×T default values from an +input which is significantly smaller than L×T in length. + +A pre-existing workaround for this issue is for code to call +`g_variant_is_normal_form()` before calling +`g_variant_get_normal_form()`, and to skip the latter call if the former +returns false. This commit improves the behaviour in the case that +`g_variant_get_normal_form()` is called anyway. + +This fix changes the time to run the `fuzz_variant_binary` test on the +testcase from oss-fuzz#19777 from >60s (before being terminated) with +2.3GB of memory usage and 580k page faults; to 32s, 8.3MB of memory +usage and 1500 page faults (as measured by `time -v`). + +Signed-off-by: Philip Withnall + +Fixes: #2540 +oss-fuzz#19777 +--- + glib/gvariant.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 65 insertions(+), 1 deletion(-) + +diff --git a/glib/gvariant.c b/glib/gvariant.c +index 9334ec393e..356e199a0f 100644 +--- a/glib/gvariant.c ++++ b/glib/gvariant.c +@@ -5857,7 +5857,6 @@ g_variant_deep_copy (GVariant *value) + switch (g_variant_classify (value)) + { + case G_VARIANT_CLASS_MAYBE: +- case G_VARIANT_CLASS_ARRAY: + case G_VARIANT_CLASS_TUPLE: + case G_VARIANT_CLASS_DICT_ENTRY: + case G_VARIANT_CLASS_VARIANT: +@@ -5877,6 +5876,71 @@ g_variant_deep_copy (GVariant *value) + return g_variant_builder_end (&builder); + } + ++ case G_VARIANT_CLASS_ARRAY: ++ { ++ GVariantBuilder builder; ++ gsize i, n_children; ++ GVariant *first_invalid_child_deep_copy = NULL; ++ ++ /* Arrays are in theory treated the same as maybes, tuples, dict entries ++ * and variants, and could be another case in the above block of code. ++ * ++ * However, they have the property that when dealing with non-normal ++ * data (which is the only time g_variant_deep_copy() is currently ++ * called) in a variable-sized array, the code above can easily end up ++ * creating many default child values in order to return an array which ++ * is of the right length and type, but without containing non-normal ++ * data. This can happen if the offset table for the array is malformed. ++ * ++ * In this case, the code above would end up allocating the same default ++ * value for each one of the child indexes beyond the first malformed ++ * entry in the offset table. This can end up being a lot of identical ++ * allocations of default values, particularly if the non-normal array ++ * is crafted maliciously. ++ * ++ * Avoid that problem by returning a new reference to the same default ++ * value for every child after the first invalid one. This results in ++ * returning an equivalent array, in normal form and trusted — but with ++ * significantly fewer memory allocations. ++ * ++ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2540 */ ++ ++ g_variant_builder_init (&builder, g_variant_get_type (value)); ++ ++ for (i = 0, n_children = g_variant_n_children (value); i < n_children; i++) ++ { ++ /* Try maybe_get_child_value() first; if it returns NULL, this child ++ * is non-normal. get_child_value() would have constructed and ++ * returned a default value in that case. */ ++ GVariant *child = g_variant_maybe_get_child_value (value, i); ++ ++ if (child != NULL) ++ { ++ /* Non-normal children may not always be contiguous, as they may ++ * be non-normal for reasons other than invalid offset table ++ * entries. As they are all the same type, they will all have ++ * the same default value though, so keep that around. */ ++ g_variant_builder_add_value (&builder, g_variant_deep_copy (child)); ++ } ++ else if (child == NULL && first_invalid_child_deep_copy != NULL) ++ { ++ g_variant_builder_add_value (&builder, first_invalid_child_deep_copy); ++ } ++ else if (child == NULL) ++ { ++ child = g_variant_get_child_value (value, i); ++ first_invalid_child_deep_copy = g_variant_ref_sink (g_variant_deep_copy (child)); ++ g_variant_builder_add_value (&builder, first_invalid_child_deep_copy); ++ } ++ ++ g_clear_pointer (&child, g_variant_unref); ++ } ++ ++ g_clear_pointer (&first_invalid_child_deep_copy, g_variant_unref); ++ ++ return g_variant_builder_end (&builder); ++ } ++ + case G_VARIANT_CLASS_BOOLEAN: + return g_variant_new_boolean (g_variant_get_boolean (value)); + +-- +GitLab + + +From f98c60e4eedf775fb896c89bc83c71c96224f6aa Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Tue, 25 Oct 2022 18:03:56 +0100 +Subject: [PATCH 15/18] gvariant: Fix a leak of a GVariantTypeInfo on an error + handling path + +Signed-off-by: Philip Withnall +--- + glib/gvariant-core.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c +index 3fa97f91eb..f441c4757e 100644 +--- a/glib/gvariant-core.c ++++ b/glib/gvariant-core.c +@@ -1183,6 +1183,7 @@ g_variant_get_child_value (GVariant *value, + G_VARIANT_MAX_RECURSION_DEPTH - value->depth) + { + g_assert (g_variant_is_of_type (value, G_VARIANT_TYPE_VARIANT)); ++ g_variant_type_info_unref (s_child.type_info); + return g_variant_new_tuple (NULL, 0); + } + +-- +GitLab + + +From 5f4485c4ff57fdefb1661531788def7ca5a47328 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 27 Oct 2022 12:00:04 +0100 +Subject: [PATCH 16/18] gvariant-serialiser: Check offset table entry size is + minimal + +The entries in an offset table (which is used for variable sized arrays +and tuples containing variable sized members) are sized so that they can +address every byte in the overall variant. + +The specification requires that for a variant to be in normal form, its +offset table entries must be the minimum width such that they can +address every byte in the variant. + +That minimality requirement was not checked in +`g_variant_is_normal_form()`, leading to two different byte arrays being +interpreted as the normal form of a given variant tree. That kind of +confusion could potentially be exploited, and is certainly a bug. + +Fix it by adding the necessary checks on offset table entry width, and +unit tests. + +Spotted by William Manley. + +Signed-off-by: Philip Withnall + +Fixes: #2794 +--- + glib/gvariant-serialiser.c | 19 +++- + glib/tests/gvariant.c | 176 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 194 insertions(+), 1 deletion(-) + +diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c +index 69baeeb395..fadefab659 100644 +--- a/glib/gvariant-serialiser.c ++++ b/glib/gvariant-serialiser.c +@@ -696,6 +696,10 @@ gvs_variable_sized_array_get_frame_offsets (GVariantSerialised value) + out.data_size = last_end; + out.array = value.data + last_end; + out.length = offsets_array_size / out.offset_size; ++ ++ if (out.length > 0 && gvs_calculate_total_size (last_end, out.length) != value.size) ++ return out; /* offset size not minimal */ ++ + out.is_normal = TRUE; + + return out; +@@ -1207,6 +1211,7 @@ gvs_tuple_is_normal (GVariantSerialised value) + gsize length; + gsize offset; + gsize i; ++ gsize offset_table_size; + + /* as per the comment in gvs_tuple_get_child() */ + if G_UNLIKELY (value.data == NULL && value.size != 0) +@@ -1311,7 +1316,19 @@ gvs_tuple_is_normal (GVariantSerialised value) + } + } + +- return offset_ptr == offset; ++ /* @offset_ptr has been counting backwards from the end of the variant, to ++ * find the beginning of the offset table. @offset has been counting forwards ++ * from the beginning of the variant to find the end of the data. They should ++ * have met in the middle. */ ++ if (offset_ptr != offset) ++ return FALSE; ++ ++ offset_table_size = value.size - offset_ptr; ++ if (value.size > 0 && ++ gvs_calculate_total_size (offset, offset_table_size / offset_size) != value.size) ++ return FALSE; /* offset size not minimal */ ++ ++ return TRUE; + } + + /* Variants {{{2 +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c +index 18aeb80f12..d4893ed407 100644 +--- a/glib/tests/gvariant.c ++++ b/glib/tests/gvariant.c +@@ -5234,6 +5234,86 @@ test_normal_checking_array_offsets2 (void) + g_variant_unref (variant); + } + ++/* Test that an otherwise-valid serialised GVariant is considered non-normal if ++ * its offset table entries are too wide. ++ * ++ * See §2.3.6 (Framing Offsets) of the GVariant specification. */ ++static void ++test_normal_checking_array_offsets_minimal_sized (void) ++{ ++ GVariantBuilder builder; ++ gsize i; ++ GVariant *aay_constructed = NULL; ++ const guint8 *data = NULL; ++ guint8 *data_owned = NULL; ++ GVariant *aay_deserialised = NULL; ++ GVariant *aay_normalised = NULL; ++ ++ /* Construct an array of type aay, consisting of 128 elements which are each ++ * an empty array, i.e. `[[] * 128]`. This is chosen because the inner ++ * elements are variable sized (making the outer array variable sized, so it ++ * must have an offset table), but they are also zero-sized when serialised. ++ * So the serialised representation of @aay_constructed consists entirely of ++ * its offset table, which is entirely zeroes. ++ * ++ * The array is chosen to be 128 elements long because that means offset ++ * table entries which are 1 byte long. If the elements in the array were ++ * non-zero-sized (to the extent that the overall array is ≥256 bytes long), ++ * the offset table entries would end up being 2 bytes long. */ ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("aay")); ++ ++ for (i = 0; i < 128; i++) ++ g_variant_builder_add_value (&builder, g_variant_new_array (G_VARIANT_TYPE_BYTE, NULL, 0)); ++ ++ aay_constructed = g_variant_builder_end (&builder); ++ ++ /* Verify that the constructed array is in normal form, and its serialised ++ * form is `b'\0' * 128`. */ ++ g_assert_true (g_variant_is_normal_form (aay_constructed)); ++ g_assert_cmpuint (g_variant_n_children (aay_constructed), ==, 128); ++ g_assert_cmpuint (g_variant_get_size (aay_constructed), ==, 128); ++ ++ data = g_variant_get_data (aay_constructed); ++ for (i = 0; i < g_variant_get_size (aay_constructed); i++) ++ g_assert_cmpuint (data[i], ==, 0); ++ ++ /* Construct a serialised `aay` GVariant which is `b'\0' * 256`. This has to ++ * be a non-normal form of `[[] * 128]`, with 2-byte-long offset table ++ * entries, because each offset table entry has to be able to reference all of ++ * the byte boundaries in the container. All the entries in the offset table ++ * are zero, so all the elements of the array are zero-sized. */ ++ data = data_owned = g_malloc0 (256); ++ aay_deserialised = g_variant_new_from_data (G_VARIANT_TYPE ("aay"), ++ data, ++ 256, ++ FALSE, ++ g_free, ++ g_steal_pointer (&data_owned)); ++ ++ g_assert_false (g_variant_is_normal_form (aay_deserialised)); ++ g_assert_cmpuint (g_variant_n_children (aay_deserialised), ==, 128); ++ g_assert_cmpuint (g_variant_get_size (aay_deserialised), ==, 256); ++ ++ data = g_variant_get_data (aay_deserialised); ++ for (i = 0; i < g_variant_get_size (aay_deserialised); i++) ++ g_assert_cmpuint (data[i], ==, 0); ++ ++ /* Get its normal form. That should change the serialised size. */ ++ aay_normalised = g_variant_get_normal_form (aay_deserialised); ++ ++ g_assert_true (g_variant_is_normal_form (aay_normalised)); ++ g_assert_cmpuint (g_variant_n_children (aay_normalised), ==, 128); ++ g_assert_cmpuint (g_variant_get_size (aay_normalised), ==, 128); ++ ++ data = g_variant_get_data (aay_normalised); ++ for (i = 0; i < g_variant_get_size (aay_normalised); i++) ++ g_assert_cmpuint (data[i], ==, 0); ++ ++ g_variant_unref (aay_normalised); ++ g_variant_unref (aay_deserialised); ++ g_variant_unref (aay_constructed); ++} ++ + /* Test that a tuple with invalidly large values in its offset table is + * normalised successfully without looping infinitely. */ + static void +@@ -5428,6 +5508,98 @@ test_normal_checking_tuple_offsets4 (void) + g_variant_unref (variant); + } + ++/* Test that an otherwise-valid serialised GVariant is considered non-normal if ++ * its offset table entries are too wide. ++ * ++ * See §2.3.6 (Framing Offsets) of the GVariant specification. */ ++static void ++test_normal_checking_tuple_offsets_minimal_sized (void) ++{ ++ GString *type_string = NULL; ++ GVariantBuilder builder; ++ gsize i; ++ GVariant *ray_constructed = NULL; ++ const guint8 *data = NULL; ++ guint8 *data_owned = NULL; ++ GVariant *ray_deserialised = NULL; ++ GVariant *ray_normalised = NULL; ++ ++ /* Construct a tuple of type (ay…ay), consisting of 129 members which are each ++ * an empty array, i.e. `([] * 129)`. This is chosen because the inner ++ * members are variable sized, so the outer tuple must have an offset table, ++ * but they are also zero-sized when serialised. So the serialised ++ * representation of @ray_constructed consists entirely of its offset table, ++ * which is entirely zeroes. ++ * ++ * The tuple is chosen to be 129 members long because that means it has 128 ++ * offset table entries which are 1 byte long each. If the members in the ++ * tuple were non-zero-sized (to the extent that the overall tuple is ≥256 ++ * bytes long), the offset table entries would end up being 2 bytes long. ++ * ++ * 129 members are used unlike 128 array elements in ++ * test_normal_checking_array_offsets_minimal_sized(), because the last member ++ * in a tuple never needs an offset table entry. */ ++ type_string = g_string_new (""); ++ g_string_append_c (type_string, '('); ++ for (i = 0; i < 129; i++) ++ g_string_append (type_string, "ay"); ++ g_string_append_c (type_string, ')'); ++ ++ g_variant_builder_init (&builder, G_VARIANT_TYPE (type_string->str)); ++ ++ for (i = 0; i < 129; i++) ++ g_variant_builder_add_value (&builder, g_variant_new_array (G_VARIANT_TYPE_BYTE, NULL, 0)); ++ ++ ray_constructed = g_variant_builder_end (&builder); ++ ++ /* Verify that the constructed tuple is in normal form, and its serialised ++ * form is `b'\0' * 128`. */ ++ g_assert_true (g_variant_is_normal_form (ray_constructed)); ++ g_assert_cmpuint (g_variant_n_children (ray_constructed), ==, 129); ++ g_assert_cmpuint (g_variant_get_size (ray_constructed), ==, 128); ++ ++ data = g_variant_get_data (ray_constructed); ++ for (i = 0; i < g_variant_get_size (ray_constructed); i++) ++ g_assert_cmpuint (data[i], ==, 0); ++ ++ /* Construct a serialised `(ay…ay)` GVariant which is `b'\0' * 256`. This has ++ * to be a non-normal form of `([] * 129)`, with 2-byte-long offset table ++ * entries, because each offset table entry has to be able to reference all of ++ * the byte boundaries in the container. All the entries in the offset table ++ * are zero, so all the members of the tuple are zero-sized. */ ++ data = data_owned = g_malloc0 (256); ++ ray_deserialised = g_variant_new_from_data (G_VARIANT_TYPE (type_string->str), ++ data, ++ 256, ++ FALSE, ++ g_free, ++ g_steal_pointer (&data_owned)); ++ ++ g_assert_false (g_variant_is_normal_form (ray_deserialised)); ++ g_assert_cmpuint (g_variant_n_children (ray_deserialised), ==, 129); ++ g_assert_cmpuint (g_variant_get_size (ray_deserialised), ==, 256); ++ ++ data = g_variant_get_data (ray_deserialised); ++ for (i = 0; i < g_variant_get_size (ray_deserialised); i++) ++ g_assert_cmpuint (data[i], ==, 0); ++ ++ /* Get its normal form. That should change the serialised size. */ ++ ray_normalised = g_variant_get_normal_form (ray_deserialised); ++ ++ g_assert_true (g_variant_is_normal_form (ray_normalised)); ++ g_assert_cmpuint (g_variant_n_children (ray_normalised), ==, 129); ++ g_assert_cmpuint (g_variant_get_size (ray_normalised), ==, 128); ++ ++ data = g_variant_get_data (ray_normalised); ++ for (i = 0; i < g_variant_get_size (ray_normalised); i++) ++ g_assert_cmpuint (data[i], ==, 0); ++ ++ g_variant_unref (ray_normalised); ++ g_variant_unref (ray_deserialised); ++ g_variant_unref (ray_constructed); ++ g_string_free (type_string, TRUE); ++} ++ + /* Test that an empty object path is normalised successfully to the base object + * path, ‘/’. */ + static void +@@ -5576,6 +5748,8 @@ main (int argc, char **argv) + test_normal_checking_array_offsets); + g_test_add_func ("/gvariant/normal-checking/array-offsets2", + test_normal_checking_array_offsets2); ++ g_test_add_func ("/gvariant/normal-checking/array-offsets/minimal-sized", ++ test_normal_checking_array_offsets_minimal_sized); + g_test_add_func ("/gvariant/normal-checking/tuple-offsets", + test_normal_checking_tuple_offsets); + g_test_add_func ("/gvariant/normal-checking/tuple-offsets2", +@@ -5584,6 +5758,8 @@ main (int argc, char **argv) + test_normal_checking_tuple_offsets3); + g_test_add_func ("/gvariant/normal-checking/tuple-offsets4", + test_normal_checking_tuple_offsets4); ++ g_test_add_func ("/gvariant/normal-checking/tuple-offsets/minimal-sized", ++ test_normal_checking_tuple_offsets_minimal_sized); + g_test_add_func ("/gvariant/normal-checking/empty-object-path", + test_normal_checking_empty_object_path); + +-- +GitLab + + +From 4c4cf568f0f710baf0bd04d52df715636bc6b971 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 27 Oct 2022 16:13:54 +0100 +Subject: [PATCH 17/18] gvariant: Fix g_variant_byteswap() returning non-normal + data sometimes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If `g_variant_byteswap()` was called on a non-normal variant of a type +which doesn’t need byteswapping, it would return a non-normal output. + +That contradicts the documentation, which says that the return value is +always in normal form. + +Fix the code so it matches the documentation. + +Includes a unit test. + +Signed-off-by: Philip Withnall + +Helps: #2797 +--- + glib/gvariant.c | 8 +++++--- + glib/tests/gvariant.c | 24 ++++++++++++++++++++++++ + 2 files changed, 29 insertions(+), 3 deletions(-) + +diff --git a/glib/gvariant.c b/glib/gvariant.c +index 356e199a0f..f7b2e97036 100644 +--- a/glib/gvariant.c ++++ b/glib/gvariant.c +@@ -6084,14 +6084,16 @@ g_variant_byteswap (GVariant *value) + g_variant_serialised_byteswap (serialised); + + bytes = g_bytes_new_take (serialised.data, serialised.size); +- new = g_variant_new_from_bytes (g_variant_get_type (value), bytes, TRUE); ++ new = g_variant_ref_sink (g_variant_new_from_bytes (g_variant_get_type (value), bytes, TRUE)); + g_bytes_unref (bytes); + } + else + /* contains no multi-byte data */ +- new = value; ++ new = g_variant_get_normal_form (value); + +- return g_variant_ref_sink (new); ++ g_assert (g_variant_is_trusted (new)); ++ ++ return g_steal_pointer (&new); + } + + /** +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c +index d4893ed407..1e7ed16cc9 100644 +--- a/glib/tests/gvariant.c ++++ b/glib/tests/gvariant.c +@@ -3826,6 +3826,29 @@ test_gv_byteswap (void) + g_free (string); + } + ++static void ++test_gv_byteswap_non_normal_non_aligned (void) ++{ ++ const guint8 data[] = { 0x02 }; ++ GVariant *v = NULL; ++ GVariant *v_byteswapped = NULL; ++ ++ g_test_summary ("Test that calling g_variant_byteswap() on a variant which " ++ "is in non-normal form and doesn’t need byteswapping returns " ++ "the same variant in normal form."); ++ ++ v = g_variant_new_from_data (G_VARIANT_TYPE_BOOLEAN, data, sizeof (data), FALSE, NULL, NULL); ++ g_assert_false (g_variant_is_normal_form (v)); ++ ++ v_byteswapped = g_variant_byteswap (v); ++ g_assert_true (g_variant_is_normal_form (v_byteswapped)); ++ ++ g_assert_cmpvariant (v, v_byteswapped); ++ ++ g_variant_unref (v); ++ g_variant_unref (v_byteswapped); ++} ++ + static void + test_parser (void) + { +@@ -5711,6 +5734,7 @@ main (int argc, char **argv) + g_test_add_func ("/gvariant/builder-memory", test_builder_memory); + g_test_add_func ("/gvariant/hashing", test_hashing); + g_test_add_func ("/gvariant/byteswap", test_gv_byteswap); ++ g_test_add_func ("/gvariant/byteswap/non-normal-non-aligned", test_gv_byteswap_non_normal_non_aligned); + g_test_add_func ("/gvariant/parser", test_parses); + g_test_add_func ("/gvariant/parser/integer-bounds", test_parser_integer_bounds); + g_test_add_func ("/gvariant/parser/recursion", test_parser_recursion); +-- +GitLab + + +From a70a16b28bf78403dc86ae798c291ba167573d4a Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 27 Oct 2022 22:53:13 +0100 +Subject: [PATCH 18/18] gvariant: Allow g_variant_byteswap() to operate on + tree-form variants +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This avoids needing to always serialise a variant before byteswapping it. +With variants in non-normal forms, serialisation can result in a large +increase in size of the variant, and a lot of allocations for leaf +`GVariant`s. This can lead to a denial of service attack. + +Avoid that by changing byteswapping so that it happens on the tree form +of the variant if the input is in non-normal form. If the input is in +normal form (either serialised or in tree form), continue using the +existing code as byteswapping an already-serialised normal variant is +about 3× faster than byteswapping on the equivalent tree form. + +The existing unit tests cover byteswapping well, but need some +adaptation so that they operate on tree form variants too. + +I considered dropping the serialised byteswapping code and doing all +byteswapping on tree-form variants, as that would make maintenance +simpler (avoiding having two parallel implementations of byteswapping). +However, most inputs to `g_variant_byteswap()` are likely to be +serialised variants (coming from a byte array of input from some foreign +source) and most of them are going to be in normal form (as corruption +and malicious action are rare). So getting rid of the serialised +byteswapping code would impose quite a performance penalty on the common +case. + +Signed-off-by: Philip Withnall + +Fixes: #2797 +--- + glib/gvariant.c | 87 ++++++++++++++++++++++++++++++++----------- + glib/tests/gvariant.c | 57 ++++++++++++++++++++++++---- + 2 files changed, 115 insertions(+), 29 deletions(-) + +diff --git a/glib/gvariant.c b/glib/gvariant.c +index f7b2e97036..5fef88d58d 100644 +--- a/glib/gvariant.c ++++ b/glib/gvariant.c +@@ -5852,7 +5852,8 @@ g_variant_iter_loop (GVariantIter *iter, + + /* Serialised data {{{1 */ + static GVariant * +-g_variant_deep_copy (GVariant *value) ++g_variant_deep_copy (GVariant *value, ++ gboolean byteswap) + { + switch (g_variant_classify (value)) + { +@@ -5869,7 +5870,7 @@ g_variant_deep_copy (GVariant *value) + for (i = 0, n_children = g_variant_n_children (value); i < n_children; i++) + { + GVariant *child = g_variant_get_child_value (value, i); +- g_variant_builder_add_value (&builder, g_variant_deep_copy (child)); ++ g_variant_builder_add_value (&builder, g_variant_deep_copy (child, byteswap)); + g_variant_unref (child); + } + +@@ -5920,7 +5921,7 @@ g_variant_deep_copy (GVariant *value) + * be non-normal for reasons other than invalid offset table + * entries. As they are all the same type, they will all have + * the same default value though, so keep that around. */ +- g_variant_builder_add_value (&builder, g_variant_deep_copy (child)); ++ g_variant_builder_add_value (&builder, g_variant_deep_copy (child, byteswap)); + } + else if (child == NULL && first_invalid_child_deep_copy != NULL) + { +@@ -5929,7 +5930,7 @@ g_variant_deep_copy (GVariant *value) + else if (child == NULL) + { + child = g_variant_get_child_value (value, i); +- first_invalid_child_deep_copy = g_variant_ref_sink (g_variant_deep_copy (child)); ++ first_invalid_child_deep_copy = g_variant_ref_sink (g_variant_deep_copy (child, byteswap)); + g_variant_builder_add_value (&builder, first_invalid_child_deep_copy); + } + +@@ -5948,28 +5949,63 @@ g_variant_deep_copy (GVariant *value) + return g_variant_new_byte (g_variant_get_byte (value)); + + case G_VARIANT_CLASS_INT16: +- return g_variant_new_int16 (g_variant_get_int16 (value)); ++ if (byteswap) ++ return g_variant_new_int16 (GUINT16_SWAP_LE_BE (g_variant_get_int16 (value))); ++ else ++ return g_variant_new_int16 (g_variant_get_int16 (value)); + + case G_VARIANT_CLASS_UINT16: +- return g_variant_new_uint16 (g_variant_get_uint16 (value)); ++ if (byteswap) ++ return g_variant_new_uint16 (GUINT16_SWAP_LE_BE (g_variant_get_uint16 (value))); ++ else ++ return g_variant_new_uint16 (g_variant_get_uint16 (value)); + + case G_VARIANT_CLASS_INT32: +- return g_variant_new_int32 (g_variant_get_int32 (value)); ++ if (byteswap) ++ return g_variant_new_int32 (GUINT32_SWAP_LE_BE (g_variant_get_int32 (value))); ++ else ++ return g_variant_new_int32 (g_variant_get_int32 (value)); + + case G_VARIANT_CLASS_UINT32: +- return g_variant_new_uint32 (g_variant_get_uint32 (value)); ++ if (byteswap) ++ return g_variant_new_uint32 (GUINT32_SWAP_LE_BE (g_variant_get_uint32 (value))); ++ else ++ return g_variant_new_uint32 (g_variant_get_uint32 (value)); + + case G_VARIANT_CLASS_INT64: +- return g_variant_new_int64 (g_variant_get_int64 (value)); ++ if (byteswap) ++ return g_variant_new_int64 (GUINT64_SWAP_LE_BE (g_variant_get_int64 (value))); ++ else ++ return g_variant_new_int64 (g_variant_get_int64 (value)); + + case G_VARIANT_CLASS_UINT64: +- return g_variant_new_uint64 (g_variant_get_uint64 (value)); ++ if (byteswap) ++ return g_variant_new_uint64 (GUINT64_SWAP_LE_BE (g_variant_get_uint64 (value))); ++ else ++ return g_variant_new_uint64 (g_variant_get_uint64 (value)); + + case G_VARIANT_CLASS_HANDLE: +- return g_variant_new_handle (g_variant_get_handle (value)); ++ if (byteswap) ++ return g_variant_new_handle (GUINT32_SWAP_LE_BE (g_variant_get_handle (value))); ++ else ++ return g_variant_new_handle (g_variant_get_handle (value)); + + case G_VARIANT_CLASS_DOUBLE: +- return g_variant_new_double (g_variant_get_double (value)); ++ if (byteswap) ++ { ++ /* We have to convert the double to a uint64 here using a union, ++ * because a cast will round it numerically. */ ++ union ++ { ++ guint64 u64; ++ gdouble dbl; ++ } u1, u2; ++ u1.dbl = g_variant_get_double (value); ++ u2.u64 = GUINT64_SWAP_LE_BE (u1.u64); ++ return g_variant_new_double (u2.dbl); ++ } ++ else ++ return g_variant_new_double (g_variant_get_double (value)); + + case G_VARIANT_CLASS_STRING: + return g_variant_new_string (g_variant_get_string (value, NULL)); +@@ -6026,7 +6062,7 @@ g_variant_get_normal_form (GVariant *value) + if (g_variant_is_normal_form (value)) + return g_variant_ref (value); + +- trusted = g_variant_deep_copy (value); ++ trusted = g_variant_deep_copy (value, FALSE); + g_assert (g_variant_is_trusted (trusted)); + + return g_variant_ref_sink (trusted); +@@ -6046,6 +6082,11 @@ g_variant_get_normal_form (GVariant *value) + * contain multi-byte numeric data. That include strings, booleans, + * bytes and containers containing only these things (recursively). + * ++ * While this function can safely handle untrusted, non-normal data, it is ++ * recommended to check whether the input is in normal form beforehand, using ++ * g_variant_is_normal_form(), and to reject non-normal inputs if your ++ * application can be strict about what inputs it rejects. ++ * + * The returned value is always in normal form and is marked as trusted. + * + * Returns: (transfer full): the byteswapped form of @value +@@ -6064,22 +6105,21 @@ g_variant_byteswap (GVariant *value) + + g_variant_type_info_query (type_info, &alignment, NULL); + +- if (alignment) +- /* (potentially) contains multi-byte numeric data */ ++ if (alignment && g_variant_is_normal_form (value)) + { ++ /* (potentially) contains multi-byte numeric data, but is also already in ++ * normal form so we can use a faster byteswapping codepath on the ++ * serialised data */ + GVariantSerialised serialised = { 0, }; +- GVariant *trusted; + GBytes *bytes; + +- trusted = g_variant_get_normal_form (value); +- serialised.type_info = g_variant_get_type_info (trusted); +- serialised.size = g_variant_get_size (trusted); ++ serialised.type_info = g_variant_get_type_info (value); ++ serialised.size = g_variant_get_size (value); + serialised.data = g_malloc (serialised.size); +- serialised.depth = g_variant_get_depth (trusted); ++ serialised.depth = g_variant_get_depth (value); + serialised.ordered_offsets_up_to = G_MAXSIZE; /* operating on the normal form */ + serialised.checked_offsets_up_to = G_MAXSIZE; +- g_variant_store (trusted, serialised.data); +- g_variant_unref (trusted); ++ g_variant_store (value, serialised.data); + + g_variant_serialised_byteswap (serialised); + +@@ -6087,6 +6127,9 @@ g_variant_byteswap (GVariant *value) + new = g_variant_ref_sink (g_variant_new_from_bytes (g_variant_get_type (value), bytes, TRUE)); + g_bytes_unref (bytes); + } ++ else if (alignment) ++ /* (potentially) contains multi-byte numeric data */ ++ new = g_variant_ref_sink (g_variant_deep_copy (value, TRUE)); + else + /* contains no multi-byte data */ + new = g_variant_get_normal_form (value); +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c +index 1e7ed16cc9..3357488a4f 100644 +--- a/glib/tests/gvariant.c ++++ b/glib/tests/gvariant.c +@@ -2288,24 +2288,67 @@ serialise_tree (TreeInstance *tree, + static void + test_byteswap (void) + { +- GVariantSerialised one = { 0, }, two = { 0, }; ++ GVariantSerialised one = { 0, }, two = { 0, }, three = { 0, }; + TreeInstance *tree; +- ++ GVariant *one_variant = NULL; ++ GVariant *two_variant = NULL; ++ GVariant *two_byteswapped = NULL; ++ GVariant *three_variant = NULL; ++ GVariant *three_byteswapped = NULL; ++ guint8 *three_data_copy = NULL; ++ gsize three_size_copy = 0; ++ ++ /* Write a tree out twice, once normally and once byteswapped. */ + tree = tree_instance_new (NULL, 3); + serialise_tree (tree, &one); + ++ one_variant = g_variant_new_from_data (G_VARIANT_TYPE (g_variant_type_info_get_type_string (one.type_info)), ++ one.data, one.size, FALSE, NULL, NULL); ++ + i_am_writing_byteswapped = TRUE; + serialise_tree (tree, &two); ++ serialise_tree (tree, &three); + i_am_writing_byteswapped = FALSE; + +- g_variant_serialised_byteswap (two); +- +- g_assert_cmpmem (one.data, one.size, two.data, two.size); +- g_assert_cmpuint (one.depth, ==, two.depth); +- ++ /* Swap the first byteswapped one back using the function we want to test. */ ++ two_variant = g_variant_new_from_data (G_VARIANT_TYPE (g_variant_type_info_get_type_string (two.type_info)), ++ two.data, two.size, FALSE, NULL, NULL); ++ two_byteswapped = g_variant_byteswap (two_variant); ++ ++ /* Make the second byteswapped one non-normal (hopefully), and then byteswap ++ * it back using the function we want to test in its non-normal mode. ++ * This might not work because it’s not necessarily possible to make an ++ * arbitrary random variant non-normal. Adding a single zero byte to the end ++ * often makes something non-normal but still readable. */ ++ three_size_copy = three.size + 1; ++ three_data_copy = g_malloc (three_size_copy); ++ memcpy (three_data_copy, three.data, three.size); ++ three_data_copy[three.size] = '\0'; ++ ++ three_variant = g_variant_new_from_data (G_VARIANT_TYPE (g_variant_type_info_get_type_string (three.type_info)), ++ three_data_copy, three_size_copy, FALSE, NULL, NULL); ++ three_byteswapped = g_variant_byteswap (three_variant); ++ ++ /* Check they’re the same. We can always compare @one_variant and ++ * @two_byteswapped. We can only compare @two_byteswapped and ++ * @three_byteswapped if @two_variant and @three_variant are equal: in that ++ * case, the corruption to @three_variant was enough to make it non-normal but ++ * not enough to change its value. */ ++ g_assert_cmpvariant (one_variant, two_byteswapped); ++ ++ if (g_variant_equal (two_variant, three_variant)) ++ g_assert_cmpvariant (two_byteswapped, three_byteswapped); ++ ++ g_variant_unref (three_byteswapped); ++ g_variant_unref (three_variant); ++ g_variant_unref (two_byteswapped); ++ g_variant_unref (two_variant); ++ g_variant_unref (one_variant); + tree_instance_free (tree); + g_free (one.data); + g_free (two.data); ++ g_free (three.data); ++ g_free (three_data_copy); + } + + static void +-- +GitLab + diff --git a/patch/backport-CVE-2023-24593_CVE-2023-25180-2.patch b/patch/backport-CVE-2023-24593_CVE-2023-25180-2.patch new file mode 100644 index 0000000..3be2b75 --- /dev/null +++ b/patch/backport-CVE-2023-24593_CVE-2023-25180-2.patch @@ -0,0 +1,199 @@ +From 78da5faccb3e065116b75b3ff87ff55381da6c76 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 15 Dec 2022 13:00:39 +0000 +Subject: [PATCH 1/2] =?UTF-8?q?gvariant:=20Check=20offset=20table=20doesn?= + =?UTF-8?q?=E2=80=99t=20fall=20outside=20variant=20bounds?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When dereferencing the first entry in the offset table for a tuple, +check that it doesn’t fall outside the bounds of the variant first. + +This prevents an out-of-bounds read from some non-normal tuples. + +This bug was introduced in commit 73d0aa81c2575a5c9ae77d. + +Includes a unit test, although the test will likely only catch the +original bug if run with asan enabled. + +Signed-off-by: Philip Withnall + +Fixes: #2840 +oss-fuzz#54302 +--- + glib/gvariant-serialiser.c | 12 ++++++-- + glib/tests/gvariant.c | 63 ++++++++++++++++++++++++++++++++++++++ + 2 files changed, 72 insertions(+), 3 deletions(-) + +diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c +index f443c2eb85..4e4a73ad17 100644 +--- a/glib/gvariant-serialiser.c ++++ b/glib/gvariant-serialiser.c +@@ -984,7 +984,8 @@ gvs_tuple_get_member_bounds (GVariantSerialised value, + + member_info = g_variant_type_info_member_info (value.type_info, index_); + +- if (member_info->i + 1) ++ if (member_info->i + 1 && ++ offset_size * (member_info->i + 1) <= value.size) + member_start = gvs_read_unaligned_le (value.data + value.size - + offset_size * (member_info->i + 1), + offset_size); +@@ -995,7 +996,8 @@ gvs_tuple_get_member_bounds (GVariantSerialised value, + member_start &= member_info->b; + member_start |= member_info->c; + +- if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_LAST) ++ if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_LAST && ++ offset_size * (member_info->i + 1) <= value.size) + member_end = value.size - offset_size * (member_info->i + 1); + + else if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_FIXED) +@@ -1006,11 +1008,15 @@ gvs_tuple_get_member_bounds (GVariantSerialised value, + member_end = member_start + fixed_size; + } + +- else /* G_VARIANT_MEMBER_ENDING_OFFSET */ ++ else if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_OFFSET && ++ offset_size * (member_info->i + 2) <= value.size) + member_end = gvs_read_unaligned_le (value.data + value.size - + offset_size * (member_info->i + 2), + offset_size); + ++ else /* invalid */ ++ member_end = G_MAXSIZE; ++ + if (out_member_start != NULL) + *out_member_start = member_start; + if (out_member_end != NULL) +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c +index b360888e4d..98c51a1d75 100644 +--- a/glib/tests/gvariant.c ++++ b/glib/tests/gvariant.c +@@ -5576,6 +5576,67 @@ test_normal_checking_tuple_offsets4 (void) + g_variant_unref (variant); + } + ++/* This is a regression test that dereferencing the first element in the offset ++ * table doesn’t dereference memory before the start of the GVariant. The first ++ * element in the offset table gives the offset of the final member in the ++ * tuple (the offset table is stored in reverse), and the position of this final ++ * member is needed to check that none of the tuple members overlap with the ++ * offset table ++ * ++ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2840 */ ++static void ++test_normal_checking_tuple_offsets5 (void) ++{ ++ /* A tuple of type (sss) in normal form would have an offset table with two ++ * entries: ++ * - The first entry (lowest index in the table) gives the offset of the ++ * third `s` in the tuple, as the offset table is reversed compared to the ++ * tuple members. ++ * - The second entry (highest index in the table) gives the offset of the ++ * second `s` in the tuple. ++ * - The offset of the first `s` in the tuple is always 0. ++ * ++ * See §2.5.4 (Structures) of the GVariant specification for details, noting ++ * that the table is only layed out this way because all three members of the ++ * tuple have non-fixed sizes. ++ * ++ * It’s not clear whether the 0xaa data of this variant is part of the strings ++ * in the tuple, or part of the offset table. It doesn’t really matter. This ++ * is a regression test to check that the code to validate the offset table ++ * doesn’t unconditionally try to access the first entry in the offset table ++ * by subtracting the table size from the end of the GVariant data. ++ * ++ * In this non-normal case, that would result in an address off the start of ++ * the GVariant data, and an out-of-bounds read, because the GVariant is one ++ * byte long, but the offset table is calculated as two bytes long (with 1B ++ * sized entries) from the tuple’s type. ++ */ ++ const GVariantType *data_type = G_VARIANT_TYPE ("(sss)"); ++ const guint8 data[] = { 0xaa }; ++ gsize size = sizeof (data); ++ GVariant *variant = NULL; ++ GVariant *normal_variant = NULL; ++ GVariant *expected = NULL; ++ ++ g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2840"); ++ ++ variant = g_variant_new_from_data (data_type, data, size, FALSE, NULL, NULL); ++ g_assert_nonnull (variant); ++ ++ g_assert_false (g_variant_is_normal_form (variant)); ++ ++ normal_variant = g_variant_get_normal_form (variant); ++ g_assert_nonnull (normal_variant); ++ ++ expected = g_variant_new_parsed ("('', '', '')"); ++ g_assert_cmpvariant (expected, variant); ++ g_assert_cmpvariant (expected, normal_variant); ++ ++ g_variant_unref (expected); ++ g_variant_unref (normal_variant); ++ g_variant_unref (variant); ++} ++ + /* Test that an otherwise-valid serialised GVariant is considered non-normal if + * its offset table entries are too wide. + * +@@ -5827,6 +5888,8 @@ main (int argc, char **argv) + test_normal_checking_tuple_offsets3); + g_test_add_func ("/gvariant/normal-checking/tuple-offsets4", + test_normal_checking_tuple_offsets4); ++ g_test_add_func ("/gvariant/normal-checking/tuple-offsets5", ++ test_normal_checking_tuple_offsets5); + g_test_add_func ("/gvariant/normal-checking/tuple-offsets/minimal-sized", + test_normal_checking_tuple_offsets_minimal_sized); + g_test_add_func ("/gvariant/normal-checking/empty-object-path", +-- +GitLab + + +From 21a204147b16539b3eda3143b32844c49e29f4d4 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 15 Dec 2022 16:49:28 +0000 +Subject: [PATCH 2/2] gvariant: Propagate trust when getting a child of a + serialised variant + +If a variant is trusted, that means all its children are trusted, so +ensure that their checked offsets are set as such. + +This allows a lot of the offset table checks to be avoided when getting +children from trusted serialised tuples, which speeds things up. + +No unit test is included because this is just a performance fix. If +there are other slownesses, or regressions, in serialised `GVariant` +performance, the fuzzing setup will catch them like it did this one. + +This change does reduce the time to run the oss-fuzz reproducer from 80s +to about 0.7s on my machine. + +Signed-off-by: Philip Withnall + +Fixes: #2841 +oss-fuzz#54314 +--- + glib/gvariant-core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c +index f441c4757e..4778022829 100644 +--- a/glib/gvariant-core.c ++++ b/glib/gvariant-core.c +@@ -1198,8 +1198,8 @@ g_variant_get_child_value (GVariant *value, + child->contents.serialised.bytes = + g_bytes_ref (value->contents.serialised.bytes); + child->contents.serialised.data = s_child.data; +- child->contents.serialised.ordered_offsets_up_to = s_child.ordered_offsets_up_to; +- child->contents.serialised.checked_offsets_up_to = s_child.checked_offsets_up_to; ++ child->contents.serialised.ordered_offsets_up_to = (value->state & STATE_TRUSTED) ? G_MAXSIZE : s_child.ordered_offsets_up_to; ++ child->contents.serialised.checked_offsets_up_to = (value->state & STATE_TRUSTED) ? G_MAXSIZE : s_child.checked_offsets_up_to; + + return child; + } +-- +GitLab + diff --git a/patch/backport-Fix-memory-leak-in-gdbusauthmechanismsha1.patch b/patch/backport-Fix-memory-leak-in-gdbusauthmechanismsha1.patch new file mode 100644 index 0000000..39caff8 --- /dev/null +++ b/patch/backport-Fix-memory-leak-in-gdbusauthmechanismsha1.patch @@ -0,0 +1,26 @@ +From 6ec432386ef98e26e5079b060ad823277e10f41f Mon Sep 17 00:00:00 2001 +From: Loic Le Page +Date: Wed, 26 Jan 2022 14:20:08 +0100 +Subject: [PATCH] Fix memory leak in gio/gdbusauthmechanismsha1.c + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/6ec432386ef98e26e5079b060ad823277e10f41f + +--- + gio/gdbusauthmechanismsha1.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gio/gdbusauthmechanismsha1.c b/gio/gdbusauthmechanismsha1.c +index a82dddf839..8137b6352d 100644 +--- a/gio/gdbusauthmechanismsha1.c ++++ b/gio/gdbusauthmechanismsha1.c +@@ -909,6 +909,7 @@ keyring_generate_entry (const gchar *cookie_context, + _("(Additionally, releasing the lock for “%s” also failed: %s) "), + path, + local_error->message); ++ g_error_free (local_error); + } + } + else +-- +GitLab diff --git a/patch/backport-Handling-collision-between-standard-i-o-file-descriptors-and-newly-created-ones.patch b/patch/backport-Handling-collision-between-standard-i-o-file-descriptors-and-newly-created-ones.patch new file mode 100644 index 0000000..0dd94f7 --- /dev/null +++ b/patch/backport-Handling-collision-between-standard-i-o-file-descriptors-and-newly-created-ones.patch @@ -0,0 +1,68 @@ +From d9ba6150909818beb05573f54f26232063492c5b Mon Sep 17 00:00:00 2001 +From: Emmanuel Fleury +Date: Mon, 1 Aug 2022 19:05:14 +0200 +Subject: [PATCH] Handling collision between standard i/o file descriptors and + newly created ones + +Though unlikely to happen, it may happen that newly created file +descriptor take the value 0 (stdin), 1 (stdout) or 2 (stderr) if one +of the standard ones have been dismissed in between. So, it may +confuse the program if it is unaware of this change. + +The point of this patch is to avoid a reasign of standard file +descriptors on newly created ones. + +Closes issue #16 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/d9ba6150909818beb05573f54f26232063492c5b + +--- + glib/glib-unix.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/glib/glib-unix.c b/glib/glib-unix.c +index d2dea10ef0..d67b8a357a 100644 +--- a/glib/glib-unix.c ++++ b/glib/glib-unix.c +@@ -108,6 +108,17 @@ g_unix_open_pipe (int *fds, + ecode = pipe2 (fds, pipe2_flags); + if (ecode == -1 && errno != ENOSYS) + return g_unix_set_error_from_errno (error, errno); ++ /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */ ++ else if (fds[0] < 3 || fds[1] < 3) ++ { ++ int old_fds[2] = { fds[0], fds[1] }; ++ gboolean result = g_unix_open_pipe (fds, flags, error); ++ close (old_fds[0]); ++ close (old_fds[1]); ++ ++ if (!result) ++ g_unix_set_error_from_errno (error, errno); ++ } + else if (ecode == 0) + return TRUE; + /* Fall through on -ENOSYS, we must be running on an old kernel */ +@@ -116,6 +127,19 @@ g_unix_open_pipe (int *fds, + ecode = pipe (fds); + if (ecode == -1) + return g_unix_set_error_from_errno (error, errno); ++ /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */ ++ else if (fds[0] < 3 || fds[1] < 3) ++ { ++ int old_fds[2] = { fds[0], fds[1] }; ++ gboolean result = g_unix_open_pipe (fds, flags, error); ++ close (old_fds[0]); ++ close (old_fds[1]); ++ ++ if (!result) ++ g_unix_set_error_from_errno (error, errno); ++ ++ return result; ++ } + + if (flags == 0) + return TRUE; +-- +GitLab + diff --git a/patch/backport-Implement-GFileIface.set_display_name-for-resource-files.patch b/patch/backport-Implement-GFileIface.set_display_name-for-resource-files.patch new file mode 100644 index 0000000..ca4f557 --- /dev/null +++ b/patch/backport-Implement-GFileIface.set_display_name-for-resource-files.patch @@ -0,0 +1,52 @@ +From a9394bd68e222377f0156bf9c213b3f3a1e340d0 Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Sat, 30 Jul 2022 20:03:42 +0100 +Subject: [PATCH] Implement GFileIface.set_display_name() for resource files + +Resource files cannot be renamed, and GFileIface.set_display_name() is +mandatory. + +Fixes: #2705 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/a9394bd68e222377f0156bf9c213b3f3a1e340d0 + +--- + gio/gresourcefile.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/gio/gresourcefile.c b/gio/gresourcefile.c +index 340d3378b3..24f20f2903 100644 +--- a/gio/gresourcefile.c ++++ b/gio/gresourcefile.c +@@ -646,6 +646,19 @@ g_resource_file_monitor_file (GFile *file, + return g_object_new (g_resource_file_monitor_get_type (), NULL); + } + ++static GFile * ++g_resource_file_set_display_name (GFile *file, ++ const char *display_name, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ g_set_error_literal (error, ++ G_IO_ERROR, ++ G_IO_ERROR_NOT_SUPPORTED, ++ _("Resource files cannot be renamed")); ++ return NULL; ++} ++ + static void + g_resource_file_file_iface_init (GFileIface *iface) + { +@@ -664,6 +677,7 @@ g_resource_file_file_iface_init (GFileIface *iface) + iface->get_relative_path = g_resource_file_get_relative_path; + iface->resolve_relative_path = g_resource_file_resolve_relative_path; + iface->get_child_for_display_name = g_resource_file_get_child_for_display_name; ++ iface->set_display_name = g_resource_file_set_display_name; + iface->enumerate_children = g_resource_file_enumerate_children; + iface->query_info = g_resource_file_query_info; + iface->query_filesystem_info = g_resource_file_query_filesystem_info; +-- +GitLab + diff --git a/patch/backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch b/patch/backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch new file mode 100644 index 0000000..28939fa --- /dev/null +++ b/patch/backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch @@ -0,0 +1,67 @@ +From dad97d24d578dbefbebb41829b0ffb9e783cac7b Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 28 Oct 2022 11:21:04 -0400 +Subject: [PATCH] Revert "Handling collision between standard i/o file + descriptors and newly created ones" + +g_unix_open_pipe tries to avoid the standard io fd range +when getting pipe fds. This turns out to be a bad idea because +certain buggy programs rely on it using that range. + +This reverts commit d9ba6150909818beb05573f54f26232063492c5b + +Closes: #2795 +Reopens: #16 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/dad97d24d578dbefbebb41829b0ffb9e783cac7b + +--- + glib/glib-unix.c | 24 ------------------------ + 1 file changed, 24 deletions(-) + +diff --git a/glib/glib-unix.c b/glib/glib-unix.c +index 4710c51168..bc152d7663 100644 +--- a/glib/glib-unix.c ++++ b/glib/glib-unix.c +@@ -108,17 +108,6 @@ g_unix_open_pipe (int *fds, + ecode = pipe2 (fds, pipe2_flags); + if (ecode == -1 && errno != ENOSYS) + return g_unix_set_error_from_errno (error, errno); +- /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */ +- else if (fds[0] < 3 || fds[1] < 3) +- { +- int old_fds[2] = { fds[0], fds[1] }; +- gboolean result = g_unix_open_pipe (fds, flags, error); +- close (old_fds[0]); +- close (old_fds[1]); +- +- if (!result) +- g_unix_set_error_from_errno (error, errno); +- } + else if (ecode == 0) + return TRUE; + /* Fall through on -ENOSYS, we must be running on an old kernel */ +@@ -127,19 +116,6 @@ g_unix_open_pipe (int *fds, + ecode = pipe (fds); + if (ecode == -1) + return g_unix_set_error_from_errno (error, errno); +- /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */ +- else if (fds[0] < 3 || fds[1] < 3) +- { +- int old_fds[2] = { fds[0], fds[1] }; +- gboolean result = g_unix_open_pipe (fds, flags, error); +- close (old_fds[0]); +- close (old_fds[1]); +- +- if (!result) +- g_unix_set_error_from_errno (error, errno); +- +- return result; +- } + + if (flags == 0) + return TRUE; +-- +GitLab + diff --git a/patch/backport-add-OOM-handling-in-mimemagic.patch b/patch/backport-add-OOM-handling-in-mimemagic.patch new file mode 100644 index 0000000..3b69c4e --- /dev/null +++ b/patch/backport-add-OOM-handling-in-mimemagic.patch @@ -0,0 +1,52 @@ +From 9f1c59eef2e21b5a80c22d44deec2cba884cdfce Mon Sep 17 00:00:00 2001 +From: Egor Bychin +Date: Mon, 11 Oct 2021 15:31:01 +0300 +Subject: [PATCH] add OOM handling in mimemagic + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/9f1c59eef2e21b5a80c22d44deec2cba884cdfce + +--- + gio/xdgmime/xdgmimemagic.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/gio/xdgmime/xdgmimemagic.c b/gio/xdgmime/xdgmimemagic.c +index c68e27bedb..08b2c6da4f 100644 +--- a/gio/xdgmime/xdgmimemagic.c ++++ b/gio/xdgmime/xdgmimemagic.c +@@ -103,6 +103,8 @@ _xdg_mime_magic_matchlet_new (void) + XdgMimeMagicMatchlet *matchlet; + + matchlet = malloc (sizeof (XdgMimeMagicMatchlet)); ++ if (matchlet == NULL) ++ return NULL; + + matchlet->indent = 0; + matchlet->offset = 0; +@@ -355,6 +357,11 @@ _xdg_mime_magic_parse_magic_line (FILE *magic_file, + return XDG_MIME_MAGIC_ERROR; + + matchlet = _xdg_mime_magic_matchlet_new (); ++ ++ /* OOM */ ++ if (matchlet == NULL) ++ return XDG_MIME_MAGIC_ERROR; ++ + matchlet->indent = indent; + matchlet->offset = _xdg_mime_magic_read_a_number (magic_file, &end_of_file); + if (end_of_file) +@@ -767,6 +774,11 @@ _xdg_mime_magic_read_magic_file (XdgMimeMagic *mime_magic, + { + case XDG_MIME_MAGIC_SECTION: + match = _xdg_mime_magic_match_new (); ++ ++ /* OOM */ ++ if (match == NULL) ++ return; ++ + state = _xdg_mime_magic_parse_header (magic_file, match); + if (state == XDG_MIME_MAGIC_EOF || state == XDG_MIME_MAGIC_ERROR) + _xdg_mime_magic_match_free (match); +-- +GitLab + diff --git a/patch/backport-application-Unset-the-registered-state-after-shutting-down.patch b/patch/backport-application-Unset-the-registered-state-after-shutting-down.patch new file mode 100644 index 0000000..7101ea9 --- /dev/null +++ b/patch/backport-application-Unset-the-registered-state-after-shutting-down.patch @@ -0,0 +1,140 @@ +From 63873c0eb114faf6696874fe577912af687d67cf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Wed, 21 Apr 2021 06:17:36 +0200 +Subject: [PATCH] application: Unset the registered state after shutting down + +An application that has been shut down is still marked as registered +even if its implementation has been already destroyed. + +This may lead to unguarded crashes when calling functions that have +assumptions for being used with registered applications. + +So, when an application is registered, mark it as unregistered just +before destroying its implementation and after being shut down, so that +we follow the registration process in reversed order. + +Added tests + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/63873c0eb114faf6696874fe577912af687d67cf + +--- + gio/gapplication.c | 7 ++++ + gio/tests/gapplication.c | 76 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 83 insertions(+) + +diff --git a/gio/gapplication.c b/gio/gapplication.c +index 8e65176354..bf4a4cb650 100644 +--- a/gio/gapplication.c ++++ b/gio/gapplication.c +@@ -2578,6 +2578,13 @@ g_application_run (GApplication *application, + + if (application->priv->impl) + { ++ if (application->priv->is_registered) ++ { ++ application->priv->is_registered = FALSE; ++ ++ g_object_notify (G_OBJECT (application), "is-registered"); ++ } ++ + g_application_impl_flush (application->priv->impl); + g_application_impl_destroy (application->priv->impl); + application->priv->impl = NULL; +diff --git a/gio/tests/gapplication.c b/gio/tests/gapplication.c +index 900e7ac977..6f1a27e0f3 100644 +--- a/gio/tests/gapplication.c ++++ b/gio/tests/gapplication.c +@@ -576,6 +576,81 @@ test_quit (void) + g_free (binpath); + } + ++typedef struct ++{ ++ gboolean shutdown; ++ GParamSpec *notify_spec; /* (owned) (nullable) */ ++} RegisteredData; ++ ++static void ++on_registered_shutdown (GApplication *app, ++ gpointer user_data) ++{ ++ RegisteredData *registered_data = user_data; ++ ++ registered_data->shutdown = TRUE; ++} ++ ++static void ++on_registered_notify (GApplication *app, ++ GParamSpec *spec, ++ gpointer user_data) ++{ ++ RegisteredData *registered_data = user_data; ++ registered_data->notify_spec = g_param_spec_ref (spec); ++ ++ if (g_application_get_is_registered (app)) ++ g_assert_false (registered_data->shutdown); ++ else ++ g_assert_true (registered_data->shutdown); ++} ++ ++static void ++test_registered (void) ++{ ++ char *binpath = g_test_build_filename (G_TEST_BUILT, "unimportant", NULL); ++ gchar *argv[] = { binpath, NULL }; ++ RegisteredData registered_data = { FALSE, NULL }; ++ GApplication *app; ++ ++ app = g_application_new (NULL, G_APPLICATION_FLAGS_NONE); ++ g_signal_connect (app, "activate", G_CALLBACK (noappid_activate), NULL); ++ g_signal_connect (app, "shutdown", G_CALLBACK (on_registered_shutdown), ®istered_data); ++ g_signal_connect (app, "notify::is-registered", G_CALLBACK (on_registered_notify), ®istered_data); ++ ++ g_assert_null (registered_data.notify_spec); ++ ++ g_assert_true (g_application_register (app, NULL, NULL)); ++ g_assert_true (g_application_get_is_registered (app)); ++ ++ g_assert_nonnull (registered_data.notify_spec); ++ g_assert_cmpstr (registered_data.notify_spec->name, ==, "is-registered"); ++ g_clear_pointer (®istered_data.notify_spec, g_param_spec_unref); ++ ++ g_assert_false (registered_data.shutdown); ++ ++ g_application_run (app, 1, argv); ++ ++ g_assert_true (registered_data.shutdown); ++ g_assert_false (g_application_get_is_registered (app)); ++ g_assert_nonnull (registered_data.notify_spec); ++ g_assert_cmpstr (registered_data.notify_spec->name, ==, "is-registered"); ++ g_clear_pointer (®istered_data.notify_spec, g_param_spec_unref); ++ ++ /* Register it again */ ++ registered_data.shutdown = FALSE; ++ g_assert_true (g_application_register (app, NULL, NULL)); ++ g_assert_true (g_application_get_is_registered (app)); ++ g_assert_nonnull (registered_data.notify_spec); ++ g_assert_cmpstr (registered_data.notify_spec->name, ==, "is-registered"); ++ g_clear_pointer (®istered_data.notify_spec, g_param_spec_unref); ++ g_assert_false (registered_data.shutdown); ++ ++ g_object_unref (app); ++ ++ g_free (binpath); ++} ++ + static void + on_activate (GApplication *app) + { +@@ -1136,6 +1211,7 @@ main (int argc, char **argv) + g_test_add_func ("/gapplication/properties", properties); + g_test_add_func ("/gapplication/app-id", appid); + g_test_add_func ("/gapplication/quit", test_quit); ++ g_test_add_func ("/gapplication/registered", test_registered); + g_test_add_func ("/gapplication/local-actions", test_local_actions); + /* g_test_add_func ("/gapplication/remote-actions", test_remote_actions); */ + g_test_add_func ("/gapplication/local-command-line", test_local_command_line); +-- +GitLab + diff --git a/patch/backport-correctly-use-3-parameters-for-clise-range.patch b/patch/backport-correctly-use-3-parameters-for-clise-range.patch new file mode 100644 index 0000000..d9f366c --- /dev/null +++ b/patch/backport-correctly-use-3-parameters-for-clise-range.patch @@ -0,0 +1,28 @@ +From b71117d89434db83d34bc1b981ca03d4be299576 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 8 Jul 2021 17:26:43 -0700 +Subject: [PATCH] correctly use 3 parameters for close_range + +libc implementation has 3 parameter e.g. +https://www.freebsd.org/cgi/man.cgi?query=close_range&sektion=2&format=html + +Signed-off-by: Khem Raj +--- + glib/gspawn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/glib/gspawn.c b/glib/gspawn.c +index 899647c2f..3073a10a4 100644 +--- a/glib/gspawn.c ++++ b/glib/gspawn.c +@@ -1520,7 +1520,7 @@ safe_closefrom (int lowfd) + * + * Handle ENOSYS in case it’s supported in libc but not the kernel; if so, + * fall back to safe_fdwalk(). */ +- if (close_range (lowfd, G_MAXUINT) != 0 && errno == ENOSYS) ++ if (close_range (lowfd, G_MAXUINT, 0) != 0 && errno == ENOSYS) + #endif /* HAVE_CLOSE_RANGE */ + (void) safe_fdwalk (close_func, GINT_TO_POINTER (lowfd)); + #endif +-- +GitLab diff --git a/patch/backport-documentportal-Fix-small-leak-in-add_documents-with-empty-URI-list.patch b/patch/backport-documentportal-Fix-small-leak-in-add_documents-with-empty-URI-list.patch new file mode 100644 index 0000000..b0f8a1d --- /dev/null +++ b/patch/backport-documentportal-Fix-small-leak-in-add_documents-with-empty-URI-list.patch @@ -0,0 +1,34 @@ +From 27203e48c91ab8b55033dcf1773cb60c0aaed3fa Mon Sep 17 00:00:00 2001 +From: Sebastian Keller +Date: Tue, 30 Aug 2022 21:39:36 +0200 +Subject: [PATCH] documentportal: Fix small leak in add_documents with empty + URI list + +When called with an empty URI list (or only inaccessible files), +g_document_portal_add_documents would not call g_variant_builder_end, +leaking the memory allocated by the variant builder. + +Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/2733 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/27203e48c91ab8b55033dcf1773cb60c0aaed3fa + +--- + gio/gdocumentportal.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gio/gdocumentportal.c b/gio/gdocumentportal.c +index c08c36c581..382e2aab6e 100644 +--- a/gio/gdocumentportal.c ++++ b/gio/gdocumentportal.c +@@ -203,6 +203,7 @@ g_document_portal_add_documents (GList *uris, + else + { + ruris = g_list_copy_deep (uris, (GCopyFunc)g_strdup, NULL); ++ g_variant_builder_clear (&builder); + } + + out: +-- +GitLab + diff --git a/patch/backport-fix-a-memory-leak.patch b/patch/backport-fix-a-memory-leak.patch new file mode 100644 index 0000000..e303568 --- /dev/null +++ b/patch/backport-fix-a-memory-leak.patch @@ -0,0 +1,27 @@ +From df500c68a4d0741d1d6cf8ec3f8039a0d1f4b174 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ga=C3=ABl=20Bonithon?= +Date: Tue, 1 Jun 2021 17:43:45 +0200 +Subject: [PATCH] inotify: Fix a memory leak + +Fixes: #2311 +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/df500c68a4d0741d1d6cf8ec3f8039a0d1f4b174 +--- + gio/inotify/inotify-path.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gio/inotify/inotify-path.c b/gio/inotify/inotify-path.c +index f0528f4..e1129cd 100644 +--- a/gio/inotify/inotify-path.c ++++ b/gio/inotify/inotify-path.c +@@ -208,6 +208,7 @@ ip_watched_file_free (ip_watched_file_t *file) + g_assert (file->subs == NULL); + g_free (file->filename); + g_free (file->path); ++ g_free (file); + } + + static void +-- +2.27.0 + diff --git a/patch/backport-g_get_unix_mount_points-reduce-syscalls-inside-loop.patch b/patch/backport-g_get_unix_mount_points-reduce-syscalls-inside-loop.patch new file mode 100644 index 0000000..2c8c7f3 --- /dev/null +++ b/patch/backport-g_get_unix_mount_points-reduce-syscalls-inside-loop.patch @@ -0,0 +1,46 @@ +From 02d0d6497b92d05d1145d1077654ad2453938b6c Mon Sep 17 00:00:00 2001 +From: Rozhuk Ivan +Date: Sat, 25 Jun 2022 19:01:30 +0300 +Subject: [PATCH] [PATCH] _g_get_unix_mount_points(): reduce syscalls inside + loop + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/02d0d6497b92d05d1145d1077654ad2453938b6c + +--- + gio/gunixmounts.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) +diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c +index ba08245..92ab163 100644 +--- a/gio/gunixmounts.c ++++ b/gio/gunixmounts.c +@@ -1414,6 +1414,7 @@ _g_get_unix_mount_points (void) + GList *return_list = NULL; + G_LOCK_DEFINE_STATIC (fsent); + #ifdef HAVE_SYS_SYSCTL_H ++ uid_t uid = getuid (); + int usermnt = 0; + struct stat sb; + #endif +@@ -1466,14 +1467,13 @@ _g_get_unix_mount_points (void) + + #ifdef HAVE_SYS_SYSCTL_H + if (usermnt != 0) +- { +- uid_t uid = getuid (); +- if (stat (fstab->fs_file, &sb) == 0) +- { +- if (uid == 0 || sb.st_uid == uid) +- is_user_mountable = TRUE; +- } +- } ++ { ++ if (uid == 0 || ++ (stat (fstab->fs_file, &sb) == 0 && sb.st_uid == uid)) ++ { ++ is_user_mountable = TRUE; ++ } ++ } + #endif + + mount_point = create_unix_mount_point (fstab->fs_spec, diff --git a/patch/backport-gapplication-fix-arguments-leak-in-error-path.patch b/patch/backport-gapplication-fix-arguments-leak-in-error-path.patch new file mode 100644 index 0000000..6d833df --- /dev/null +++ b/patch/backport-gapplication-fix-arguments-leak-in-error-path.patch @@ -0,0 +1,44 @@ +From 65b4bc30eb38b1484533a2ee08f7229a9e961af8 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Wed, 31 Mar 2021 11:44:23 -0500 +Subject: [PATCH] gapplication: fix arguments leak in error path + +If this g_return_val_if_fail() is ever hit, then we leak arguments. +This is not very important because if your code hits +g_return_val_if_fail() you are invoking undefined behavior, a rather +more serious problem, but let's replace it with g_critical() to be +robust. + +This includes a small behavior change: it returns 1 rather than 0 in +this error case. + +Found by Coverity. + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/65b4bc30eb38b1484533a2ee08f7229a9e961af8 + +--- + gio/gapplication.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/gio/gapplication.c b/gio/gapplication.c +index 5a43202a5d..8e65176354 100644 +--- a/gio/gapplication.c ++++ b/gio/gapplication.c +@@ -2524,7 +2524,12 @@ g_application_run (GApplication *application, + + context = g_main_context_default (); + acquired_context = g_main_context_acquire (context); +- g_return_val_if_fail (acquired_context, 0); ++ if (!acquired_context) ++ { ++ g_critical ("g_application_run() cannot acquire the default main context because it is already acquired by another thread!"); ++ g_strfreev (arguments); ++ return 1; ++ } + + if (!G_APPLICATION_GET_CLASS (application) + ->local_command_line (application, &arguments, &status)) +-- +GitLab + diff --git a/patch/backport-garray-Fix-integer-overflows-in-element-capacity-calculations.patch b/patch/backport-garray-Fix-integer-overflows-in-element-capacity-calculations.patch new file mode 100644 index 0000000..10b9e40 --- /dev/null +++ b/patch/backport-garray-Fix-integer-overflows-in-element-capacity-calculations.patch @@ -0,0 +1,55 @@ +From 374a1895b62b2504d0b6ae1c404237802e73ddb6 Mon Sep 17 00:00:00 2001 +From: Tobias Stoeckmann +Date: Tue, 18 Jan 2022 13:45:13 +0000 +Subject: [PATCH] garray: Fix integer overflows in element capacity + calculations + +Integer overflows in size calculations of buffers (GArray and GPtrArray) +allow subsequent buffer overflows. This happens due to conversions +between gsize and guint. + +Proof of concept demonstrations of the overflows can be found in issue +2578. They are not being added as unit tests as they require too much +memory to test. + +This will affect `GArray`s which are 4GB in size, or `GPtrArray`s which +are 48GB in size. + +Fixes: #2578 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/374a1895b62b2504d0b6ae1c404237802e73ddb6 + +--- + glib/garray.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/glib/garray.c b/glib/garray.c +index 3803fee037..b441562154 100644 +--- a/glib/garray.c ++++ b/glib/garray.c +@@ -1001,7 +1001,7 @@ g_array_maybe_expand (GRealArray *array, + memset (g_array_elt_pos (array, array->elt_capacity), 0, + g_array_elt_len (array, want_len - array->elt_capacity)); + +- array->elt_capacity = want_alloc / array->elt_size; ++ array->elt_capacity = MIN (want_alloc / array->elt_size, G_MAXUINT); + } + } + +@@ -1518,9 +1518,10 @@ g_ptr_array_maybe_expand (GRealPtrArray *array, + if ((array->len + len) > array->alloc) + { + guint old_alloc = array->alloc; +- array->alloc = g_nearest_pow (array->len + len); +- array->alloc = MAX (array->alloc, MIN_ARRAY_SIZE); +- array->pdata = g_realloc (array->pdata, sizeof (gpointer) * array->alloc); ++ gsize want_alloc = g_nearest_pow (sizeof (gpointer) * (array->len + len)); ++ want_alloc = MAX (want_alloc, MIN_ARRAY_SIZE); ++ array->alloc = MIN (want_alloc / sizeof (gpointer), G_MAXUINT); ++ array->pdata = g_realloc (array->pdata, want_alloc); + if (G_UNLIKELY (g_mem_gc_friendly)) + for ( ; old_alloc < array->alloc; old_alloc++) + array->pdata [old_alloc] = NULL; +-- +GitLab diff --git a/patch/backport-garray-buffer-overflow-fix.patch b/patch/backport-garray-buffer-overflow-fix.patch new file mode 100644 index 0000000..f6ec4eb --- /dev/null +++ b/patch/backport-garray-buffer-overflow-fix.patch @@ -0,0 +1,279 @@ +From 995823b9d9e866ffb133cf3ff53e7e09da9f13d6 Mon Sep 17 00:00:00 2001 +From: Mark Weaver +Date: Tue, 19 Oct 2021 15:38:13 +0000 +Subject: [PATCH] #1331: buffer overflow fix + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/995823b9d9e866ffb133cf3ff53e7e09da9f13d6 + +--- + glib/garray.c | 57 ++++++++++++++++++++----------------- + glib/tests/array-test.c | 62 +++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 94 insertions(+), 25 deletions(-) + +diff --git a/glib/garray.c b/glib/garray.c +index 025747ee56..d072441906 100644 +--- a/glib/garray.c ++++ b/glib/garray.c +@@ -107,7 +107,7 @@ struct _GRealArray + { + guint8 *data; + guint len; +- guint alloc; ++ guint elt_capacity; + guint elt_size; + guint zero_terminated : 1; + guint clear : 1; +@@ -150,7 +150,7 @@ struct _GRealArray + * Returns: the element of the #GArray at the index given by @i + */ + +-#define g_array_elt_len(array,i) ((array)->elt_size * (i)) ++#define g_array_elt_len(array,i) ((gsize)(array)->elt_size * (i)) + #define g_array_elt_pos(array,i) ((array)->data + g_array_elt_len((array),(i))) + #define g_array_elt_zero(array, pos, len) \ + (memset (g_array_elt_pos ((array), pos), 0, g_array_elt_len ((array), len))) +@@ -159,7 +159,7 @@ struct _GRealArray + g_array_elt_zero ((array), (array)->len, 1); \ + }G_STMT_END + +-static guint g_nearest_pow (guint num) G_GNUC_CONST; ++static gsize g_nearest_pow (gsize num) G_GNUC_CONST; + static void g_array_maybe_expand (GRealArray *array, + guint len); + +@@ -181,6 +181,7 @@ g_array_new (gboolean zero_terminated, + guint elt_size) + { + g_return_val_if_fail (elt_size > 0, NULL); ++ g_return_val_if_fail (elt_size <= G_MAXUINT / 2 - 1, NULL); + + return g_array_sized_new (zero_terminated, clear, elt_size, 0); + } +@@ -232,7 +233,7 @@ g_array_steal (GArray *array, + + rarray->data = NULL; + rarray->len = 0; +- rarray->alloc = 0; ++ rarray->elt_capacity = 0; + return segment; + } + +@@ -261,12 +262,13 @@ g_array_sized_new (gboolean zero_terminated, + GRealArray *array; + + g_return_val_if_fail (elt_size > 0, NULL); ++ g_return_val_if_fail (elt_size <= G_MAXUINT, NULL); + + array = g_slice_new (GRealArray); + + array->data = NULL; + array->len = 0; +- array->alloc = 0; ++ array->elt_capacity = 0; + array->zero_terminated = (zero_terminated ? 1 : 0); + array->clear = (clear ? 1 : 0); + array->elt_size = elt_size; +@@ -471,7 +473,7 @@ array_free (GRealArray *array, + { + array->data = NULL; + array->len = 0; +- array->alloc = 0; ++ array->elt_capacity = 0; + } + else + { +@@ -966,22 +968,22 @@ g_array_binary_search (GArray *array, + return result; + } + +-/* Returns the smallest power of 2 greater than n, or n if +- * such power does not fit in a guint ++/* Returns the smallest power of 2 greater than or equal to n, ++ * or 0 if such power does not fit in a gsize + */ +-static guint +-g_nearest_pow (guint num) ++static gsize ++g_nearest_pow (gsize num) + { +- guint n = num - 1; ++ gsize n = num - 1; + +- g_assert (num > 0); ++ g_assert (num > 0 && num <= G_MAXSIZE / 2); + + n |= n >> 1; + n |= n >> 2; + n |= n >> 4; + n |= n >> 8; + n |= n >> 16; +-#if SIZEOF_INT == 8 ++#if GLIB_SIZEOF_SIZE_T == 8 + n |= n >> 32; + #endif + +@@ -992,26 +994,32 @@ static void + g_array_maybe_expand (GRealArray *array, + guint len) + { +- guint want_alloc; ++ guint max_len, want_len; ++ ++ /* The maximum array length is derived from following constraints: ++ * - The number of bytes must fit into a gsize / 2. ++ * - The number of elements must fit into guint. ++ * - zero terminated arrays must leave space for the terminating element ++ */ ++ max_len = MIN (G_MAXSIZE / 2 / array->elt_size, G_MAXUINT) - array->zero_terminated; + + /* Detect potential overflow */ +- if G_UNLIKELY ((G_MAXUINT - array->len) < len) ++ if G_UNLIKELY ((max_len - array->len) < len) + g_error ("adding %u to array would overflow", len); + +- want_alloc = g_array_elt_len (array, array->len + len + +- array->zero_terminated); +- +- if (want_alloc > array->alloc) ++ want_len = array->len + len + array->zero_terminated; ++ if (want_len > array->elt_capacity) + { +- want_alloc = g_nearest_pow (want_alloc); ++ gsize want_alloc = g_nearest_pow (g_array_elt_len (array, want_len)); + want_alloc = MAX (want_alloc, MIN_ARRAY_SIZE); + + array->data = g_realloc (array->data, want_alloc); + + if (G_UNLIKELY (g_mem_gc_friendly)) +- memset (array->data + array->alloc, 0, want_alloc - array->alloc); ++ memset (g_array_elt_pos (array, array->elt_capacity), 0, ++ g_array_elt_len (array, want_len - array->elt_capacity)); + +- array->alloc = want_alloc; ++ array->elt_capacity = want_alloc / array->elt_size; + } + } + +@@ -1297,7 +1305,7 @@ g_array_copy (GArray *array) + + new_rarray = + (GRealArray *) g_array_sized_new (rarray->zero_terminated, rarray->clear, +- rarray->elt_size, rarray->alloc / rarray->elt_size); ++ rarray->elt_size, rarray->elt_capacity); + new_rarray->len = rarray->len; + if (rarray->len > 0) + memcpy (new_rarray->data, rarray->data, rarray->len * rarray->elt_size); +@@ -2298,7 +2306,6 @@ g_byte_array_new_take (guint8 *data, + GRealArray *real; + + g_return_val_if_fail (len <= G_MAXUINT, NULL); +- + array = g_byte_array_new (); + real = (GRealArray *)array; + g_assert (real->data == NULL); +@@ -2306,7 +2313,7 @@ g_byte_array_new_take (guint8 *data, + + real->data = data; + real->len = len; +- real->alloc = len; ++ real->elt_capacity = len; + + return array; + } +diff --git a/glib/tests/array-test.c b/glib/tests/array-test.c +index 471f6171dc..79c5c31c32 100644 +--- a/glib/tests/array-test.c ++++ b/glib/tests/array-test.c +@@ -845,6 +845,45 @@ test_array_copy_sized (void) + g_array_unref (array1); + } + ++static void ++array_overflow_append_vals (void) ++{ ++ if (!g_test_undefined ()) ++ return; ++ ++ if (g_test_subprocess ()) ++ { ++ GArray *array = g_array_new (TRUE, FALSE, 1); ++ /* Check for overflow should happen before data is accessed. */ ++ g_array_append_vals (array, NULL, G_MAXUINT); ++ } ++ else ++ { ++ g_test_trap_subprocess (NULL, 0, 0); ++ g_test_trap_assert_failed (); ++ g_test_trap_assert_stderr ("*adding 4294967295 to array would overflow*"); ++ } ++} ++ ++static void ++array_overflow_set_size (void) ++{ ++ if (!g_test_undefined ()) ++ return; ++ ++ if (g_test_subprocess ()) ++ { ++ GArray *array = g_array_new (TRUE, FALSE, 1); ++ g_array_set_size (array, G_MAXUINT); ++ } ++ else ++ { ++ g_test_trap_subprocess (NULL, 0, 0); ++ g_test_trap_assert_failed (); ++ g_test_trap_assert_stderr ("*adding 4294967295 to array would overflow*"); ++ } ++} ++ + /* Check g_ptr_array_steal() function */ + static void + pointer_array_steal (void) +@@ -1643,6 +1682,26 @@ pointer_array_steal_index (void) + g_assert_cmpuint (i4, ==, 1); + } + ++static void ++byte_array_new_take_overflow (void) ++{ ++#if G_MAXSIZE <= G_MAXUINT ++ g_test_skip ("Overflow test requires G_MAXSIZE > G_MAXUINT."); ++#else ++ GByteArray* arr; ++ ++ if (!g_test_undefined ()) ++ return; ++ ++ /* Check for overflow should happen before data is accessed. */ ++ g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, ++ "*assertion 'len <= G_MAXUINT' failed"); ++ arr = g_byte_array_new_take (NULL, (gsize)G_MAXUINT + 1); ++ g_assert_null (arr); ++ g_test_assert_expected_messages (); ++#endif ++} ++ + static void + byte_array_steal (void) + { +@@ -1998,6 +2057,8 @@ main (int argc, char *argv[]) + g_test_add_func ("/array/clear-func", array_clear_func); + g_test_add_func ("/array/binary-search", test_array_binary_search); + g_test_add_func ("/array/copy-sized", test_array_copy_sized); ++ g_test_add_func ("/array/overflow-append-vals", array_overflow_append_vals); ++ g_test_add_func ("/array/overflow-set-size", array_overflow_set_size); + + for (i = 0; i < G_N_ELEMENTS (array_configurations); i++) + { +@@ -2043,6 +2104,7 @@ main (int argc, char *argv[]) + g_test_add_func ("/bytearray/sort", byte_array_sort); + g_test_add_func ("/bytearray/sort-with-data", byte_array_sort_with_data); + g_test_add_func ("/bytearray/new-take", byte_array_new_take); ++ g_test_add_func ("/bytearray/new-take-overflow", byte_array_new_take_overflow); + g_test_add_func ("/bytearray/free-to-bytes", byte_array_free_to_bytes); + + return g_test_run (); +-- +GitLab diff --git a/patch/backport-gdbusauth-fix-error-leak.patch b/patch/backport-gdbusauth-fix-error-leak.patch new file mode 100644 index 0000000..709b71e --- /dev/null +++ b/patch/backport-gdbusauth-fix-error-leak.patch @@ -0,0 +1,27 @@ +From 2b29495bcb59ba00bec808c509112dae6e019fd7 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Wed, 31 Mar 2021 14:12:39 -0500 +Subject: [PATCH] gdbusauth: fix error leak + +local_error is leaked in the G_IO_ERROR_NOT_SUPPORTED case. Found by +Coverity. + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/2b29495bcb59ba00bec808c509112dae6e019fd7 + +--- + gio/gdbusauth.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c +index c430f0cf03..534dca2d19 100644 +--- a/gio/gdbusauth.c ++++ b/gio/gdbusauth.c +@@ -1007,6 +1007,7 @@ _g_dbus_auth_run_server (GDBusAuth *auth, + g_propagate_error (error, local_error); + goto out; + } ++ g_clear_error (&local_error); + } + else + { diff --git a/patch/backport-gdbusconnection-Add-some-ownership-annotations.patch b/patch/backport-gdbusconnection-Add-some-ownership-annotations.patch new file mode 100644 index 0000000..0b27944 --- /dev/null +++ b/patch/backport-gdbusconnection-Add-some-ownership-annotations.patch @@ -0,0 +1,54 @@ +From a497fdf302bf67e4df2e1474389c0ff2152f1e99 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 24 Sep 2021 08:58:42 +0100 +Subject: [PATCH] gdbusconnection: Add some ownership annotations + +Signed-off-by: Philip Withnall + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/a497fdf302bf67e4df2e1474389c0ff2152f1e99 + +--- + gio/gdbusconnection.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c +index 24a50fcf20..40ce1b6fc7 100644 +--- a/gio/gdbusconnection.c ++++ b/gio/gdbusconnection.c +@@ -4086,11 +4086,11 @@ typedef struct + ExportedObject *eo; + + guint id; +- gchar *interface_name; +- GDBusInterfaceVTable *vtable; +- GDBusInterfaceInfo *interface_info; ++ gchar *interface_name; /* (owned) */ ++ GDBusInterfaceVTable *vtable; /* (owned) */ ++ GDBusInterfaceInfo *interface_info; /* (owned) */ + +- GMainContext *context; ++ GMainContext *context; /* (owned) */ + gpointer user_data; + GDestroyNotify user_data_free_func; + } ExportedInterface; +@@ -4116,12 +4116,12 @@ exported_interface_free (ExportedInterface *ei) + struct ExportedSubtree + { + guint id; +- gchar *object_path; +- GDBusConnection *connection; +- GDBusSubtreeVTable *vtable; ++ gchar *object_path; /* (owned) */ ++ GDBusConnection *connection; /* (unowned) */ ++ GDBusSubtreeVTable *vtable; /* (owned) */ + GDBusSubtreeFlags flags; + +- GMainContext *context; ++ GMainContext *context; /* (owned) */ + gpointer user_data; + GDestroyNotify user_data_free_func; + }; +-- +GitLab + diff --git a/patch/backport-gdbusconnection-Fix-race-between-method-calls-and-object-unregistration.patch b/patch/backport-gdbusconnection-Fix-race-between-method-calls-and-object-unregistration.patch new file mode 100644 index 0000000..7f3a610 --- /dev/null +++ b/patch/backport-gdbusconnection-Fix-race-between-method-calls-and-object-unregistration.patch @@ -0,0 +1,194 @@ +From 50fbf05d61db500df9052bb682d9c01e0bf51ffb Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 24 Sep 2021 10:52:41 +0100 +Subject: [PATCH] gdbusconnection: Fix race between method calls and object + unregistration + +If `g_dbus_connection_unregister_object()` (or `unregister_subtree()`) +was called from one thread, while an idle callback for a method call (or +a property get or set) was being invoked in another, it was possible for +the two to race after the idle callback had checked that the +object/subtree was registered, but before it had finished dereferencing +all the data related to that object/subtree. + +Unregistering the object/subtree would immediately free the data, +leading the idle callback to cause a use-after-free error. + +Fix that by giving the idle callback a strong reference to the data from +inside the locked section where it checks whether the object/subtree is +still registered. + +Signed-off-by: Philip Withnall + +Fixes: #2400 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/50fbf05d61db500df9052bb682d9c01e0bf51ffb + +--- + gio/gdbusconnection.c | 66 +++++++++++++++++++++++++++++++++++-------- + 1 file changed, 54 insertions(+), 12 deletions(-) + +diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c +index 71913c1ec1..e6c0b70b4e 100644 +--- a/gio/gdbusconnection.c ++++ b/gio/gdbusconnection.c +@@ -4116,6 +4116,9 @@ exported_interface_unref (ExportedInterface *ei) + g_dbus_interface_info_cache_release (ei->interface_info); + g_dbus_interface_info_unref ((GDBusInterfaceInfo *) ei->interface_info); + ++ /* All uses of ei->vtable from callbacks scheduled in idle functions must ++ * have completed by this call_destroy_notify() call, as language bindings ++ * may destroy function closures in this callback. */ + call_destroy_notify (ei->context, + ei->user_data_free_func, + ei->user_data); +@@ -4157,6 +4160,9 @@ exported_subtree_unref (ExportedSubtree *es) + if (!g_atomic_int_dec_and_test (&es->refcount)) + return; + ++ /* All uses of es->vtable from callbacks scheduled in idle functions must ++ * have completed by this call_destroy_notify() call, as language bindings ++ * may destroy function closures in this callback. */ + call_destroy_notify (es->context, + es->user_data_free_func, + es->user_data); +@@ -4174,30 +4180,45 @@ exported_subtree_unref (ExportedSubtree *es) + * @subtree_registration_id (if not zero) has been unregistered. If + * so, returns %TRUE. + * ++ * If not, sets @out_ei and/or @out_es to a strong reference to the relevant ++ * #ExportedInterface/#ExportedSubtree and returns %FALSE. ++ * + * May be called by any thread. Caller must *not* hold lock. + */ + static gboolean +-has_object_been_unregistered (GDBusConnection *connection, +- guint registration_id, +- guint subtree_registration_id) ++has_object_been_unregistered (GDBusConnection *connection, ++ guint registration_id, ++ ExportedInterface **out_ei, ++ guint subtree_registration_id, ++ ExportedSubtree **out_es) + { + gboolean ret; ++ ExportedInterface *ei = NULL; ++ gpointer es = NULL; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + + ret = FALSE; + + CONNECTION_LOCK (connection); +- if (registration_id != 0 && g_hash_table_lookup (connection->map_id_to_ei, +- GUINT_TO_POINTER (registration_id)) == NULL) ++ ++ if (registration_id != 0) + { +- ret = TRUE; ++ ei = g_hash_table_lookup (connection->map_id_to_ei, GUINT_TO_POINTER (registration_id)); ++ if (ei == NULL) ++ ret = TRUE; ++ else if (out_ei != NULL) ++ *out_ei = exported_interface_ref (ei); + } +- else if (subtree_registration_id != 0 && g_hash_table_lookup (connection->map_id_to_es, +- GUINT_TO_POINTER (subtree_registration_id)) == NULL) ++ if (subtree_registration_id != 0) + { +- ret = TRUE; ++ es = g_hash_table_lookup (connection->map_id_to_es, GUINT_TO_POINTER (subtree_registration_id)); ++ if (es == NULL) ++ ret = TRUE; ++ else if (out_es != NULL) ++ *out_es = exported_subtree_ref (es); + } ++ + CONNECTION_UNLOCK (connection); + + return ret; +@@ -4234,10 +4255,14 @@ invoke_get_property_in_idle_cb (gpointer _data) + GVariant *value; + GError *error; + GDBusMessage *reply; ++ ExportedInterface *ei = NULL; ++ ExportedSubtree *es = NULL; + + if (has_object_been_unregistered (data->connection, + data->registration_id, +- data->subtree_registration_id)) ++ &ei, ++ data->subtree_registration_id, ++ &es)) + { + reply = g_dbus_message_new_method_error (data->message, + "org.freedesktop.DBus.Error.UnknownMethod", +@@ -4284,6 +4309,9 @@ invoke_get_property_in_idle_cb (gpointer _data) + } + + out: ++ g_clear_pointer (&ei, exported_interface_unref); ++ g_clear_pointer (&es, exported_subtree_unref); ++ + return FALSE; + } + +@@ -4581,10 +4609,14 @@ invoke_get_all_properties_in_idle_cb (gpointer _data) + GVariantBuilder builder; + GDBusMessage *reply; + guint n; ++ ExportedInterface *ei = NULL; ++ ExportedSubtree *es = NULL; + + if (has_object_been_unregistered (data->connection, + data->registration_id, +- data->subtree_registration_id)) ++ &ei, ++ data->subtree_registration_id, ++ &es)) + { + reply = g_dbus_message_new_method_error (data->message, + "org.freedesktop.DBus.Error.UnknownMethod", +@@ -4637,6 +4669,9 @@ invoke_get_all_properties_in_idle_cb (gpointer _data) + g_object_unref (reply); + + out: ++ g_clear_pointer (&ei, exported_interface_unref); ++ g_clear_pointer (&es, exported_subtree_unref); ++ + return FALSE; + } + +@@ -4946,13 +4981,17 @@ call_in_idle_cb (gpointer user_data) + GDBusInterfaceVTable *vtable; + guint registration_id; + guint subtree_registration_id; ++ ExportedInterface *ei = NULL; ++ ExportedSubtree *es = NULL; + + registration_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (invocation), "g-dbus-registration-id")); + subtree_registration_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (invocation), "g-dbus-subtree-registration-id")); + + if (has_object_been_unregistered (g_dbus_method_invocation_get_connection (invocation), + registration_id, +- subtree_registration_id)) ++ &ei, ++ subtree_registration_id, ++ &es)) + { + GDBusMessage *reply; + reply = g_dbus_message_new_method_error (g_dbus_method_invocation_get_message (invocation), +@@ -4978,6 +5017,9 @@ call_in_idle_cb (gpointer user_data) + g_dbus_method_invocation_get_user_data (invocation)); + + out: ++ g_clear_pointer (&ei, exported_interface_unref); ++ g_clear_pointer (&es, exported_subtree_unref); ++ + return FALSE; + } + +-- +GitLab + diff --git a/patch/backport-gdbusconnection-Fix-race-between-subtree-method-call-and-unregistration.patch b/patch/backport-gdbusconnection-Fix-race-between-subtree-method-call-and-unregistration.patch new file mode 100644 index 0000000..645faeb --- /dev/null +++ b/patch/backport-gdbusconnection-Fix-race-between-subtree-method-call-and-unregistration.patch @@ -0,0 +1,62 @@ +From 117b748e44e0ec930fcb9641e3f808572d4a41f2 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 24 Sep 2021 10:55:10 +0100 +Subject: [PATCH] gdbusconnection: Fix race between subtree method call and + unregistration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix another variant of the previous commit, this time specific to the +idle callback of a method call on a subtree object, racing with +unregistration of that subtree. + +In this case, the `process_subtree_vtable_message_in_idle_cb()` idle +callback already has a pointer to the right `ExportedSubtree` struct, +but again doesn鈥檛 have a strong reference to it. + +Signed-off-by: Philip Withnall + +Helps: #2400 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/117b748e44e0ec930fcb9641e3f808572d4a41f2 + +--- + gio/gdbusconnection.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c +index e6c0b70b4e..73b5b309a2 100644 +--- a/gio/gdbusconnection.c ++++ b/gio/gdbusconnection.c +@@ -6824,14 +6824,15 @@ handle_subtree_method_invocation (GDBusConnection *connection, + + typedef struct + { +- GDBusMessage *message; +- ExportedSubtree *es; ++ GDBusMessage *message; /* (owned) */ ++ ExportedSubtree *es; /* (owned) */ + } SubtreeDeferredData; + + static void + subtree_deferred_data_free (SubtreeDeferredData *data) + { + g_object_unref (data->message); ++ exported_subtree_unref (data->es); + g_free (data); + } + +@@ -6890,7 +6891,7 @@ subtree_message_func (GDBusConnection *connection, + + data = g_new0 (SubtreeDeferredData, 1); + data->message = g_object_ref (message); +- data->es = es; ++ data->es = exported_subtree_ref (es); + + /* defer this call to an idle handler in the right thread */ + idle_source = g_idle_source_new (); +-- +GitLab + diff --git a/patch/backport-gdbusconnection-Make-ExportedInterface-ExportedSubtree-refcounted.patch b/patch/backport-gdbusconnection-Make-ExportedInterface-ExportedSubtree-refcounted.patch new file mode 100644 index 0000000..cbd3b3c --- /dev/null +++ b/patch/backport-gdbusconnection-Make-ExportedInterface-ExportedSubtree-refcounted.patch @@ -0,0 +1,136 @@ +From c8c2ed4af5cdf8d77af2cd9a2a4b4f6ac8d1fc70 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 24 Sep 2021 09:03:40 +0100 +Subject: [PATCH] gdbusconnection: Make ExportedInterface/ExportedSubtree + refcounted + +This is needed for an upcoming change which decouples their lifecycle +from their presence in the `map_id_to_ei` and `map_id_to_es` hash +tables. + +Signed-off-by: Philip Withnall + +Helps: #2400 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/c8c2ed4af5cdf8d77af2cd9a2a4b4f6ac8d1fc70 + +--- + gio/gdbusconnection.c | 42 ++++++++++++++++++++++++++++++++++++------ + 1 file changed, 36 insertions(+), 6 deletions(-) + +diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c +index 40ce1b6fc7..71913c1ec1 100644 +--- a/gio/gdbusconnection.c ++++ b/gio/gdbusconnection.c +@@ -466,7 +466,8 @@ typedef struct ExportedObject ExportedObject; + static void exported_object_free (ExportedObject *eo); + + typedef struct ExportedSubtree ExportedSubtree; +-static void exported_subtree_free (ExportedSubtree *es); ++static ExportedSubtree *exported_subtree_ref (ExportedSubtree *es); ++static void exported_subtree_unref (ExportedSubtree *es); + + enum + { +@@ -1096,7 +1097,7 @@ g_dbus_connection_init (GDBusConnection *connection) + connection->map_object_path_to_es = g_hash_table_new_full (g_str_hash, + g_str_equal, + NULL, +- (GDestroyNotify) exported_subtree_free); ++ (GDestroyNotify) exported_subtree_unref); + + connection->map_id_to_es = g_hash_table_new (g_direct_hash, + g_direct_equal); +@@ -4085,6 +4086,8 @@ typedef struct + { + ExportedObject *eo; + ++ gint refcount; /* (atomic) */ ++ + guint id; + gchar *interface_name; /* (owned) */ + GDBusInterfaceVTable *vtable; /* (owned) */ +@@ -4095,10 +4098,21 @@ typedef struct + GDestroyNotify user_data_free_func; + } ExportedInterface; + +-/* called with lock held */ ++static ExportedInterface * ++exported_interface_ref (ExportedInterface *ei) ++{ ++ g_atomic_int_inc (&ei->refcount); ++ ++ return ei; ++} ++ ++/* May be called with lock held */ + static void +-exported_interface_free (ExportedInterface *ei) ++exported_interface_unref (ExportedInterface *ei) + { ++ if (!g_atomic_int_dec_and_test (&ei->refcount)) ++ return; ++ + g_dbus_interface_info_cache_release (ei->interface_info); + g_dbus_interface_info_unref ((GDBusInterfaceInfo *) ei->interface_info); + +@@ -4115,6 +4129,8 @@ exported_interface_free (ExportedInterface *ei) + + struct ExportedSubtree + { ++ gint refcount; /* (atomic) */ ++ + guint id; + gchar *object_path; /* (owned) */ + GDBusConnection *connection; /* (unowned) */ +@@ -4126,9 +4142,21 @@ struct ExportedSubtree + GDestroyNotify user_data_free_func; + }; + ++static ExportedSubtree * ++exported_subtree_ref (ExportedSubtree *es) ++{ ++ g_atomic_int_inc (&es->refcount); ++ ++ return es; ++} ++ ++/* May be called with lock held */ + static void +-exported_subtree_free (ExportedSubtree *es) ++exported_subtree_unref (ExportedSubtree *es) + { ++ if (!g_atomic_int_dec_and_test (&es->refcount)) ++ return; ++ + call_destroy_notify (es->context, + es->user_data_free_func, + es->user_data); +@@ -5251,7 +5279,7 @@ g_dbus_connection_register_object (GDBusConnection *connection, + eo->map_if_name_to_ei = g_hash_table_new_full (g_str_hash, + g_str_equal, + NULL, +- (GDestroyNotify) exported_interface_free); ++ (GDestroyNotify) exported_interface_unref); + g_hash_table_insert (connection->map_object_path_to_eo, eo->object_path, eo); + } + +@@ -5268,6 +5296,7 @@ g_dbus_connection_register_object (GDBusConnection *connection, + } + + ei = g_new0 (ExportedInterface, 1); ++ ei->refcount = 1; + ei->id = (guint) g_atomic_int_add (&_global_registration_id, 1); /* TODO: overflow etc. */ + ei->eo = eo; + ei->user_data = user_data; +@@ -6924,6 +6953,7 @@ g_dbus_connection_register_subtree (GDBusConnection *connection, + } + + es = g_new0 (ExportedSubtree, 1); ++ es->refcount = 1; + es->object_path = g_strdup (object_path); + es->connection = connection; + +-- +GitLab diff --git a/patch/backport-gdbusconnection-Move-ExportedSubtree-definition.patch b/patch/backport-gdbusconnection-Move-ExportedSubtree-definition.patch new file mode 100644 index 0000000..cb8b926 --- /dev/null +++ b/patch/backport-gdbusconnection-Move-ExportedSubtree-definition.patch @@ -0,0 +1,94 @@ +From 310f2c1632e05c4f32be033c009642012741d876 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 24 Sep 2021 08:28:19 +0100 +Subject: [PATCH] gdbusconnection: Move ExportedSubtree definition + +Move it further up the file, but make no changes to it. This will help +with a subsequent commit. + +Signed-off-by: Philip Withnall + +Helps: #2400 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/310f2c1632e05c4f32be033c009642012741d876 + +--- + gio/gdbusconnection.c | 54 +++++++++++++++++++++---------------------- + 1 file changed, 27 insertions(+), 27 deletions(-) + +diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c +index d730111f8b..24a50fcf20 100644 +--- a/gio/gdbusconnection.c ++++ b/gio/gdbusconnection.c +@@ -4113,6 +4113,33 @@ exported_interface_free (ExportedInterface *ei) + g_free (ei); + } + ++struct ExportedSubtree ++{ ++ guint id; ++ gchar *object_path; ++ GDBusConnection *connection; ++ GDBusSubtreeVTable *vtable; ++ GDBusSubtreeFlags flags; ++ ++ GMainContext *context; ++ gpointer user_data; ++ GDestroyNotify user_data_free_func; ++}; ++ ++static void ++exported_subtree_free (ExportedSubtree *es) ++{ ++ call_destroy_notify (es->context, ++ es->user_data_free_func, ++ es->user_data); ++ ++ g_main_context_unref (es->context); ++ ++ _g_dbus_subtree_vtable_free (es->vtable); ++ g_free (es->object_path); ++ g_free (es); ++} ++ + /* ---------------------------------------------------------------------------------------------------- */ + + /* Convenience function to check if @registration_id (if not zero) or +@@ -6401,33 +6428,6 @@ g_dbus_connection_call_with_unix_fd_list_sync (GDBusConnection *connection, + + /* ---------------------------------------------------------------------------------------------------- */ + +-struct ExportedSubtree +-{ +- guint id; +- gchar *object_path; +- GDBusConnection *connection; +- GDBusSubtreeVTable *vtable; +- GDBusSubtreeFlags flags; +- +- GMainContext *context; +- gpointer user_data; +- GDestroyNotify user_data_free_func; +-}; +- +-static void +-exported_subtree_free (ExportedSubtree *es) +-{ +- call_destroy_notify (es->context, +- es->user_data_free_func, +- es->user_data); +- +- g_main_context_unref (es->context); +- +- _g_dbus_subtree_vtable_free (es->vtable); +- g_free (es->object_path); +- g_free (es); +-} +- + /* called without lock held in the thread where the caller registered + * the subtree + */ +-- +GitLab + diff --git a/patch/backport-gdbusinterfaceskeleton-Fix-a-use-after-free-of-a-GDBusMethodInvocation.patch b/patch/backport-gdbusinterfaceskeleton-Fix-a-use-after-free-of-a-GDBusMethodInvocation.patch new file mode 100644 index 0000000..7ef0b75 --- /dev/null +++ b/patch/backport-gdbusinterfaceskeleton-Fix-a-use-after-free-of-a-GDBusMethodInvocation.patch @@ -0,0 +1,182 @@ +From 1f86923766a3d1d319fe54ad24fcf6e2d75aca0d Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Wed, 22 Feb 2023 12:40:49 +0000 +Subject: [PATCH 1/3] gdbusinterfaceskeleton: Remove an unnecessary helper + struct member +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The `GDBusInterfaceSkeleton` is already stored as the source object of +the `GTask` here, with a strong reference. + +Storing it again in the task’s data struct is redundant, and makes it +look like the `GDBusInterfaceSkeleton` is being used without holding a +strong reference. (There’s not actually a bug there though: the strong +reference from the `GTask` outlives the data struct, so is sufficient.) + +Remove the unnecessary helper struct member to clarify the code a bit. + +Signed-off-by: Philip Withnall + +Helps: #2924 +--- + gio/gdbusinterfaceskeleton.c | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/gio/gdbusinterfaceskeleton.c b/gio/gdbusinterfaceskeleton.c +index 3f07d4d0b2..d28282fea3 100644 +--- a/gio/gdbusinterfaceskeleton.c ++++ b/gio/gdbusinterfaceskeleton.c +@@ -461,7 +461,6 @@ dbus_interface_interface_init (GDBusInterfaceIface *iface) + typedef struct + { + gint ref_count; /* (atomic) */ +- GDBusInterfaceSkeleton *interface; + GDBusInterfaceMethodCallFunc method_call_func; + GDBusMethodInvocation *invocation; + } DispatchData; +@@ -502,16 +501,17 @@ dispatch_in_thread_func (GTask *task, + GCancellable *cancellable) + { + DispatchData *data = task_data; ++ GDBusInterfaceSkeleton *interface = g_task_get_source_object (task); + GDBusInterfaceSkeletonFlags flags; + GDBusObject *object; + gboolean authorized; + +- g_mutex_lock (&data->interface->priv->lock); +- flags = data->interface->priv->flags; +- object = data->interface->priv->object; ++ g_mutex_lock (&interface->priv->lock); ++ flags = interface->priv->flags; ++ object = interface->priv->object; + if (object != NULL) + g_object_ref (object); +- g_mutex_unlock (&data->interface->priv->lock); ++ g_mutex_unlock (&interface->priv->lock); + + /* first check on the enclosing object (if any), then the interface */ + authorized = TRUE; +@@ -519,13 +519,13 @@ dispatch_in_thread_func (GTask *task, + { + g_signal_emit_by_name (object, + "authorize-method", +- data->interface, ++ interface, + data->invocation, + &authorized); + } + if (authorized) + { +- g_signal_emit (data->interface, ++ g_signal_emit (interface, + signals[G_AUTHORIZE_METHOD_SIGNAL], + 0, + data->invocation, +@@ -627,7 +627,6 @@ g_dbus_interface_method_dispatch_helper (GDBusInterfaceSkeleton *interface + DispatchData *data; + + data = g_slice_new0 (DispatchData); +- data->interface = interface; + data->method_call_func = method_call_func; + data->invocation = invocation; + data->ref_count = 1; +-- +GitLab + + +From d5710deb9d621bcf0cec0ff2db0708f361490752 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Wed, 22 Feb 2023 12:47:36 +0000 +Subject: [PATCH 2/3] gdbusinterfaceskeleton: Fix a use-after-free of a + GDBusMethodInvocation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This `GDBusMethodInvocation` may be shared across threads, with no +guarantee on the strong ref in one thread outlasting any refs in other +threads — so it needs a ref in this helper struct. + +This should fix a use-after-free where the `GDBusMethodInvocation` is +freed from `g_value_unset()` after `g_signal_emit()` returns in +`dispatch_in_thread_func()` in one thread; but then dereferenced again +in `g_source_destroy_internal()` from another thread. + +Signed-off-by: Philip Withnall + +Fixes: #2924 +--- + gio/gdbusinterfaceskeleton.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/gio/gdbusinterfaceskeleton.c b/gio/gdbusinterfaceskeleton.c +index d28282fea3..a2a79fe3d8 100644 +--- a/gio/gdbusinterfaceskeleton.c ++++ b/gio/gdbusinterfaceskeleton.c +@@ -462,14 +462,17 @@ typedef struct + { + gint ref_count; /* (atomic) */ + GDBusInterfaceMethodCallFunc method_call_func; +- GDBusMethodInvocation *invocation; ++ GDBusMethodInvocation *invocation; /* (owned) */ + } DispatchData; + + static void + dispatch_data_unref (DispatchData *data) + { + if (g_atomic_int_dec_and_test (&data->ref_count)) +- g_slice_free (DispatchData, data); ++ { ++ g_clear_object (&data->invocation); ++ g_slice_free (DispatchData, data); ++ } + } + + static DispatchData * +@@ -628,7 +631,7 @@ g_dbus_interface_method_dispatch_helper (GDBusInterfaceSkeleton *interface + + data = g_slice_new0 (DispatchData); + data->method_call_func = method_call_func; +- data->invocation = invocation; ++ data->invocation = g_object_ref (invocation); + data->ref_count = 1; + + task = g_task_new (interface, NULL, NULL, NULL); +-- +GitLab + + +From 7b101588e924f3783a0f5075f06b3e1d698be936 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Wed, 22 Feb 2023 12:50:10 +0000 +Subject: [PATCH 3/3] gdbusconnection: Make GDBusMethodInvocation transfer a + bit clearer + +Add a missing steal call in `schedule_method_call()`. This introduces no +functional changes, but documents the ownership transfer more clearly. + +Signed-off-by: Philip Withnall + +Helps: #2924 +--- + gio/gdbusconnection.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c +index d938f71b99..da6b66f2ec 100644 +--- a/gio/gdbusconnection.c ++++ b/gio/gdbusconnection.c +@@ -5043,7 +5043,7 @@ schedule_method_call (GDBusConnection *connection, + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + call_in_idle_cb, +- invocation, ++ g_steal_pointer (&invocation), + g_object_unref); + g_source_set_name (idle_source, "[gio, " __FILE__ "] call_in_idle_cb"); + g_source_attach (idle_source, main_context); +-- +GitLab + diff --git a/patch/backport-gdbusmessage-Disallow-zero-length-elements-in-arrays.patch b/patch/backport-gdbusmessage-Disallow-zero-length-elements-in-arrays.patch new file mode 100644 index 0000000..5e1a82d --- /dev/null +++ b/patch/backport-gdbusmessage-Disallow-zero-length-elements-in-arrays.patch @@ -0,0 +1,53 @@ +From c74177337dae7b06383261b2bedabf1f12d816b5 Mon Sep 17 00:00:00 2001 +From: Sebastian Wilhelmi +Date: Thu, 6 Jan 2022 20:57:49 +0000 +Subject: [PATCH] gdbusmessage: Disallow zero-length elements in arrays +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +They are not allowed in the specification, and can lead to infinite +loops when parsing. + +That鈥檚 a security issue if your application is accepting D-Bus messages +from untrusted peers (perhaps in a peer-to-peer connection). It鈥檚 not +exploitable when your application is connected to a bus (such as the +system or session buses), as the bus daemons (dbus-daemon or +dbus-broker) filter out such broken messages and don鈥檛 forward them. + +Arrays of zero-length elements are disallowed in the D-Bus +specification: https://dbus.freedesktop.org/doc/dbus-specification.html#container-types + +oss-fuzz#41428, #41435 +Fixes: #2557 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/c74177337dae7b06383261b2bedabf1f12d816b5 + +--- + gio/gdbusmessage.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c +index 4056bc2c4a..ecef6cd3c5 100644 +--- a/gio/gdbusmessage.c ++++ b/gio/gdbusmessage.c +@@ -1839,6 +1839,16 @@ parse_value_from_blob (GMemoryBuffer *buf, + } + g_variant_builder_add_value (&builder, item); + g_variant_unref (item); ++ ++ /* Array elements must not be zero-length. There are no ++ * valid zero-length serialisations of any types which ++ * can be array elements in the D-Bus wire format, so this ++ * assertion should always hold. ++ * ++ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2557 ++ */ ++ g_assert (buf->pos > (gsize) offset); ++ + offset = buf->pos; + } + } +-- +GitLab diff --git a/patch/backport-gdbusmethodinvocation-Drop-redundant-quote-from-warning.patch b/patch/backport-gdbusmethodinvocation-Drop-redundant-quote-from-warning.patch new file mode 100644 index 0000000..937835b --- /dev/null +++ b/patch/backport-gdbusmethodinvocation-Drop-redundant-quote-from-warning.patch @@ -0,0 +1,30 @@ +From 7143457076d6469f76185a2f1d7071aca40a591e Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 17 Mar 2022 19:03:15 +0000 +Subject: [PATCH] gdbusmethodinvocation: Drop redundant quote from warning + message + +Signed-off-by: Philip Withnall + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/7143457076d6469f76185a2f1d7071aca40a591e + +--- + gio/gdbusmethodinvocation.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gio/gdbusmethodinvocation.c b/gio/gdbusmethodinvocation.c +index 8e7abc83c4..705af079f4 100644 +--- a/gio/gdbusmethodinvocation.c ++++ b/gio/gdbusmethodinvocation.c +@@ -413,7 +413,7 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio + { + gchar *type_string = g_variant_type_dup_string (type); + +- g_warning ("Type of return value is incorrect: expected '%s', got '%s''", ++ g_warning ("Type of return value is incorrect: expected '%s', got '%s'", + type_string, g_variant_get_type_string (parameters)); + g_variant_type_free (type); + g_free (type_string); +-- +GitLab diff --git a/patch/backport-gdbusmethodinvocation-Fix-a-leak-on-an-early-return-path.patch b/patch/backport-gdbusmethodinvocation-Fix-a-leak-on-an-early-return-path.patch new file mode 100644 index 0000000..4259891 --- /dev/null +++ b/patch/backport-gdbusmethodinvocation-Fix-a-leak-on-an-early-return-path.patch @@ -0,0 +1,66 @@ +From a3b8846e54c7132056411605f815b67e831833d2 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 17 Mar 2022 19:04:42 +0000 +Subject: [PATCH] gdbusmethodinvocation: Fix a leak on an early return path + +When doing an early return from `g_dbus_method_invocation_return_*()` +due to passing in the wrong type (or no return value when one was +expected), the parameters were not correctly sunk and were leaked. + +Fix that. A unit test will be added in a following commit. + +Signed-off-by: Philip Withnall + +Coverity CID: #1474536 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/a3b8846e54c7132056411605f815b67e831833d2 + +--- + gio/gdbusmethodinvocation.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/gio/gdbusmethodinvocation.c b/gio/gdbusmethodinvocation.c +index c22e19ef0d..c15d83ec84 100644 +--- a/gio/gdbusmethodinvocation.c ++++ b/gio/gdbusmethodinvocation.c +@@ -397,14 +397,7 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio + g_return_if_fail ((parameters == NULL) || g_variant_is_of_type (parameters, G_VARIANT_TYPE_TUPLE)); + + if (g_dbus_message_get_flags (invocation->message) & G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED) +- { +- if (parameters != NULL) +- { +- g_variant_ref_sink (parameters); +- g_variant_unref (parameters); +- } +- goto out; +- } ++ goto out; + + if (parameters == NULL) + parameters = g_variant_new_tuple (NULL, 0); +@@ -508,7 +501,7 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio + } + + reply = g_dbus_message_new_method_reply (invocation->message); +- g_dbus_message_set_body (reply, parameters); ++ g_dbus_message_set_body (reply, g_steal_pointer (¶meters)); + + #ifdef G_OS_UNIX + if (fd_list != NULL) +@@ -525,6 +518,12 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio + g_object_unref (reply); + + out: ++ if (parameters != NULL) ++ { ++ g_variant_ref_sink (parameters); ++ g_variant_unref (parameters); ++ } ++ + g_object_unref (invocation); + } + +-- +GitLab diff --git a/patch/backport-gdbusmethodinvocation-Fix-dead-code-for-type-checking-GetAll.patch b/patch/backport-gdbusmethodinvocation-Fix-dead-code-for-type-checking-GetAll.patch new file mode 100644 index 0000000..6994562 --- /dev/null +++ b/patch/backport-gdbusmethodinvocation-Fix-dead-code-for-type-checking-GetAll.patch @@ -0,0 +1,81 @@ +From 76f5460107c86a44be6387c159b34ae50aa1e623 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 17 Mar 2022 18:32:46 +0000 +Subject: [PATCH] gdbusmethodinvocation: Fix dead code for type checking GetAll + +`property_info` is only ever set for `Get` and `Set` calls, not for +`GetAll`, as it only represents a single property. So this code was +never reachable. + +Move it out so that it is reachable. + +Signed-off-by: Philip Withnall + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/76f5460107c86a44be6387c159b34ae50aa1e623 + +--- + gio/gdbusmethodinvocation.c | 34 ++++++++++++++++++---------------- + 1 file changed, 18 insertions(+), 16 deletions(-) + +diff --git a/gio/gdbusmethodinvocation.c b/gio/gdbusmethodinvocation.c +index c15d83ec84..8e7abc83c4 100644 +--- a/gio/gdbusmethodinvocation.c ++++ b/gio/gdbusmethodinvocation.c +@@ -424,7 +424,9 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio + + /* property_info is only non-NULL if set that way from + * GDBusConnection, so this must be the case of async property +- * handling on either 'Get', 'Set' or 'GetAll'. ++ * handling on either 'Get' or 'Set'. ++ * ++ * property_info is NULL for 'GetAll'. + */ + if (invocation->property_info != NULL) + { +@@ -454,21 +456,6 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio + g_variant_unref (nested); + } + +- else if (g_str_equal (invocation->method_name, "GetAll")) +- { +- if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(a{sv})"))) +- { +- g_warning ("Type of return value for property 'GetAll' call should be '(a{sv})' but got '%s'", +- g_variant_get_type_string (parameters)); +- goto out; +- } +- +- /* Could iterate the list of properties and make sure that all +- * of them are actually on the interface and with the correct +- * types, but let's not do that for now... +- */ +- } +- + else if (g_str_equal (invocation->method_name, "Set")) + { + if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE_UNIT)) +@@ -482,6 +469,21 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio + else + g_assert_not_reached (); + } ++ else if (g_str_equal (invocation->interface_name, "org.freedesktop.DBus.Properties") && ++ g_str_equal (invocation->method_name, "GetAll")) ++ { ++ if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(a{sv})"))) ++ { ++ g_warning ("Type of return value for property 'GetAll' call should be '(a{sv})' but got '%s'", ++ g_variant_get_type_string (parameters)); ++ goto out; ++ } ++ ++ /* Could iterate the list of properties and make sure that all ++ * of them are actually on the interface and with the correct ++ * types, but let's not do that for now... ++ */ ++ } + + if (G_UNLIKELY (_g_dbus_debug_return ())) + { +-- +GitLab diff --git a/patch/backport-gdbusobjectmanagerservice-fix-leak-in-error-path.patch b/patch/backport-gdbusobjectmanagerservice-fix-leak-in-error-path.patch new file mode 100644 index 0000000..79cf015 --- /dev/null +++ b/patch/backport-gdbusobjectmanagerservice-fix-leak-in-error-path.patch @@ -0,0 +1,43 @@ +From 719484a5754cca036d123ae4c2ae3d150bacef32 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Wed, 31 Mar 2021 14:23:13 -0500 +Subject: [PATCH] gdbusobjectmanagerservice: fix leak in error path + +If the third g_return_val_if_fail() is hit, then we leak +orig_object_path. There is no reason we need to strdup it here. + +Found by Coverity. + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/719484a5754cca036d123ae4c2ae3d150bacef32 +--- + gio/gdbusobjectmanagerserver.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/gio/gdbusobjectmanagerserver.c b/gio/gdbusobjectmanagerserver.c +index 39f4ed5006..0a0cea84ab 100644 +--- a/gio/gdbusobjectmanagerserver.c ++++ b/gio/gdbusobjectmanagerserver.c +@@ -565,12 +565,12 @@ void + g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager, + GDBusObjectSkeleton *object) + { +- gchar *orig_object_path; ++ const gchar *orig_object_path; + gchar *object_path; + guint count; + gboolean modified; + +- orig_object_path = g_strdup (g_dbus_object_get_object_path (G_DBUS_OBJECT (object))); ++ orig_object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (object)); + + g_return_if_fail (G_IS_DBUS_OBJECT_MANAGER_SERVER (manager)); + g_return_if_fail (G_IS_DBUS_OBJECT (object)); +@@ -602,7 +602,6 @@ g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager, + g_dbus_object_skeleton_set_object_path (G_DBUS_OBJECT_SKELETON (object), object_path); + + g_free (object_path); +- g_free (orig_object_path); + + } + diff --git a/patch/backport-gdesktopappinfo-Unref-the-GDBus-call-results.patch b/patch/backport-gdesktopappinfo-Unref-the-GDBus-call-results.patch new file mode 100644 index 0000000..0d5d1d3 --- /dev/null +++ b/patch/backport-gdesktopappinfo-Unref-the-GDBus-call-results.patch @@ -0,0 +1,48 @@ +From 221f22b6e18fdd306e676e28a79afd3697bddd03 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Fri, 2 Sep 2022 20:38:46 +0200 +Subject: [PATCH] gdesktopappinfo: Unref the GDBus call results + +On our GDBus call callback wrapper we were completing the gdbus call but +ignoring the returned value, that was always leaked. + +Fix this. + +Helps with: https://gitlab.gnome.org/GNOME/glib/-/issues/333 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/221f22b6e18fdd306e676e28a79afd3697bddd03 + +--- + gio/gdesktopappinfo.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c +index af2311ca52..52d308f540 100644 +--- a/gio/gdesktopappinfo.c ++++ b/gio/gdesktopappinfo.c +@@ -3283,15 +3283,19 @@ launch_uris_with_dbus_cb (GObject *object, + { + GTask *task = G_TASK (user_data); + GError *error = NULL; ++ GVariant *ret; + +- g_dbus_connection_call_finish (G_DBUS_CONNECTION (object), result, &error); ++ ret = g_dbus_connection_call_finish (G_DBUS_CONNECTION (object), result, &error); + if (error != NULL) + { + g_dbus_error_strip_remote_error (error); + g_task_return_error (task, g_steal_pointer (&error)); + } + else +- g_task_return_boolean (task, TRUE); ++ { ++ g_task_return_boolean (task, TRUE); ++ g_variant_unref (ret); ++ } + + g_object_unref (task); + } +-- +GitLab + diff --git a/patch/backport-gdtlsconnection-Fix-a-check-for-a-vfunc-being-implemented.patch b/patch/backport-gdtlsconnection-Fix-a-check-for-a-vfunc-being-implemented.patch new file mode 100644 index 0000000..99ba461 --- /dev/null +++ b/patch/backport-gdtlsconnection-Fix-a-check-for-a-vfunc-being-implemented.patch @@ -0,0 +1,32 @@ +From be57c5d14c771361482917f4cb35851a07d19a8e Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 29 Apr 2021 13:17:05 +0100 +Subject: [PATCH] gdtlsconnection: Fix a check for a vfunc being implemented + +It was checking the wrong vfunc; likely a copy/paste error. + +Signed-off-by: Philip Withnall + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/be57c5d14c771361482917f4cb35851a07d19a8e + +--- + gio/gdtlsconnection.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gio/gdtlsconnection.c b/gio/gdtlsconnection.c +index 4bbc88d7a7..136e317b13 100644 +--- a/gio/gdtlsconnection.c ++++ b/gio/gdtlsconnection.c +@@ -1069,7 +1069,7 @@ g_dtls_connection_get_negotiated_protocol (GDtlsConnection *conn) + GDtlsConnectionInterface *iface; + + iface = G_DTLS_CONNECTION_GET_INTERFACE (conn); +- if (iface->set_advertised_protocols == NULL) ++ if (iface->get_negotiated_protocol == NULL) + return NULL; + + return iface->get_negotiated_protocol (conn); +-- +GitLab + diff --git a/patch/backport-gfileenumerator-fix-leak-in-error-path.patch b/patch/backport-gfileenumerator-fix-leak-in-error-path.patch new file mode 100644 index 0000000..ddfe7fc --- /dev/null +++ b/patch/backport-gfileenumerator-fix-leak-in-error-path.patch @@ -0,0 +1,29 @@ +From 8bfc2998135ee9c4460520febb3af720c61438a5 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Thu, 1 Apr 2021 14:13:19 -0500 +Subject: [PATCH] gfileenumerator: fix leak in error path + +Found by Coverity. + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/8bfc2998135ee9c4460520febb3af720c61438a5 +--- + gio/gfileenumerator.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gio/gfileenumerator.c b/gio/gfileenumerator.c +index ac2e4eb980..1f9bc24ebe 100644 +--- a/gio/gfileenumerator.c ++++ b/gio/gfileenumerator.c +@@ -787,7 +787,10 @@ next_files_thread (GTask *task, + } + + if (error) +- g_task_return_error (task, error); ++ { ++ g_list_free_full (files, g_object_unref); ++ g_task_return_error (task, error); ++ } + else + g_task_return_pointer (task, files, (GDestroyNotify)next_async_op_free); + } diff --git a/patch/backport-gio-tests-gdbus-peer-Unref-cached-property-GVariant-value.patch b/patch/backport-gio-tests-gdbus-peer-Unref-cached-property-GVariant-value.patch new file mode 100644 index 0000000..9a62b5b --- /dev/null +++ b/patch/backport-gio-tests-gdbus-peer-Unref-cached-property-GVariant-value.patch @@ -0,0 +1,29 @@ +From e268ff39b648e7b100d2aa50f472b4ff8ff5313a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Fri, 2 Sep 2022 21:10:05 +0200 +Subject: [PATCH] gio/tests/gdbus-peer: Unref cached property GVariant value + +Helps with: https://gitlab.gnome.org/GNOME/glib/-/issues/333 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/e268ff39b648e7b100d2aa50f472b4ff8ff5313a + +--- + gio/tests/gdbus-peer.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gio/tests/gdbus-peer.c b/gio/tests/gdbus-peer.c +index 7179d089df..763689a4fd 100644 +--- a/gio/tests/gdbus-peer.c ++++ b/gio/tests/gdbus-peer.c +@@ -843,6 +843,7 @@ do_test_peer (void) + error = NULL; + value = g_dbus_proxy_get_cached_property (proxy, "PeerProperty"); + g_assert_cmpstr (g_variant_get_string (value, NULL), ==, "ThePropertyValue"); ++ g_clear_pointer (&value, g_variant_unref); + + /* try invoking a method */ + error = NULL; +-- +GitLab + diff --git a/patch/backport-gio-tests-gdbus-proxy-threads-Unref-GVariant-s-that-we-own.patch b/patch/backport-gio-tests-gdbus-proxy-threads-Unref-GVariant-s-that-we-own.patch new file mode 100644 index 0000000..ce5f46b --- /dev/null +++ b/patch/backport-gio-tests-gdbus-proxy-threads-Unref-GVariant-s-that-we-own.patch @@ -0,0 +1,67 @@ +From 1da208cddc19cad05ccf4b798a99f7045e41ffc4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Fri, 2 Sep 2022 20:26:06 +0200 +Subject: [PATCH] gio/tests/gdbus-proxy-threads: Unref GVariant's that we own + +This test is leaking various GVariant's that we are supposed to unref, +leading the valgrind CI job to complain about. + +Helps with: https://gitlab.gnome.org/GNOME/glib/-/issues/333 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/1da208cddc19cad05ccf4b798a99f7045e41ffc4 + +--- + gio/tests/gdbus-proxy-threads.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/gio/tests/gdbus-proxy-threads.c b/gio/tests/gdbus-proxy-threads.c +index 76b857e731..a0a38d07cd 100644 +--- a/gio/tests/gdbus-proxy-threads.c ++++ b/gio/tests/gdbus-proxy-threads.c +@@ -119,13 +119,17 @@ request_name_cb (GObject *source, + GDBusConnection *connection = G_DBUS_CONNECTION (source); + GError *error = NULL; + GVariant *var; ++ GVariant *child; + + var = g_dbus_connection_call_finish (connection, res, &error); + g_assert_no_error (error); +- g_assert_cmpuint (g_variant_get_uint32 (g_variant_get_child_value (var, 0)), ++ child = g_variant_get_child_value (var, 0); ++ g_assert_cmpuint (g_variant_get_uint32 (child), + ==, DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); + + release_name (connection, TRUE); ++ g_variant_unref (child); ++ g_variant_unref (var); + } + + static void +@@ -154,11 +158,13 @@ release_name_cb (GObject *source, + GDBusConnection *connection = G_DBUS_CONNECTION (source); + GError *error = NULL; + GVariant *var; ++ GVariant *child; + int i; + + var = g_dbus_connection_call_finish (connection, res, &error); + g_assert_no_error (error); +- g_assert_cmpuint (g_variant_get_uint32 (g_variant_get_child_value (var, 0)), ++ child = g_variant_get_child_value (var, 0); ++ g_assert_cmpuint (g_variant_get_uint32 (child), + ==, DBUS_RELEASE_NAME_REPLY_RELEASED); + + /* generate some rapid NameOwnerChanged signals to try to trigger crashes */ +@@ -170,6 +176,8 @@ release_name_cb (GObject *source, + + /* wait for dbus-daemon to catch up */ + request_name (connection, TRUE); ++ g_variant_unref (child); ++ g_variant_unref (var); + } + + static void +-- +GitLab + diff --git a/patch/backport-gio-tool-Fix-a-minor-memory-leak.patch b/patch/backport-gio-tool-Fix-a-minor-memory-leak.patch new file mode 100644 index 0000000..6684613 --- /dev/null +++ b/patch/backport-gio-tool-Fix-a-minor-memory-leak.patch @@ -0,0 +1,72 @@ +From 49cc9b96f4c19a98ddf6e9b7417c7019ebc28ca3 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Wed, 27 Apr 2022 15:01:08 +0100 +Subject: [PATCH] gio-tool: Fix a minor memory leak when using gio-set with + bytestrings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Tested using: +```sh +touch ~/foo +gio set ~/foo -t bytestring user::test "\x00\x00" +``` +(it doesn鈥檛 matter that this fails; the bytestring is still decoded) + +Signed-off-by: Philip Withnall + +Coverity CID: #1474407 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/49cc9b96f4c19a98ddf6e9b7417c7019ebc28ca3 + +--- + gio/gio-tool-set.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/gio/gio-tool-set.c b/gio/gio-tool-set.c +index 4dbe1214ff..c2a9431f61 100644 +--- a/gio/gio-tool-set.c ++++ b/gio/gio-tool-set.c +@@ -76,12 +76,14 @@ handle_set (int argc, char *argv[], gboolean do_help) + const char *attribute; + GFileAttributeType type; + gpointer value; ++ gpointer value_allocated = NULL; + gboolean b; + guint32 uint32; + gint32 int32; + guint64 uint64; + gint64 int64; + gchar *param; ++ int retval = 0; + + g_set_prgname ("gio set"); + +@@ -147,7 +149,7 @@ handle_set (int argc, char *argv[], gboolean do_help) + value = argv[3]; + break; + case G_FILE_ATTRIBUTE_TYPE_BYTE_STRING: +- value = hex_unescape (argv[3]); ++ value = value_allocated = hex_unescape (argv[3]); + break; + case G_FILE_ATTRIBUTE_TYPE_BOOLEAN: + b = g_ascii_strcasecmp (argv[3], "true") == 0; +@@ -194,11 +196,11 @@ handle_set (int argc, char *argv[], gboolean do_help) + { + print_error ("%s", error->message); + g_error_free (error); +- g_object_unref (file); +- return 1; ++ retval = 1; + } + ++ g_clear_pointer (&value_allocated, g_free); + g_object_unref (file); + +- return 0; ++ return retval; + } +-- +GitLab diff --git a/patch/backport-glocalfileinfo-Fix-atime-mtime-mix.patch b/patch/backport-glocalfileinfo-Fix-atime-mtime-mix.patch new file mode 100644 index 0000000..8badc4c --- /dev/null +++ b/patch/backport-glocalfileinfo-Fix-atime-mtime-mix.patch @@ -0,0 +1,28 @@ +From 5a032f32ea77d81c012841dde88b070f55037f25 Mon Sep 17 00:00:00 2001 +From: Egor Bychin +Date: Mon, 11 Oct 2021 13:56:43 +0300 +Subject: [PATCH] glocalfileinfo: Fix atime/mtime mix due to bad copy/paste + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/5a032f32ea77d81c012841dde88b070f55037f25 + +--- + gio/glocalfileinfo.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c +index 3867ca684a..d3b327a19c 100644 +--- a/gio/glocalfileinfo.c ++++ b/gio/glocalfileinfo.c +@@ -2650,7 +2650,7 @@ set_mtime_atime (char *filename, + { + if (lazy_stat (filename, &statbuf, &got_stat) == 0) + { +- times[0].tv_sec = statbuf.st_mtime; ++ times[0].tv_sec = statbuf.st_atime; + #if defined (HAVE_STRUCT_STAT_ST_ATIMENSEC) + times[0].tv_usec = statbuf.st_atimensec / 1000; + #elif defined (HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC) +-- +GitLab + diff --git a/patch/backport-glocalfileoutputstream-Do-not-double-close-an-fd-on-unlink-error.patch b/patch/backport-glocalfileoutputstream-Do-not-double-close-an-fd-on-unlink-error.patch new file mode 100644 index 0000000..39228fc --- /dev/null +++ b/patch/backport-glocalfileoutputstream-Do-not-double-close-an-fd-on-unlink-error.patch @@ -0,0 +1,33 @@ +From 2401e1a090dcaac7614a8984cd3e3832a2a476ab Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Fri, 16 Sep 2022 15:11:47 +0200 +Subject: [PATCH] glocalfileoutputstream: Do not double-close an fd on unlink + error + +In case we fail unlinking a file we could close again an FD that has +been already just closed. So avoid this by unsetting it when closing. + +Coverity CID: #1474462 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/2401e1a090dcaac7614a8984cd3e3832a2a476ab + +--- + gio/glocalfileoutputstream.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c +index 78d3e85..a61d5b5 100644 +--- a/gio/glocalfileoutputstream.c ++++ b/gio/glocalfileoutputstream.c +@@ -1163,6 +1163,7 @@ handle_overwrite_open (const char *filename, + if (replace_destination_set) + { + g_close (fd, NULL); ++ fd = -1; + + if (g_unlink (filename) != 0) + { +-- +2.33.0 + diff --git a/patch/backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch b/patch/backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch new file mode 100644 index 0000000..1067efc --- /dev/null +++ b/patch/backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch @@ -0,0 +1,32 @@ +From d01fb412801ddc55843f1e1642d0fef0afba441a Mon Sep 17 00:00:00 2001 +From: John Lindgren +Date: Thu, 13 Oct 2022 14:00:12 +0100 +Subject: [PATCH] gmessages: Add missing trailing newline in fallback log + handler + +This makes the fallback log handler match the behaviour of the default +log handlers. + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/d01fb412801ddc55843f1e1642d0fef0afba441a + +Spotted as part of https://gitlab.gnome.org/GNOME/glib/-/issues/2753 +--- + glib/gmessages.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/glib/gmessages.c b/glib/gmessages.c +index fb1297f8a8..e197f1707a 100644 +--- a/glib/gmessages.c ++++ b/glib/gmessages.c +@@ -3159,6 +3159,7 @@ _g_log_fallback_handler (const gchar *log_domain, + write_string (stream, level_prefix); + write_string (stream, ": "); + write_string (stream, message); ++ write_string (stream, "\n"); + } + + static void +-- +GitLab + diff --git a/patch/backport-gopenuriportal-Fix-GVariantBuilder-and-string-leakage.patch b/patch/backport-gopenuriportal-Fix-GVariantBuilder-and-string-leakage.patch new file mode 100644 index 0000000..33c8b8b --- /dev/null +++ b/patch/backport-gopenuriportal-Fix-GVariantBuilder-and-string-leakage.patch @@ -0,0 +1,29 @@ +From 9dc7475f93c5c63fff66999d228407e13a47d5d3 Mon Sep 17 00:00:00 2001 +From: Egor Bychin +Date: Mon, 11 Oct 2021 14:00:03 +0300 +Subject: [PATCH] gopenuriportal: Fix GVariantBuilder and string leakage on + g_open failure + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/9dc7475f93c5c63fff66999d228407e13a47d5d3 + +--- + gio/gopenuriportal.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gio/gopenuriportal.c b/gio/gopenuriportal.c +index be68569ed8..6ef8f037c3 100644 +--- a/gio/gopenuriportal.c ++++ b/gio/gopenuriportal.c +@@ -108,6 +108,8 @@ g_openuri_portal_open_uri (const char *uri, + errsv = errno; + if (fd == -1) + { ++ g_free (path); ++ g_variant_builder_clear (&opt_builder); + g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv), + "Failed to open '%s'", path); + return FALSE; +-- +GitLab + diff --git a/patch/backport-gopenuriportal-Fix-a-use-after-free-on-an-error-path.patch b/patch/backport-gopenuriportal-Fix-a-use-after-free-on-an-error-path.patch new file mode 100644 index 0000000..c811524 --- /dev/null +++ b/patch/backport-gopenuriportal-Fix-a-use-after-free-on-an-error-path.patch @@ -0,0 +1,39 @@ +From 969eb835dc2f07c34ae8ca45ddbc41590a2e2f8e Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 28 Apr 2022 10:56:10 +0100 +Subject: [PATCH] gopenuriportal: Fix a use-after-free on an error path + +`path` was used in building the error message after it had been freed. +Spotted by scan-build. + +Signed-off-by: Philip Withnall + +Helps: #1767 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/969eb835dc2f07c34ae8ca45ddbc41590a2e2f8e + +--- + gopenuriportal.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gio/gopenuriportal.c b/gio/gopenuriportal.c +index ecf6fea..2f527d8 100644 +--- a/gio/gopenuriportal.c ++++ b/gio/gopenuriportal.c +@@ -108,10 +108,10 @@ g_openuri_portal_open_uri (const char *uri, + errsv = errno; + if (fd == -1) + { +- g_free (path); +- g_variant_builder_clear (&opt_builder); + g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv), + "Failed to open '%s'", path); ++ g_free (path); ++ g_variant_builder_clear (&opt_builder); + return FALSE; + } + +-- +2.33.0 + diff --git a/patch/backport-gprintf-Fix-a-memory-leak-with-an-invalid-format.patch b/patch/backport-gprintf-Fix-a-memory-leak-with-an-invalid-format.patch new file mode 100644 index 0000000..60c0414 --- /dev/null +++ b/patch/backport-gprintf-Fix-a-memory-leak-with-an-invalid-format.patch @@ -0,0 +1,38 @@ +From 7329c6e09bf59ccae2d8d3e788ce43bb6af6c3db Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Wed, 9 Mar 2022 14:07:34 +0000 +Subject: [PATCH] gprintf: Fix a memory leak with an invalid format in + g_vasprintf() + +If using the fallback implementation of `g_vasprintf()`. + +Signed-off-by: Philip Withnall + +Coverity CID: #1474726 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/7329c6e09bf59ccae2d8d3e788ce43bb6af6c3db + +--- + glib/gprintf.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/glib/gprintf.c b/glib/gprintf.c +index 555a630bc2..0e094f00fa 100644 +--- a/glib/gprintf.c ++++ b/glib/gprintf.c +@@ -356,6 +356,12 @@ g_vasprintf (gchar **string, + + len = _g_vsprintf (*string, format, args2); + va_end (args2); ++ ++ if (len < 0) ++ { ++ g_free (*string); ++ *string = NULL; ++ } + } + #endif + +-- +GitLab diff --git a/patch/backport-gproxyaddressenumerator-Fix-string-leakage-on-an-invalid-input.patch b/patch/backport-gproxyaddressenumerator-Fix-string-leakage-on-an-invalid-input.patch new file mode 100644 index 0000000..8652e45 --- /dev/null +++ b/patch/backport-gproxyaddressenumerator-Fix-string-leakage-on-an-invalid-input.patch @@ -0,0 +1,47 @@ +From a50e605d52534f604776e56fd181ace98b6a0166 Mon Sep 17 00:00:00 2001 +From: Egor Bychin +Date: Mon, 11 Oct 2021 14:02:33 +0300 +Subject: [PATCH] gproxyaddressenumerator: Fix string leakage on an invalid + input + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/a50e605d52534f604776e56fd181ace98b6a0166 + +--- + gio/gproxyaddressenumerator.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/gio/gproxyaddressenumerator.c b/gio/gproxyaddressenumerator.c +index d3de4940c9..654baade57 100644 +--- a/gio/gproxyaddressenumerator.c ++++ b/gio/gproxyaddressenumerator.c +@@ -262,8 +262,12 @@ g_proxy_address_enumerator_next (GSocketAddressEnumerator *enumerator, + } + dest_protocol = g_uri_parse_scheme (priv->dest_uri); + +- g_return_val_if_fail (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address), +- NULL); ++ if (!G_IS_INET_SOCKET_ADDRESS (priv->proxy_address)) ++ { ++ g_free (dest_hostname); ++ g_free (dest_protocol); ++ } ++ g_return_val_if_fail (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address), NULL); + + inetsaddr = G_INET_SOCKET_ADDRESS (priv->proxy_address); + inetaddr = g_inet_socket_address_get_address (inetsaddr); +@@ -352,6 +356,11 @@ return_result (GTask *task) + } + dest_protocol = g_uri_parse_scheme (priv->dest_uri); + ++ if (!G_IS_INET_SOCKET_ADDRESS (priv->proxy_address)) ++ { ++ g_free (dest_hostname); ++ g_free (dest_protocol); ++ } + g_return_if_fail (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address)); + + inetsaddr = G_INET_SOCKET_ADDRESS (priv->proxy_address); +-- +GitLab + diff --git a/patch/backport-gsocketclient-Fix-still-reachable-references-to-cancellables.patch b/patch/backport-gsocketclient-Fix-still-reachable-references-to-cancellables.patch new file mode 100644 index 0000000..d865a12 --- /dev/null +++ b/patch/backport-gsocketclient-Fix-still-reachable-references-to-cancellables.patch @@ -0,0 +1,117 @@ +From 56d371942e43c52bc6131067e2dc2a35f6cd5a3d Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Mon, 13 Jun 2022 13:06:06 +0100 +Subject: [PATCH] gsocketclient: Fix still-reachable references to cancellables +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +`GSocketClient` chains its internal `GCancellable` objects to ones +provided by the caller in two places using `g_cancellable_connect()`. +However, it never calls `g_cancellable_disconnect()`, instead relying +(incorrectly) on the `GCancellable` provided by the caller being +short-lived. + +In the (valid) situation where a caller reuses one `GCancellable` for +multiple socket client calls, or for calls across multiple socket +clients, this will cause the internal `GCancellable` objects from those +`GSocketClient`s to accumulate, with one reference left each (which is +the reference from the `g_cancellable_connect()` closure). + +These `GCancellable` instances aren't technically leaked, as they will +all be freed when the caller's `GCancellable` is disposed, but they are +no longer useful and there is no bound on the number of them which will +hang around. + +For a program doing a lot of socket operations, this still-reachable +memory usage can become significant. + +Fix the problem by adding paired `g_cancellable_disconnect()` calls. +It's not possible to add a unit test as we can't measure still-reachable +memory growth before the end of a unit test when everything has to be +freed. + +Signed-off-by: Philip Withnall + +Fixes: #2670 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/56d371942e43c52bc6131067e2dc2a35f6cd5a3d + +--- + gio/gsocketclient.c | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c +index ae80f5203c..127915b722 100644 +--- a/gio/gsocketclient.c ++++ b/gio/gsocketclient.c +@@ -1466,6 +1466,8 @@ typedef struct + GSocketConnectable *connectable; + GSocketAddressEnumerator *enumerator; + GCancellable *enumeration_cancellable; ++ GCancellable *enumeration_parent_cancellable; /* (nullable) (owned) */ ++ gulong enumeration_cancelled_id; + + GSList *connection_attempts; + GSList *successful_connections; +@@ -1485,7 +1487,12 @@ g_socket_client_async_connect_data_free (GSocketClientAsyncConnectData *data) + data->task = NULL; + g_clear_object (&data->connectable); + g_clear_object (&data->enumerator); ++ ++ g_cancellable_disconnect (data->enumeration_parent_cancellable, data->enumeration_cancelled_id); ++ g_clear_object (&data->enumeration_parent_cancellable); ++ data->enumeration_cancelled_id = 0; + g_clear_object (&data->enumeration_cancellable); ++ + g_slist_free_full (data->connection_attempts, connection_attempt_unref); + g_slist_free_full (data->successful_connections, connection_attempt_unref); + +@@ -1503,6 +1510,7 @@ typedef struct + GSocketClientAsyncConnectData *data; /* unowned */ + GSource *timeout_source; + GCancellable *cancellable; ++ gulong cancelled_id; + grefcount ref; + } ConnectionAttempt; + +@@ -1530,6 +1538,8 @@ connection_attempt_unref (gpointer pointer) + g_clear_object (&attempt->address); + g_clear_object (&attempt->socket); + g_clear_object (&attempt->connection); ++ g_cancellable_disconnect (g_task_get_cancellable (attempt->data->task), attempt->cancelled_id); ++ attempt->cancelled_id = 0; + g_clear_object (&attempt->cancellable); + g_clear_object (&attempt->proxy_addr); + if (attempt->timeout_source) +@@ -2023,8 +2033,9 @@ g_socket_client_enumerator_callback (GObject *object, + data->connection_attempts = g_slist_append (data->connection_attempts, attempt); + + if (g_task_get_cancellable (data->task)) +- g_cancellable_connect (g_task_get_cancellable (data->task), G_CALLBACK (on_connection_cancelled), +- g_object_ref (attempt->cancellable), g_object_unref); ++ attempt->cancelled_id = ++ g_cancellable_connect (g_task_get_cancellable (data->task), G_CALLBACK (on_connection_cancelled), ++ g_object_ref (attempt->cancellable), g_object_unref); + + g_socket_connection_set_cached_remote_address ((GSocketConnection *)attempt->connection, address); + g_debug ("GSocketClient: Starting TCP connection attempt"); +@@ -2129,8 +2140,12 @@ g_socket_client_connect_async (GSocketClient *client, + + data->enumeration_cancellable = g_cancellable_new (); + if (cancellable) +- g_cancellable_connect (cancellable, G_CALLBACK (on_connection_cancelled), +- g_object_ref (data->enumeration_cancellable), g_object_unref); ++ { ++ data->enumeration_parent_cancellable = g_object_ref (cancellable); ++ data->enumeration_cancelled_id = ++ g_cancellable_connect (cancellable, G_CALLBACK (on_connection_cancelled), ++ g_object_ref (data->enumeration_cancellable), g_object_unref); ++ } + + enumerator_next_async (data, FALSE); + } +-- +GitLab + diff --git a/patch/backport-gsocks5proxy-Fix-buffer-overflow-on-a-really-long-domain-name.patch b/patch/backport-gsocks5proxy-Fix-buffer-overflow-on-a-really-long-domain-name.patch new file mode 100644 index 0000000..af277b7 --- /dev/null +++ b/patch/backport-gsocks5proxy-Fix-buffer-overflow-on-a-really-long-domain-name.patch @@ -0,0 +1,73 @@ +From b32727d43d9d11aa017f1f29648ad5019376537c Mon Sep 17 00:00:00 2001 +From: Egor Bychin +Date: Mon, 11 Oct 2021 14:07:01 +0300 +Subject: [PATCH] gsocks5proxy: Fix buffer overflow on a really long domain + name + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/b32727d43d9d11aa017f1f29648ad5019376537c + +--- + gio/gsocks5proxy.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +diff --git a/gio/gsocks5proxy.c b/gio/gsocks5proxy.c +index 873db7ea6d..948ac8b8b8 100644 +--- a/gio/gsocks5proxy.c ++++ b/gio/gsocks5proxy.c +@@ -328,7 +328,7 @@ set_connect_msg (guint8 *msg, + * + * The parser only requires 4 bytes. + */ +-#define SOCKS5_CONN_REP_LEN 255 ++#define SOCKS5_CONN_REP_LEN 257 + static gboolean + parse_connect_reply (const guint8 *data, gint *atype, GError **error) + { +@@ -509,7 +509,7 @@ g_socks5_proxy_connect (GProxy *proxy, + guint8 data[SOCKS5_CONN_REP_LEN]; + gint atype; + +- if (!g_input_stream_read_all (in, data, 4, NULL, ++ if (!g_input_stream_read_all (in, data, 4 /* VER, REP, RSV, ATYP */, NULL, + cancellable, error)) + goto error; + +@@ -519,23 +519,26 @@ g_socks5_proxy_connect (GProxy *proxy, + switch (atype) + { + case SOCKS5_ATYP_IPV4: +- if (!g_input_stream_read_all (in, data, 6, NULL, +- cancellable, error)) ++ if (!g_input_stream_read_all (in, data, ++ 4 /* IPv4 length */ + 2 /* port */, ++ NULL, cancellable, error)) + goto error; + break; + + case SOCKS5_ATYP_IPV6: +- if (!g_input_stream_read_all (in, data, 18, NULL, +- cancellable, error)) ++ if (!g_input_stream_read_all (in, data, ++ 16 /* IPv6 length */ + 2 /* port */, ++ NULL, cancellable, error)) + goto error; + break; + + case SOCKS5_ATYP_DOMAINNAME: +- if (!g_input_stream_read_all (in, data, 1, NULL, +- cancellable, error)) ++ if (!g_input_stream_read_all (in, data, 1 /* domain name length */, ++ NULL, cancellable, error)) + goto error; +- if (!g_input_stream_read_all (in, data, data[0] + 2, NULL, +- cancellable, error)) ++ if (!g_input_stream_read_all (in, data, ++ data[0] /* domain name length */ + 2 /* port */, ++ NULL, cancellable, error)) + goto error; + break; + } +-- +GitLab + diff --git a/patch/backport-gsocks5proxy-Handle-EOF-when-reading-from-a-stream.patch b/patch/backport-gsocks5proxy-Handle-EOF-when-reading-from-a-stream.patch new file mode 100644 index 0000000..dc91239 --- /dev/null +++ b/patch/backport-gsocks5proxy-Handle-EOF-when-reading-from-a-stream.patch @@ -0,0 +1,110 @@ +From 40a46d1346fdd4e07c648ba1ee78dedd9bfa33ad Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Tue, 6 Apr 2021 16:52:23 +0200 +Subject: [PATCH] gsocks5proxy: Handle EOF when reading from a stream + +The code did not handle EOF (0 byte read) correctly. This can e.g. cause +an infinite loop if an incorrect socks proxy is configured. + +Add the appropriate checks and return an G_IO_ERROR_CONNECTION_CLOSED +error if EOF is encountered. + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/40a46d1346fdd4e07c648ba1ee78dedd9bfa33ad + +--- + gio/gsocks5proxy.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 50 insertions(+) + +diff --git a/gio/gsocks5proxy.c b/gio/gsocks5proxy.c +index 09b7fcac29..873db7ea6d 100644 +--- a/gio/gsocks5proxy.c ++++ b/gio/gsocks5proxy.c +@@ -717,6 +717,16 @@ nego_reply_read_cb (GObject *source, + return; + } + ++ if (read == 0) ++ { ++ g_task_return_new_error (task, ++ G_IO_ERROR, ++ G_IO_ERROR_CONNECTION_CLOSED, ++ "Connection to SOCKSv5 proxy server lost"); ++ g_object_unref (task); ++ return; ++ } ++ + data->offset += read; + + if (data->offset == data->length) +@@ -821,6 +831,16 @@ auth_reply_read_cb (GObject *source, + return; + } + ++ if (read == 0) ++ { ++ g_task_return_new_error (task, ++ G_IO_ERROR, ++ G_IO_ERROR_CONNECTION_CLOSED, ++ "Connection to SOCKSv5 proxy server lost"); ++ g_object_unref (task); ++ return; ++ } ++ + data->offset += read; + + if (data->offset == data->length) +@@ -923,6 +943,16 @@ connect_reply_read_cb (GObject *source, + return; + } + ++ if (read == 0) ++ { ++ g_task_return_new_error (task, ++ G_IO_ERROR, ++ G_IO_ERROR_CONNECTION_CLOSED, ++ "Connection to SOCKSv5 proxy server lost"); ++ g_object_unref (task); ++ return; ++ } ++ + data->offset += read; + + if (data->offset == data->length) +@@ -983,6 +1013,16 @@ connect_addr_len_read_cb (GObject *source, + return; + } + ++ if (read == 0) ++ { ++ g_task_return_new_error (task, ++ G_IO_ERROR, ++ G_IO_ERROR_CONNECTION_CLOSED, ++ "Connection to SOCKSv5 proxy server lost"); ++ g_object_unref (task); ++ return; ++ } ++ + data->length = data->buffer[0] + 2; + data->offset = 0; + +@@ -1009,6 +1049,16 @@ connect_addr_read_cb (GObject *source, + return; + } + ++ if (read == 0) ++ { ++ g_task_return_new_error (task, ++ G_IO_ERROR, ++ G_IO_ERROR_CONNECTION_CLOSED, ++ "Connection to SOCKSv5 proxy server lost"); ++ g_object_unref (task); ++ return; ++ } ++ + data->offset += read; + + if (data->offset == data->length) +-- +GitLab + diff --git a/patch/backport-gtestdbus-Print-the-dbus-address-on-a-specific-FD-intead-of-stdout.patch b/patch/backport-gtestdbus-Print-the-dbus-address-on-a-specific-FD-intead-of-stdout.patch new file mode 100644 index 0000000..912e474 --- /dev/null +++ b/patch/backport-gtestdbus-Print-the-dbus-address-on-a-specific-FD-intead-of-stdout.patch @@ -0,0 +1,192 @@ +From d98a52254b4a681569a44f6be2aeceeaed58202c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Mon, 22 Nov 2021 16:55:35 +0100 +Subject: [PATCH] gtestdbus: Print the dbus address on a specific FD intead of + stdout + +We used to use a pipe for the dbus daemon stdout to read the defined +address, but that was already requiring a workaround to ensure that dbus +daemon children were then able to write to stdout. +However the current implementation is still causing troubles in some +cases in which the daemon is very verbose, leading to hangs when writing +to stdout. + +As per this, just don't handle stdout ourself, but use instead a +specific pipe to get the address address. That can now be safely closed +once we've received the data we need. + +This reverts commit d80adeaa960ddfa13837900d0391f9bd9c239f78. + +Fixes: #2537 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/d98a52254b4a681569a44f6be2aeceeaed58202c + +--- + gio/gtestdbus.c | 89 ++++++++++++++++++++++++++++++++----------------- + 1 file changed, 59 insertions(+), 30 deletions(-) + +diff --git a/gio/gtestdbus.c b/gio/gtestdbus.c +index 703a0b3a5a..992d29cef0 100644 +--- a/gio/gtestdbus.c ++++ b/gio/gtestdbus.c +@@ -32,6 +32,8 @@ + #endif + #ifdef G_OS_WIN32 + #include ++#include ++#include + #endif + + #include +@@ -44,8 +46,8 @@ + + #include "glibintl.h" + +-#ifdef G_OS_WIN32 +-#include ++#ifdef G_OS_UNIX ++#include "glib-unix.h" + #endif + + /* -------------------------------------------------------------------------- */ +@@ -436,7 +438,6 @@ struct _GTestDBusPrivate + GTestDBusFlags flags; + GPtrArray *service_dirs; + GPid bus_pid; +- gint bus_stdout_fd; + gchar *bus_address; + gboolean up; + }; +@@ -596,58 +597,87 @@ write_config_file (GTestDBus *self) + return path; + } + ++static gboolean ++make_pipe (gint pipe_fds[2], ++ GError **error) ++{ ++#if defined(G_OS_UNIX) ++ return g_unix_open_pipe (pipe_fds, FD_CLOEXEC, error); ++#elif defined(G_OS_WIN32) ++ if (_pipe (pipe_fds, 4096, _O_BINARY) < 0) ++ { ++ int errsv = errno; ++ ++ g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED, ++ _("Failed to create pipe for communicating with child process (%s)"), ++ g_strerror (errsv)); ++ return FALSE; ++ } ++ return TRUE; ++#else ++ g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED, ++ _("Pipes are not supported in this platform")); ++ return FALSE; ++#endif ++} ++ + static void + start_daemon (GTestDBus *self) + { + const gchar *argv[] = {"dbus-daemon", "--print-address", "--config-file=foo", NULL}; ++ gint pipe_fds[2] = {-1, -1}; + gchar *config_path; + gchar *config_arg; ++ gchar *print_address; + GIOChannel *channel; +- gint stdout_fd2; + gsize termpos; + GError *error = NULL; + + if (g_getenv ("G_TEST_DBUS_DAEMON") != NULL) + argv[0] = (gchar *)g_getenv ("G_TEST_DBUS_DAEMON"); + ++ make_pipe (pipe_fds, &error); ++ g_assert_no_error (error); ++ ++ print_address = g_strdup_printf ("--print-address=%d", pipe_fds[1]); ++ argv[1] = print_address; ++ g_assert_no_error (error); ++ + /* Write config file and set its path in argv */ + config_path = write_config_file (self); + config_arg = g_strdup_printf ("--config-file=%s", config_path); + argv[2] = config_arg; + + /* Spawn dbus-daemon */ +- g_spawn_async_with_pipes (NULL, +- (gchar **) argv, +- NULL, +- /* We Need this to get the pid returned on win32 */ +- G_SPAWN_DO_NOT_REAP_CHILD | +- G_SPAWN_SEARCH_PATH | +- /* dbus-daemon will not abuse our descriptors, and +- * passing this means we can use posix_spawn() for speed */ +- G_SPAWN_LEAVE_DESCRIPTORS_OPEN, +- NULL, +- NULL, +- &self->priv->bus_pid, +- NULL, +- &self->priv->bus_stdout_fd, +- NULL, +- &error); ++ g_spawn_async_with_pipes_and_fds (NULL, ++ argv, ++ NULL, ++ /* We Need this to get the pid returned on win32 */ ++ G_SPAWN_DO_NOT_REAP_CHILD | ++ G_SPAWN_SEARCH_PATH | ++ /* dbus-daemon will not abuse our descriptors, and ++ * passing this means we can use posix_spawn() for speed */ ++ G_SPAWN_LEAVE_DESCRIPTORS_OPEN, ++ NULL, NULL, ++ -1, -1, -1, ++ &pipe_fds[1], &pipe_fds[1], 1, ++ &self->priv->bus_pid, ++ NULL, NULL, NULL, ++ &error); + g_assert_no_error (error); + + _g_test_watcher_add_pid (self->priv->bus_pid); + +- /* Read bus address from daemon' stdout. We have to be careful to avoid +- * closing the FD, as it is passed to any D-Bus service activated processes, +- * and if we close it, they will get a SIGPIPE and die when they try to write +- * to their stdout. */ +- stdout_fd2 = dup (self->priv->bus_stdout_fd); +- g_assert_cmpint (stdout_fd2, >=, 0); +- channel = g_io_channel_unix_new (stdout_fd2); +- ++ /* Read bus address from pipe */ ++ channel = g_io_channel_unix_new (pipe_fds[0]); ++ pipe_fds[0] = -1; ++ g_io_channel_set_close_on_unref (channel, TRUE); + g_io_channel_read_line (channel, &self->priv->bus_address, NULL, + &termpos, &error); + g_assert_no_error (error); + self->priv->bus_address[termpos] = '\0'; ++ close (pipe_fds[1]); ++ pipe_fds[1] = -1; + + /* start dbus-monitor */ + if (g_getenv ("G_DBUS_MONITOR") != NULL) +@@ -671,6 +701,7 @@ start_daemon (GTestDBus *self) + if (g_unlink (config_path) != 0) + g_assert_not_reached (); + ++ g_free (print_address); + g_free (config_path); + g_free (config_arg); + } +@@ -687,8 +718,6 @@ stop_daemon (GTestDBus *self) + _g_test_watcher_remove_pid (self->priv->bus_pid); + g_spawn_close_pid (self->priv->bus_pid); + self->priv->bus_pid = 0; +- close (self->priv->bus_stdout_fd); +- self->priv->bus_stdout_fd = -1; + + g_free (self->priv->bus_address); + self->priv->bus_address = NULL; +-- +GitLab diff --git a/patch/backport-gthread-posix-Free-a-memory-leak-on-error-path.patch b/patch/backport-gthread-posix-Free-a-memory-leak-on-error-path.patch new file mode 100644 index 0000000..4123294 --- /dev/null +++ b/patch/backport-gthread-posix-Free-a-memory-leak-on-error-path.patch @@ -0,0 +1,27 @@ +From d129395fe2f22f12004526bc11ca7d407f42e4ab Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?GOUJON=20=C3=89van?= +Date: Thu, 22 Jul 2021 16:41:09 +0200 +Subject: [PATCH] g_system_thread_new: Free a memory leak on error path + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/d129395fe2f22f12004526bc11ca7d407f42e4ab + +--- + glib/gthread-posix.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/glib/gthread-posix.c b/glib/gthread-posix.c +index 3d69767e67..8e2e66db54 100644 +--- a/glib/gthread-posix.c ++++ b/glib/gthread-posix.c +@@ -1331,6 +1331,7 @@ g_system_thread_new (GThreadFunc proxy, + { + g_set_error (error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN, + "Error creating thread: %s", g_strerror (ret)); ++ g_free (thread->thread.name); + g_slice_free (GThreadPosix, thread); + return NULL; + } +-- +GitLab + diff --git a/patch/backport-gtype-Fix-pointer-being-dereferenced-despite-NULL-check.patch b/patch/backport-gtype-Fix-pointer-being-dereferenced-despite-NULL-check.patch new file mode 100644 index 0000000..4877e52 --- /dev/null +++ b/patch/backport-gtype-Fix-pointer-being-dereferenced-despite-NULL-check.patch @@ -0,0 +1,35 @@ +From 5419228f632af830d9117c142a1c7c1a9708cc08 Mon Sep 17 00:00:00 2001 +From: Egor Bychin +Date: Mon, 11 Oct 2021 14:26:20 +0300 +Subject: [PATCH] gtype: Fix pointer being dereferenced despite NULL check + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/5419228f632af830d9117c142a1c7c1a9708cc08 + +--- + gobject/gtype.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gobject/gtype.c b/gobject/gtype.c +index 34f62ecba5..26ec30b7b7 100644 +--- a/gobject/gtype.c ++++ b/gobject/gtype.c +@@ -3159,11 +3159,14 @@ g_type_class_peek_parent (gpointer g_class) + g_return_val_if_fail (g_class != NULL, NULL); + + node = lookup_type_node_I (G_TYPE_FROM_CLASS (g_class)); ++ ++ g_return_val_if_fail (node != NULL, NULL); ++ + /* We used to acquire a read lock here. That is not necessary, since + * parent->data->class.class is constant as long as the derived class + * exists. + */ +- if (node && node->is_classed && node->data && NODE_PARENT_TYPE (node)) ++ if (node->is_classed && node->data && NODE_PARENT_TYPE (node)) + { + node = lookup_type_node_I (NODE_PARENT_TYPE (node)); + class = node->data->class.class; +-- +GitLab + diff --git a/patch/backport-gunixmounts-Add-cache-to-g_unix_mount_points_get.patch b/patch/backport-gunixmounts-Add-cache-to-g_unix_mount_points_get.patch new file mode 100644 index 0000000..c511c7e --- /dev/null +++ b/patch/backport-gunixmounts-Add-cache-to-g_unix_mount_points_get.patch @@ -0,0 +1,77 @@ +From 36f7684d56c5d6182398b5db992c1e81ef6cb2f5 Mon Sep 17 00:00:00 2001 +From: Rozhuk Ivan +Date: Sun, 18 Oct 2020 03:06:46 +0300 +Subject: [PATCH] gunixmounts: Add cache to g_unix_mount_points_get() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +`_g_get_unix_mount_points()` parses `/etc/fstab` every time it’s called, +so caching the result can improve performance when mounts are queried +frequently. + +The cache will remain in memory until `/etc/fstab` is next modified. +This means that the final copy of the cache will be deliberately +‘leaked’ on process exit. + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/36f7684d56c5d6182398b5db992c1e81ef6cb2f5 + +--- + gio/gunixmounts.c | 31 +++++++++++++++++++++++++++++-- + 1 file changed, 29 insertions(+), 2 deletions(-) + +diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c +index ecfa61de86..9c8ef5d666 100644 +--- a/gio/gunixmounts.c ++++ b/gio/gunixmounts.c +@@ -1666,6 +1666,14 @@ g_unix_mount_for (const char *file_path, + return entry; + } + ++static gpointer ++copy_mount_point_cb (gconstpointer src, ++ gpointer data) ++{ ++ GUnixMountPoint *src_mount_point = (GUnixMountPoint *) src; ++ return g_unix_mount_point_copy (src_mount_point); ++} ++ + /** + * g_unix_mount_points_get: + * @time_read: (out) (optional): guint64 to contain a timestamp. +@@ -1681,10 +1689,29 @@ g_unix_mount_for (const char *file_path, + GList * + g_unix_mount_points_get (guint64 *time_read) + { ++ static GList *mnt_pts_last = NULL; ++ static guint64 time_read_last = 0; ++ GList *mnt_pts = NULL; ++ guint64 time_read_now; ++ G_LOCK_DEFINE_STATIC (unix_mount_points); ++ ++ G_LOCK (unix_mount_points); ++ ++ time_read_now = get_mount_points_timestamp (); ++ if (time_read_now != time_read_last || mnt_pts_last == NULL) ++ { ++ time_read_last = time_read_now; ++ g_list_free_full (mnt_pts_last, (GDestroyNotify) g_unix_mount_point_free); ++ mnt_pts_last = _g_get_unix_mount_points (); ++ } ++ mnt_pts = g_list_copy_deep (mnt_pts_last, copy_mount_point_cb, NULL); ++ ++ G_UNLOCK (unix_mount_points); ++ + if (time_read) +- *time_read = get_mount_points_timestamp (); ++ *time_read = time_read_now; + +- return _g_get_unix_mount_points (); ++ return mnt_pts; + } + + /** +-- +GitLab + diff --git a/patch/backport-gutf8-add-string-length-check.patch b/patch/backport-gutf8-add-string-length-check.patch new file mode 100644 index 0000000..9360395 --- /dev/null +++ b/patch/backport-gutf8-add-string-length-check.patch @@ -0,0 +1,97 @@ +From 9adbdd45d7101405eb05487bdf6a2015af9f8afd Mon Sep 17 00:00:00 2001 +From: Chen Guanqiao +Date: Thu, 11 Nov 2021 01:04:38 +0800 +Subject: [PATCH] gutf8: add string length check when ending character offset + is -1 + +Some function such as atk_text_get_text, use -1 to indicate the end of the +string. And an crash occurs when the -1 is passed to g_utf8_substring. + +Call Trace: + 0 __memmove_avx_unaligned_erms + 1 memcpy + 2 g_utf8_substring + 3 impl_GetText + 4 handle_other + 5 handle_message + 6 _dbus_object_tree_dispatch_and_unlock + 7 dbus_connection_dispatch + 8 dbus_connection_dispatch + 9 () + 10 g_main_dispatch + 11 g_main_context_dispatch + 12 g_main_context_iterate + 13 g_main_context_iteration + 14 g_application_run + 15 main + +Signed-off-by: Chen Guanqiao + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/9adbdd45d7101405eb05487bdf6a2015af9f8afd + +--- + glib/gutf8.c | 19 +++++++++++++++++-- + glib/tests/utf8-misc.c | 4 ++++ + 2 files changed, 21 insertions(+), 2 deletions(-) + +diff --git a/glib/gutf8.c b/glib/gutf8.c +index 7d053540d6..9097f690b3 100644 +--- a/glib/gutf8.c ++++ b/glib/gutf8.c +@@ -271,11 +271,15 @@ g_utf8_strlen (const gchar *p, + * g_utf8_substring: + * @str: a UTF-8 encoded string + * @start_pos: a character offset within @str +- * @end_pos: another character offset within @str ++ * @end_pos: another character offset within @str, ++ * or `-1` to indicate the end of the string + * + * Copies a substring out of a UTF-8 encoded string. + * The substring will contain @end_pos - @start_pos characters. + * ++ * Since GLib 2.72, `-1` can be passed to @end_pos to indicate the ++ * end of the string. ++ * + * Returns: (transfer full): a newly allocated copy of the requested + * substring. Free with g_free() when no longer needed. + * +@@ -288,8 +292,19 @@ g_utf8_substring (const gchar *str, + { + gchar *start, *end, *out; + ++ g_return_val_if_fail (end_pos >= start_pos || end_pos == -1, NULL); ++ + start = g_utf8_offset_to_pointer (str, start_pos); +- end = g_utf8_offset_to_pointer (start, end_pos - start_pos); ++ ++ if (end_pos == -1) ++ { ++ glong length = g_utf8_strlen (start, -1); ++ end = g_utf8_offset_to_pointer (start, length); ++ } ++ else ++ { ++ end = g_utf8_offset_to_pointer (start, end_pos - start_pos); ++ } + + out = g_malloc (end - start + 1); + memcpy (out, start, end - start); +diff --git a/glib/tests/utf8-misc.c b/glib/tests/utf8-misc.c +index 7a8c37448b..c137294229 100644 +--- a/glib/tests/utf8-misc.c ++++ b/glib/tests/utf8-misc.c +@@ -128,6 +128,10 @@ test_utf8_substring (void) + r = g_utf8_substring ("abc\xe2\x82\xa0gh\xe2\x82\xa4", 2, 5); + g_assert_cmpstr (r, ==, "c\xe2\x82\xa0g"); + g_free (r); ++ ++ r = g_utf8_substring ("abcd", 1, -1); ++ g_assert_cmpstr (r, ==, "bcd"); ++ g_free (r); + } + + static void +-- +GitLab + diff --git a/patch/backport-gutils-Avoid-segfault-in-g_get_user_database_entry.patch b/patch/backport-gutils-Avoid-segfault-in-g_get_user_database_entry.patch new file mode 100644 index 0000000..3e978a0 --- /dev/null +++ b/patch/backport-gutils-Avoid-segfault-in-g_get_user_database_entry.patch @@ -0,0 +1,58 @@ +From bb40105fe95b5d95e31715ddb210380d381a1e26 Mon Sep 17 00:00:00 2001 +From: Jamie Bainbridge +Date: Wed, 8 Sep 2021 12:08:17 +1000 +Subject: [PATCH] gutils: Avoid segfault in g_get_user_database_entry + +g_get_user_database_entry() capitalises the first letter of pw_name +with g_ascii_toupper (pw->pw_name[0]). + +However, the manpage for getpwnam() and getpwuid() says the result of +those calls "may point to a static area". GLib is then trying to edit +static memory which belongs to a shared library, so segfaults. + +The reentrant variants of the above calls are supposed to fill the user +buffer supplied to them, however Michael Catanzaro also found a bug in +systemd where the data is not copied to the user buffer and still points +to static memory, resulting in the same sort of segfault. See: +https://github.com/systemd/systemd/issues/20679 + +Solve both these cases in GLib by copying pw_name off to a temporary +variable, set uppercase on that variable, and use the variable to join +into the desired string. Free the variable after it is no longer needed. + +Signed-off-by: Jamie Bainbridge + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/bb40105fe95b5d95e31715ddb210380d381a1e26 + +--- + glib/gutils.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/glib/gutils.c b/glib/gutils.c +index b7a2113d41..4bccd72297 100644 +--- a/glib/gutils.c ++++ b/glib/gutils.c +@@ -692,14 +692,17 @@ g_get_user_database_entry (void) + { + gchar **gecos_fields; + gchar **name_parts; ++ gchar *uppercase_pw_name; + + /* split the gecos field and substitute '&' */ + gecos_fields = g_strsplit (pw->pw_gecos, ",", 0); + name_parts = g_strsplit (gecos_fields[0], "&", 0); +- pw->pw_name[0] = g_ascii_toupper (pw->pw_name[0]); +- e.real_name = g_strjoinv (pw->pw_name, name_parts); ++ uppercase_pw_name = g_strdup (pw->pw_name); ++ uppercase_pw_name[0] = g_ascii_toupper (uppercase_pw_name[0]); ++ e.real_name = g_strjoinv (uppercase_pw_name, name_parts); + g_strfreev (gecos_fields); + g_strfreev (name_parts); ++ g_free (uppercase_pw_name); + } + #endif + +-- +GitLab + diff --git a/patch/backport-gutils-Fix-g_find_program_in_path-to-return-an-absolute-path.patch b/patch/backport-gutils-Fix-g_find_program_in_path-to-return-an-absolute-path.patch new file mode 100644 index 0000000..405164e --- /dev/null +++ b/patch/backport-gutils-Fix-g_find_program_in_path-to-return-an-absolute-path.patch @@ -0,0 +1,41 @@ +From 78dc1cc3cd669e9fb92ae7847bab2b308c0a8628 Mon Sep 17 00:00:00 2001 +From: Christoph Niethammer +Date: Thu, 27 Jan 2022 03:54:01 +0100 +Subject: [PATCH] gutils: Fix g_find_program_in_path() to return an absolute + path + +Fix a possibility of returning a relative path, in case PATH contains +a relative path. According to the doc, the function should return an +absolute path. + +Signed-off-by: Christoph Niethammer + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/78dc1cc3cd669e9fb92ae7847bab2b308c0a8628 + +--- + glib/gutils.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/glib/gutils.c b/glib/gutils.c +index 6652d0ba05..6cc4506073 100644 +--- a/glib/gutils.c ++++ b/glib/gutils.c +@@ -456,7 +456,14 @@ g_find_program_in_path (const gchar *program) + !g_file_test (startp, G_FILE_TEST_IS_DIR)) + { + gchar *ret; +- ret = g_strdup (startp); ++ if (g_path_is_absolute (startp)) { ++ ret = g_strdup (startp); ++ } else { ++ gchar *cwd = NULL; ++ cwd = g_get_current_dir (); ++ ret = g_build_filename (cwd, startp, NULL); ++ g_free (cwd); ++ } + g_free (freeme); + #ifdef G_OS_WIN32 + g_free ((gchar *) path_copy); +-- +GitLab diff --git a/patch/backport-gvariant-Fix-memory-leak-on-a-TYPE-CHECK-failure.patch b/patch/backport-gvariant-Fix-memory-leak-on-a-TYPE-CHECK-failure.patch new file mode 100644 index 0000000..50392fc --- /dev/null +++ b/patch/backport-gvariant-Fix-memory-leak-on-a-TYPE-CHECK-failure.patch @@ -0,0 +1,34 @@ +From 05dffc1a7f562e9c8c6c21b67f99204f7a7b4e27 Mon Sep 17 00:00:00 2001 +From: Egor Bychin +Date: Mon, 11 Oct 2021 14:20:26 +0300 +Subject: [PATCH] gvariant: Fix memory leak on a TYPE_CHECK failure + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/05dffc1a7f562e9c8c6c21b67f99204f7a7b4e27 + +--- + glib/gvariant.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/glib/gvariant.c b/glib/gvariant.c +index a9bb99c647..4a9704c19c 100644 +--- a/glib/gvariant.c ++++ b/glib/gvariant.c +@@ -800,7 +800,13 @@ g_variant_new_array (const GVariantType *child_type, + + for (i = 0; i < n_children; i++) + { +- TYPE_CHECK (children[i], child_type, NULL); ++ if G_UNLIKELY (!g_variant_is_of_type (children[i], child_type)) ++ { ++ while (i != 0) ++ g_variant_unref (my_children[--i]); ++ g_free (my_children); ++ g_return_val_if_fail (g_variant_is_of_type (children[i], child_type), NULL); ++ } + my_children[i] = g_variant_ref_sink (children[i]); + trusted &= g_variant_is_trusted (children[i]); + } +-- +GitLab + diff --git a/patch/backport-gvariant-Fix-pointers-being-dereferenced-despite-NULL-checks.patch b/patch/backport-gvariant-Fix-pointers-being-dereferenced-despite-NULL-checks.patch new file mode 100644 index 0000000..2921787 --- /dev/null +++ b/patch/backport-gvariant-Fix-pointers-being-dereferenced-despite-NULL-checks.patch @@ -0,0 +1,61 @@ +From 7f6ce4d8d234996b523b71abef139f1c80c88254 Mon Sep 17 00:00:00 2001 +From: Egor Bychin +Date: Mon, 11 Oct 2021 14:24:12 +0300 +Subject: [PATCH] gvariant: Fix pointers being dereferenced despite NULL checks + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/7f6ce4d8d234996b523b71abef139f1c80c88254 + +--- + glib/gvariant.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/glib/gvariant.c b/glib/gvariant.c +index 4a9704c19c..5fa6a82685 100644 +--- a/glib/gvariant.c ++++ b/glib/gvariant.c +@@ -3196,8 +3196,7 @@ struct heap_builder + #define GVSB_MAGIC ((gsize) 1033660112u) + #define GVSB_MAGIC_PARTIAL ((gsize) 2942751021u) + #define GVHB_MAGIC ((gsize) 3087242682u) +-#define is_valid_builder(b) (b != NULL && \ +- GVSB(b)->magic == GVSB_MAGIC) ++#define is_valid_builder(b) (GVSB(b)->magic == GVSB_MAGIC) + #define is_valid_heap_builder(b) (GVHB(b)->magic == GVHB_MAGIC) + + /* Just to make sure that by adding a union to GVariantBuilder, we +@@ -3207,7 +3206,9 @@ G_STATIC_ASSERT (sizeof (GVariantBuilder) == sizeof (gsize[16])); + static gboolean + ensure_valid_builder (GVariantBuilder *builder) + { +- if (is_valid_builder (builder)) ++ if (builder == NULL) ++ return FALSE; ++ else if (is_valid_builder (builder)) + return TRUE; + if (builder->u.s.partial_magic == GVSB_MAGIC_PARTIAL) + { +@@ -3853,8 +3854,7 @@ struct heap_dict + #define GVSD_MAGIC ((gsize) 2579507750u) + #define GVSD_MAGIC_PARTIAL ((gsize) 3488698669u) + #define GVHD_MAGIC ((gsize) 2450270775u) +-#define is_valid_dict(d) (d != NULL && \ +- GVSD(d)->magic == GVSD_MAGIC) ++#define is_valid_dict(d) (GVSD(d)->magic == GVSD_MAGIC) + #define is_valid_heap_dict(d) (GVHD(d)->magic == GVHD_MAGIC) + + /* Just to make sure that by adding a union to GVariantDict, we didn't +@@ -3864,7 +3864,9 @@ G_STATIC_ASSERT (sizeof (GVariantDict) == sizeof (gsize[16])); + static gboolean + ensure_valid_dict (GVariantDict *dict) + { +- if (is_valid_dict (dict)) ++ if (dict == NULL) ++ return FALSE; ++ else if (is_valid_dict (dict)) + return TRUE; + if (dict->u.s.partial_magic == GVSD_MAGIC_PARTIAL) + { +-- +GitLab + diff --git a/patch/backport-gvariant-serialiser-Prevent-unbounded-recursion.patch b/patch/backport-gvariant-serialiser-Prevent-unbounded-recursion.patch new file mode 100644 index 0000000..447cbf9 --- /dev/null +++ b/patch/backport-gvariant-serialiser-Prevent-unbounded-recursion.patch @@ -0,0 +1,54 @@ +From 77233f6f0779fe0c1cb48861d7deded4ae413567 Mon Sep 17 00:00:00 2001 +From: Sebastian Wilhelmi +Date: Thu, 6 Jan 2022 20:50:34 +0000 +Subject: [PATCH] gvariant-serialiser: Prevent unbounded recursion in + is_normal() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes a bug in 7c4e6e9fbe473de0401c778c6b0c4aad27d5145a. + +The original approach in that commit accidentally only checked the depth +at the leaf nodes in the variant tree, whereas actually the depth should +be checked before recursing to avoid stack overflow. + +It neglected to consider that `g_variant_serialised_is_normal()` would +be recursed into by some of the `DISPATCH(_is_normal)` cases. When that +happened, the depth check was after the recursion so couldn鈥檛 prevent a +stack overflow. + +Fixes: #2572 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/77233f6f0779fe0c1cb48861d7deded4ae413567 + +--- + glib/gvariant-serialiser.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c +index 832a8fdc2a..7b13381b6f 100644 +--- a/glib/gvariant-serialiser.c ++++ b/glib/gvariant-serialiser.c +@@ -1587,6 +1587,9 @@ g_variant_serialised_byteswap (GVariantSerialised serialised) + gboolean + g_variant_serialised_is_normal (GVariantSerialised serialised) + { ++ if (serialised.depth >= G_VARIANT_MAX_RECURSION_DEPTH) ++ return FALSE; ++ + DISPATCH_CASES (serialised.type_info, + + return gvs_/**/,/**/_is_normal (serialised); +@@ -1595,8 +1598,6 @@ g_variant_serialised_is_normal (GVariantSerialised serialised) + + if (serialised.data == NULL) + return FALSE; +- if (serialised.depth >= G_VARIANT_MAX_RECURSION_DEPTH) +- return FALSE; + + /* some hard-coded terminal cases */ + switch (g_variant_type_info_get_type_char (serialised.type_info)) +-- +GitLab diff --git a/patch/backport-lib-openharmony-glib.patch b/patch/backport-lib-openharmony-glib.patch new file mode 100644 index 0000000..5e1b908 --- /dev/null +++ b/patch/backport-lib-openharmony-glib.patch @@ -0,0 +1,19795 @@ +diff --git a/config.h b/config.h +new file mode 100644 +index 0000000..0b4fb17 +--- /dev/null ++++ b/config.h +@@ -0,0 +1,430 @@ ++/* ++ * Autogenerated by the Meson build system. ++ * Do not edit, your changes will be lost. ++ */ ++ ++#pragma once ++ ++#define ALIGNOF_GUINT32 4 ++ ++#define ALIGNOF_GUINT64 8 ++ ++#ifdef __LP64__ ++#define ALIGNOF_UNSIGNED_LONG 8 ++ ++#define DBL_EXPBIT0_BIT 20 ++ ++#define DBL_EXPBIT0_WORD 1 ++#else ++#define ALIGNOF_UNSIGNED_LONG 4 ++#endif ++ ++#ifndef OHOS_OPT_COMPAT ++/* ohos.opt.compat.001: ++ * Remove dependency to gettext ++ */ ++#define ENABLE_NLS 1 ++#endif ++ ++#define EXEEXT ++ ++#define GETTEXT_PACKAGE "glib20" ++ ++#define GLIB_BINARY_AGE 6801 ++ ++#define GLIB_INTERFACE_AGE 1 ++ ++#define GLIB_LOCALE_DIR "/usr/local/share/locale" ++ ++#define GLIB_MAJOR_VERSION 2 ++ ++#define GLIB_MICRO_VERSION 1 ++ ++#define GLIB_MINOR_VERSION 68 ++ ++#define G_VA_COPY va_copy ++ ++#define G_VA_COPY_AS_ARRAY 1 ++ ++#define HAVE_ALLOCA_H 1 ++ ++#define HAVE_BIND_TEXTDOMAIN_CODESET ++ ++#undef HAVE_C99_SNPRINTF ++ ++#undef HAVE_C99_VSNPRINTF ++ ++#define HAVE_CLOCK_GETTIME 1 ++ ++#define HAVE_CODESET 1 ++ ++#define HAVE_DCGETTEXT 1 ++ ++#define HAVE_DIRENT_H 1 ++ ++#define HAVE_ENDMNTENT 1 ++ ++#define HAVE_ENDSERVENT 1 ++ ++#define HAVE_EPOLL_CREATE 1 ++ ++#define HAVE_EVENTFD 1 ++ ++#define HAVE_FALLOCATE 1 ++ ++#define HAVE_FCHMOD 1 ++ ++#define HAVE_FCHOWN 1 ++ ++#define HAVE_FLOAT_H 1 ++ ++#define HAVE_FSTAB_H 1 ++ ++#define HAVE_FSYNC 1 ++ ++#define HAVE_FUTEX 1 ++ ++#define HAVE_GETAUXVAL 1 ++ ++#define HAVE_GETC_UNLOCKED 1 ++ ++#define HAVE_GETGRGID_R 1 ++ ++#define HAVE_GETMNTENT_R 1 ++ ++#define HAVE_GETPWUID_R 1 ++ ++#define HAVE_GETRESUID 1 ++ ++#define HAVE_GETTEXT 1 ++ ++#define HAVE_GMTIME_R 1 ++ ++#define HAVE_GRP_H 1 ++ ++#define HAVE_HASMNTOPT 1 ++ ++#define HAVE_IF_INDEXTONAME 1 ++ ++#define HAVE_IF_NAMETOINDEX 1 ++ ++#define HAVE_INOTIFY_INIT1 1 ++ ++#define HAVE_INTMAX_T 1 ++ ++#define HAVE_INTTYPES_H 1 ++ ++#define HAVE_INTTYPES_H_WITH_UINTMAX 1 ++ ++#define HAVE_IPV6 ++ ++#define HAVE_IP_MREQN 1 ++ ++#define HAVE_LANGINFO_CODESET 1 ++ ++#define HAVE_LANGINFO_TIME 1 ++ ++#define HAVE_LCHOWN 1 ++ ++#define HAVE_LC_MESSAGES 1 ++ ++#undef HAVE_LIBMOUNT ++ ++#define HAVE_LIMITS_H 1 ++ ++#define HAVE_LINK 1 ++ ++#define HAVE_LINUX_MAGIC_H 1 ++ ++#define HAVE_LOCALE_H 1 ++ ++#define HAVE_LOCALTIME_R 1 ++ ++#define HAVE_LONG_DOUBLE 1 ++ ++#define HAVE_LONG_LONG 1 ++ ++#define HAVE_LSTAT 1 ++ ++#define HAVE_MALLOC_H 1 ++ ++#define HAVE_MBRTOWC 1 ++ ++#define HAVE_MEMALIGN 1 ++ ++#define HAVE_MEMORY_H 1 ++ ++#define HAVE_MKOSTEMP 1 ++ ++#define HAVE_MMAP 1 ++ ++#define HAVE_MNTENT_H 1 ++ ++#define HAVE_NETLINK 1 ++ ++#define HAVE_NEWLOCALE 1 ++ ++#define HAVE_OPEN_O_DIRECTORY 1 ++ ++#define HAVE_PIPE2 1 ++ ++#define HAVE_POLL 1 ++ ++#define HAVE_POLL_H 1 ++ ++#define HAVE_POSIX_MEMALIGN 1 ++ ++#define HAVE_POSIX_SPAWN 1 ++ ++#define HAVE_PRLIMIT 1 ++ ++#define HAVE_PROC_SELF_CMDLINE ++ ++#define HAVE_PTHREAD_ATTR_SETINHERITSCHED 1 ++ ++#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 ++ ++#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1 ++ ++#define HAVE_PTHREAD_GETNAME_NP 1 ++ ++#define HAVE_PTHREAD_SETNAME_NP_WITH_TID 1 ++ ++#define HAVE_PTRDIFF_T 1 ++ ++#define HAVE_PWD_H 1 ++ ++#define HAVE_READLINK 1 ++ ++#define HAVE_RECVMMSG 1 ++ ++#define HAVE_RES_INIT 1 ++ ++#define HAVE_RES_NCLOSE 1 ++ ++#define HAVE_RES_NINIT 1 ++ ++#define HAVE_RTLD_GLOBAL 1 ++ ++#define HAVE_RTLD_LAZY 1 ++ ++#define HAVE_RTLD_NEXT 1 ++ ++#define HAVE_RTLD_NOW 1 ++ ++#define HAVE_SCHED_H 1 ++ ++#undef HAVE_SELINUX ++ ++#define HAVE_SENDMMSG 1 ++ ++#define HAVE_SETENV 1 ++ ++#define HAVE_SETMNTENT 1 ++ ++#define HAVE_SIG_ATOMIC_T 1 ++ ++#define HAVE_SIOCGIFADDR /**/ ++ ++#define HAVE_SNPRINTF 1 ++ ++#define HAVE_SPAWN_H 1 ++ ++#define HAVE_SPLICE 1 ++ ++#define HAVE_STATFS 1 ++ ++#define HAVE_STATVFS 1 ++ ++#define HAVE_STDATOMIC_H 1 ++ ++#define HAVE_STDINT_H 1 ++ ++#define HAVE_STDINT_H_WITH_UINTMAX 1 ++ ++#define HAVE_STDLIB_H 1 ++ ++#define HAVE_STPCPY 1 ++ ++#define HAVE_STRCASECMP 1 ++ ++#define HAVE_STRERROR_R 1 ++ ++#define HAVE_STRINGS_H 1 ++ ++#define HAVE_STRING_H 1 ++ ++#define HAVE_STRNCASECMP 1 ++ ++#define HAVE_STRNLEN 1 ++ ++#define HAVE_STRSIGNAL 1 ++ ++#define HAVE_STRTOD_L 1 ++ ++#define HAVE_STRTOLL_L 1 ++ ++#define HAVE_STRTOULL_L 1 ++ ++#define HAVE_STRUCT_DIRENT_D_TYPE 1 ++ ++#define HAVE_STRUCT_STATFS_F_BAVAIL 1 ++ ++#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 ++ ++#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 ++ ++#define HAVE_STRUCT_STAT_ST_BLOCKS 1 ++ ++#define HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC 1 ++ ++#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 ++ ++#define HAVE_STRUCT_TM_TM_GMTOFF 1 ++ ++#define HAVE_SYMLINK 1 ++ ++#undef HAVE_SYSPROF ++ ++#define HAVE_SYS_AUXV_H 1 ++ ++#define HAVE_SYS_INOTIFY_H 1 ++ ++#define HAVE_SYS_MOUNT_H 1 ++ ++#define HAVE_SYS_PARAM_H 1 ++ ++#define HAVE_SYS_RESOURCE_H 1 ++ ++#define HAVE_SYS_SCHED_GETATTR 1 ++ ++#define HAVE_SYS_SELECT_H 1 ++ ++#define HAVE_SYS_STATFS_H 1 ++ ++#define HAVE_SYS_STATVFS_H 1 ++ ++#define HAVE_SYS_STAT_H 1 ++ ++#define HAVE_SYS_SYSCTL_H 1 ++ ++#define HAVE_SYS_TIMES_H 1 ++ ++#define HAVE_SYS_TIME_H 1 ++ ++#define HAVE_SYS_TYPES_H 1 ++ ++#define HAVE_SYS_UIO_H 1 ++ ++#define HAVE_SYS_VFS_H 1 ++ ++#define HAVE_SYS_WAIT_H 1 ++ ++#define HAVE_SYS_XATTR_H 1 ++ ++#define HAVE_TERMIOS_H 1 ++ ++#define HAVE_TIMEGM 1 ++ ++#define HAVE_UINT128_T 1 ++ ++#define HAVE_UNISTD_H 1 ++ ++#undef HAVE_UNIX98_PRINTF ++ ++#define HAVE_UNSETENV 1 ++ ++#define HAVE_UTIMES 1 ++ ++#define HAVE_VALLOC 1 ++ ++#define HAVE_VALUES_H 1 ++ ++#define HAVE_VASPRINTF 1 ++ ++#define HAVE_VSNPRINTF 1 ++ ++#define HAVE_WCHAR_H 1 ++ ++#define HAVE_WCHAR_T 1 ++ ++#define HAVE_WCRTOMB 1 ++ ++#define HAVE_WCSLEN 1 ++ ++#define HAVE_WCSNLEN 1 ++ ++#define HAVE_WINT_T 1 ++ ++#define HAVE_XATTR 1 ++ ++#define MAJOR_IN_SYSMACROS 1 ++ ++#define PACKAGE_BUGREPORT "https://gitlab.gnome.org/GNOME/glib/issues/new" ++ ++#define PACKAGE_NAME "glib" ++ ++#define PACKAGE_STRING "glib 2.68.1" ++ ++#define PACKAGE_TARNAME "glib" ++ ++#define PACKAGE_URL "" ++ ++#define PACKAGE_VERSION "2.68.1" ++ ++#define SIZEOF_CHAR 1 ++ ++#define SIZEOF_INT 4 ++ ++#ifdef __LP64__ ++#define SIZEOF_LONG 8 ++#else ++#define SIZEOF_LONG 4 ++#endif ++ ++#define SIZEOF_LONG_LONG 8 ++ ++#define SIZEOF_SHORT 2 ++ ++#ifdef __LP64__ ++#define SIZEOF_SIZE_T 8 ++ ++#define SIZEOF_SSIZE_T 8 ++ ++#define SIZEOF_VOID_P 8 ++#else ++#define SIZEOF_SIZE_T 4 ++ ++#define SIZEOF_SSIZE_T 4 ++ ++#define SIZEOF_VOID_P 4 ++#endif ++ ++#define SIZEOF_WCHAR_T 4 ++ ++#define STATFS_ARGS 2 ++ ++#ifndef OHOS_OPT_COMPAT ++/* ++ * OHOS_OPT_COMPAT.0026 ++ * strerror_r return null in RK platform, resulting in abnormal process ++ */ ++#define STRERROR_R_CHAR_P 1 // Defined if strerror_r returns char * ++#endif ++ ++#define THREADS_POSIX 1 ++ ++#define USE_STATFS 1 ++ ++#undef USE_SYSTEM_PCRE ++ ++#define USE_SYSTEM_PRINTF ++ ++#define _GLIB_EXTERN __attribute__((visibility("default"))) extern ++ ++#define _GNU_SOURCE 1 ++ ++#define gl_extern_inline ++ ++#define gl_unused ++ +diff --git a/docs/reference/gio/gdbus-object-manager-example/gdbus-object-manager-example-sections.tx b/docs/reference/gio/gdbus-object-manager-example/gdbus-object-manager-example-sections.tx +new file mode 100644 +index 0000000..1e3b8b8 +--- /dev/null ++++ b/docs/reference/gio/gdbus-object-manager-example/gdbus-object-manager-example-sections.tx +@@ -0,0 +1,161 @@ ++
++ExampleAnimal ++ExampleAnimal ++ExampleAnimal ++ExampleAnimalIface ++example_animal_interface_info ++example_animal_override_properties ++example_animal_call_poke ++example_animal_call_poke_finish ++example_animal_call_poke_sync ++example_animal_complete_poke ++example_animal_emit_jumped ++example_animal_get_mood ++example_animal_get_foo ++example_animal_get_bar ++example_animal_dup_mood ++example_animal_dup_foo ++example_animal_dup_bar ++example_animal_set_mood ++example_animal_set_foo ++example_animal_set_bar ++ExampleAnimalProxy ++ExampleAnimalProxyClass ++example_animal_proxy_new ++example_animal_proxy_new_finish ++example_animal_proxy_new_sync ++example_animal_proxy_new_for_bus ++example_animal_proxy_new_for_bus_finish ++example_animal_proxy_new_for_bus_sync ++ExampleAnimalSkeleton ++ExampleAnimalSkeletonClass ++example_animal_skeleton_new ++ ++example_animal_get_type ++example_animal_proxy_get_type ++example_animal_skeleton_get_type ++ExampleAnimalSkeletonPrivate ++ExampleAnimalProxyPrivate ++EXAMPLE_TYPE_ANIMAL ++EXAMPLE_TYPE_ANIMAL_PROXY ++EXAMPLE_TYPE_ANIMAL_SKELETON ++EXAMPLE_ANIMAL ++EXAMPLE_ANIMAL_GET_IFACE ++EXAMPLE_ANIMAL_PROXY ++EXAMPLE_ANIMAL_PROXY_CLASS ++EXAMPLE_ANIMAL_PROXY_GET_CLASS ++EXAMPLE_ANIMAL_SKELETON ++EXAMPLE_ANIMAL_SKELETON_CLASS ++EXAMPLE_ANIMAL_SKELETON_GET_CLASS ++EXAMPLE_IS_ANIMAL ++EXAMPLE_IS_ANIMAL_PROXY ++EXAMPLE_IS_ANIMAL_PROXY_CLASS ++EXAMPLE_IS_ANIMAL_SKELETON ++EXAMPLE_IS_ANIMAL_SKELETON_CLASS ++
++ ++
++ExampleCat ++ExampleCat ++ExampleCat ++ExampleCatIface ++example_cat_interface_info ++example_cat_override_properties ++ExampleCatProxy ++ExampleCatProxyClass ++example_cat_proxy_new ++example_cat_proxy_new_finish ++example_cat_proxy_new_sync ++example_cat_proxy_new_for_bus ++example_cat_proxy_new_for_bus_finish ++example_cat_proxy_new_for_bus_sync ++ExampleCatSkeleton ++ExampleCatSkeletonClass ++example_cat_skeleton_new ++ ++example_cat_get_type ++example_cat_proxy_get_type ++example_cat_skeleton_get_type ++ExampleCatProxyPrivate ++ExampleCatSkeletonPrivate ++EXAMPLE_TYPE_CAT ++EXAMPLE_TYPE_CAT_PROXY ++EXAMPLE_TYPE_CAT_SKELETON ++EXAMPLE_CAT ++EXAMPLE_CAT_GET_IFACE ++EXAMPLE_CAT_PROXY ++EXAMPLE_CAT_PROXY_CLASS ++EXAMPLE_CAT_PROXY_GET_CLASS ++EXAMPLE_CAT_SKELETON ++EXAMPLE_CAT_SKELETON_CLASS ++EXAMPLE_CAT_SKELETON_GET_CLASS ++EXAMPLE_IS_CAT ++EXAMPLE_IS_CAT_PROXY ++EXAMPLE_IS_CAT_PROXY_CLASS ++EXAMPLE_IS_CAT_SKELETON ++EXAMPLE_IS_CAT_SKELETON_CLASS ++
++ ++
++ExampleObject ++ExampleObject ++ExampleObject ++ExampleObjectIface ++example_object_get_animal ++example_object_get_cat ++example_object_peek_animal ++example_object_peek_cat ++ExampleObjectProxy ++ExampleObjectProxyClass ++example_object_proxy_new ++ExampleObjectSkeleton ++ExampleObjectSkeletonClass ++example_object_skeleton_new ++example_object_skeleton_set_animal ++example_object_skeleton_set_cat ++ ++example_object_get_type ++example_object_proxy_get_type ++example_object_skeleton_get_type ++ExampleObjectProxyPrivate ++ExampleObjectSkeletonPrivate ++EXAMPLE_IS_OBJECT ++EXAMPLE_IS_OBJECT_PROXY ++EXAMPLE_IS_OBJECT_PROXY_CLASS ++EXAMPLE_IS_OBJECT_SKELETON ++EXAMPLE_IS_OBJECT_SKELETON_CLASS ++EXAMPLE_OBJECT ++EXAMPLE_OBJECT_GET_IFACE ++EXAMPLE_OBJECT_PROXY ++EXAMPLE_OBJECT_PROXY_CLASS ++EXAMPLE_OBJECT_PROXY_GET_CLASS ++EXAMPLE_OBJECT_SKELETON ++EXAMPLE_OBJECT_SKELETON_CLASS ++EXAMPLE_OBJECT_SKELETON_GET_CLASS ++EXAMPLE_TYPE_OBJECT ++EXAMPLE_TYPE_OBJECT_PROXY ++EXAMPLE_TYPE_OBJECT_SKELETON ++
++ ++
++ExampleObjectManagerClient ++ExampleObjectManagerClient ++ExampleObjectManagerClient ++ExampleObjectManagerClientClass ++example_object_manager_client_get_proxy_type ++example_object_manager_client_new ++example_object_manager_client_new_finish ++example_object_manager_client_new_sync ++example_object_manager_client_new_for_bus ++example_object_manager_client_new_for_bus_finish ++example_object_manager_client_new_for_bus_sync ++ ++example_object_manager_client_get_type ++EXAMPLE_IS_OBJECT_MANAGER_CLIENT ++EXAMPLE_IS_OBJECT_MANAGER_CLIENT_CLASS ++EXAMPLE_OBJECT_MANAGER_CLIENT ++EXAMPLE_OBJECT_MANAGER_CLIENT_CLASS ++EXAMPLE_OBJECT_MANAGER_CLIENT_GET_CLASS ++EXAMPLE_TYPE_OBJECT_MANAGER_CLIENT ++ExampleObjectManagerClientPrivate ++
+diff --git a/gio/gconstructor_as_data.h b/gio/gconstructor_as_data.h +new file mode 100644 +index 0000000..35dc395 +--- /dev/null ++++ b/gio/gconstructor_as_data.h +@@ -0,0 +1 @@ ++const char gconstructor_code[] = "\x2f\x2a\x0a\x20\x20\x49\x66\x20\x47\x5f\x48\x41\x53\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x53\x20\x69\x73\x20\x74\x72\x75\x65\x20\x74\x68\x65\x6e\x20\x74\x68\x65\x20\x63\x6f\x6d\x70\x69\x6c\x65\x72\x20\x73\x75\x70\x70\x6f\x72\x74\x20\x2a\x62\x6f\x74\x68\x2a\x20\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x73\x20\x61\x6e\x64\x0a\x20\x20\x64\x65\x73\x74\x72\x75\x63\x74\x6f\x72\x73\x2c\x20\x69\x6e\x20\x61\x20\x75\x73\x61\x62\x6c\x65\x20\x77\x61\x79\x2c\x20\x69\x6e\x63\x6c\x75\x64\x69\x6e\x67\x20\x65\x2e\x67\x2e\x20\x6f\x6e\x20\x6c\x69\x62\x72\x61\x72\x79\x20\x75\x6e\x6c\x6f\x61\x64\x2e\x20\x49\x66\x20\x6e\x6f\x74\x20\x79\x6f\x75\x27\x72\x65\x20\x6f\x6e\x0a\x20\x20\x79\x6f\x75\x72\x20\x6f\x77\x6e\x2e\x0a\x0a\x20\x20\x53\x6f\x6d\x65\x20\x63\x6f\x6d\x70\x69\x6c\x65\x72\x73\x20\x6e\x65\x65\x64\x20\x23\x70\x72\x61\x67\x6d\x61\x20\x74\x6f\x20\x68\x61\x6e\x64\x6c\x65\x20\x74\x68\x69\x73\x2c\x20\x77\x68\x69\x63\x68\x20\x64\x6f\x65\x73\x20\x6e\x6f\x74\x20\x77\x6f\x72\x6b\x20\x77\x69\x74\x68\x20\x6d\x61\x63\x72\x6f\x73\x2c\x0a\x20\x20\x73\x6f\x20\x74\x68\x65\x20\x77\x61\x79\x20\x79\x6f\x75\x20\x6e\x65\x65\x64\x20\x74\x6f\x20\x75\x73\x65\x20\x74\x68\x69\x73\x20\x69\x73\x20\x28\x66\x6f\x72\x20\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x73\x29\x3a\x0a\x0a\x20\x20\x23\x69\x66\x64\x65\x66\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x5f\x4e\x45\x45\x44\x53\x5f\x50\x52\x41\x47\x4d\x41\x0a\x20\x20\x23\x70\x72\x61\x67\x6d\x61\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x5f\x50\x52\x41\x47\x4d\x41\x5f\x41\x52\x47\x53\x28\x6d\x79\x5f\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x29\x0a\x20\x20\x23\x65\x6e\x64\x69\x66\x0a\x20\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x28\x6d\x79\x5f\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x29\x0a\x20\x20\x73\x74\x61\x74\x69\x63\x20\x76\x6f\x69\x64\x20\x6d\x79\x5f\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x28\x76\x6f\x69\x64\x29\x20\x7b\x0a\x20\x20\x20\x2e\x2e\x2e\x0a\x20\x20\x7d\x0a\x0a\x2a\x2f\x0a\x0a\x23\x69\x66\x6e\x64\x65\x66\x20\x5f\x5f\x47\x54\x4b\x5f\x44\x4f\x43\x5f\x49\x47\x4e\x4f\x52\x45\x5f\x5f\x0a\x0a\x23\x69\x66\x20\x20\x5f\x5f\x47\x4e\x55\x43\x5f\x5f\x20\x3e\x20\x32\x20\x7c\x7c\x20\x28\x5f\x5f\x47\x4e\x55\x43\x5f\x5f\x20\x3d\x3d\x20\x32\x20\x26\x26\x20\x5f\x5f\x47\x4e\x55\x43\x5f\x4d\x49\x4e\x4f\x52\x5f\x5f\x20\x3e\x3d\x20\x37\x29\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x48\x41\x53\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x53\x20\x31\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x28\x5f\x66\x75\x6e\x63\x29\x20\x73\x74\x61\x74\x69\x63\x20\x76\x6f\x69\x64\x20\x5f\x5f\x61\x74\x74\x72\x69\x62\x75\x74\x65\x5f\x5f\x28\x28\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x29\x29\x20\x5f\x66\x75\x6e\x63\x20\x28\x76\x6f\x69\x64\x29\x3b\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x44\x45\x53\x54\x52\x55\x43\x54\x4f\x52\x28\x5f\x66\x75\x6e\x63\x29\x20\x73\x74\x61\x74\x69\x63\x20\x76\x6f\x69\x64\x20\x5f\x5f\x61\x74\x74\x72\x69\x62\x75\x74\x65\x5f\x5f\x28\x28\x64\x65\x73\x74\x72\x75\x63\x74\x6f\x72\x29\x29\x20\x5f\x66\x75\x6e\x63\x20\x28\x76\x6f\x69\x64\x29\x3b\x0a\x0a\x23\x65\x6c\x69\x66\x20\x64\x65\x66\x69\x6e\x65\x64\x20\x28\x5f\x4d\x53\x43\x5f\x56\x45\x52\x29\x20\x26\x26\x20\x28\x5f\x4d\x53\x43\x5f\x56\x45\x52\x20\x3e\x3d\x20\x31\x35\x30\x30\x29\x0a\x2f\x2a\x20\x56\x69\x73\x75\x61\x6c\x20\x73\x74\x75\x64\x69\x6f\x20\x32\x30\x30\x38\x20\x61\x6e\x64\x20\x6c\x61\x74\x65\x72\x20\x68\x61\x73\x20\x5f\x50\x72\x61\x67\x6d\x61\x20\x2a\x2f\x0a\x0a\x23\x69\x6e\x63\x6c\x75\x64\x65\x20\x3c\x73\x74\x64\x6c\x69\x62\x2e\x68\x3e\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x48\x41\x53\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x53\x20\x31\x0a\x0a\x2f\x2a\x20\x57\x65\x20\x64\x6f\x20\x73\x6f\x6d\x65\x20\x77\x65\x69\x72\x64\x20\x74\x68\x69\x6e\x67\x73\x20\x74\x6f\x20\x61\x76\x6f\x69\x64\x20\x74\x68\x65\x20\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x73\x20\x62\x65\x69\x6e\x67\x20\x6f\x70\x74\x69\x6d\x69\x7a\x65\x64\x0a\x20\x2a\x20\x61\x77\x61\x79\x20\x6f\x6e\x20\x56\x53\x32\x30\x31\x35\x20\x69\x66\x20\x57\x68\x6f\x6c\x65\x50\x72\x6f\x67\x72\x61\x6d\x4f\x70\x74\x69\x6d\x69\x7a\x61\x74\x69\x6f\x6e\x20\x69\x73\x20\x65\x6e\x61\x62\x6c\x65\x64\x2e\x20\x46\x69\x72\x73\x74\x20\x77\x65\x0a\x20\x2a\x20\x6d\x61\x6b\x65\x20\x61\x20\x72\x65\x66\x65\x72\x65\x6e\x63\x65\x20\x74\x6f\x20\x74\x68\x65\x20\x61\x72\x72\x61\x79\x20\x66\x72\x6f\x6d\x20\x74\x68\x65\x20\x77\x72\x61\x70\x70\x65\x72\x20\x74\x6f\x20\x6d\x61\x6b\x65\x20\x73\x75\x72\x65\x20\x69\x74\x73\x0a\x20\x2a\x20\x72\x65\x66\x65\x72\x65\x6e\x63\x65\x73\x2e\x20\x54\x68\x65\x6e\x20\x77\x65\x20\x75\x73\x65\x20\x61\x20\x70\x72\x61\x67\x6d\x61\x20\x74\x6f\x20\x6d\x61\x6b\x65\x20\x73\x75\x72\x65\x20\x74\x68\x65\x20\x77\x72\x61\x70\x70\x65\x72\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x0a\x20\x2a\x20\x73\x79\x6d\x62\x6f\x6c\x20\x69\x73\x20\x61\x6c\x77\x61\x79\x73\x20\x69\x6e\x63\x6c\x75\x64\x65\x64\x20\x61\x74\x20\x74\x68\x65\x20\x6c\x69\x6e\x6b\x20\x73\x74\x61\x67\x65\x2e\x20\x41\x6c\x73\x6f\x2c\x20\x74\x68\x65\x20\x73\x79\x6d\x62\x6f\x6c\x73\x0a\x20\x2a\x20\x6e\x65\x65\x64\x20\x74\x6f\x20\x62\x65\x20\x65\x78\x74\x65\x72\x6e\x20\x28\x62\x75\x74\x20\x6e\x6f\x74\x20\x64\x6c\x6c\x65\x78\x70\x6f\x72\x74\x29\x2c\x20\x65\x76\x65\x6e\x20\x74\x68\x6f\x75\x67\x68\x20\x74\x68\x65\x79\x20\x61\x72\x65\x20\x6e\x6f\x74\x0a\x20\x2a\x20\x72\x65\x61\x6c\x6c\x79\x20\x75\x73\x65\x64\x20\x66\x72\x6f\x6d\x20\x61\x6e\x6f\x74\x68\x65\x72\x20\x6f\x62\x6a\x65\x63\x74\x20\x66\x69\x6c\x65\x2e\x0a\x20\x2a\x2f\x0a\x0a\x2f\x2a\x20\x57\x65\x20\x6e\x65\x65\x64\x20\x74\x6f\x20\x61\x63\x63\x6f\x75\x6e\x74\x20\x66\x6f\x72\x20\x64\x69\x66\x66\x65\x72\x65\x6e\x63\x65\x73\x20\x62\x65\x74\x77\x65\x65\x6e\x20\x74\x68\x65\x20\x6d\x61\x6e\x67\x6c\x69\x6e\x67\x20\x6f\x66\x20\x73\x79\x6d\x62\x6f\x6c\x73\x0a\x20\x2a\x20\x66\x6f\x72\x20\x78\x38\x36\x20\x61\x6e\x64\x20\x78\x36\x34\x2f\x41\x52\x4d\x2f\x41\x52\x4d\x36\x34\x20\x70\x72\x6f\x67\x72\x61\x6d\x73\x2c\x20\x61\x73\x20\x73\x79\x6d\x62\x6f\x6c\x73\x20\x6f\x6e\x20\x78\x38\x36\x20\x61\x72\x65\x20\x70\x72\x65\x66\x69\x78\x65\x64\x0a\x20\x2a\x20\x77\x69\x74\x68\x20\x61\x6e\x20\x75\x6e\x64\x65\x72\x73\x63\x6f\x72\x65\x20\x62\x75\x74\x20\x73\x79\x6d\x62\x6f\x6c\x73\x20\x6f\x6e\x20\x78\x36\x34\x2f\x41\x52\x4d\x2f\x41\x52\x4d\x36\x34\x20\x61\x72\x65\x20\x6e\x6f\x74\x2e\x0a\x20\x2a\x2f\x0a\x23\x69\x66\x64\x65\x66\x20\x5f\x4d\x5f\x49\x58\x38\x36\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x4d\x53\x56\x43\x5f\x53\x59\x4d\x42\x4f\x4c\x5f\x50\x52\x45\x46\x49\x58\x20\x22\x5f\x22\x0a\x23\x65\x6c\x73\x65\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x4d\x53\x56\x43\x5f\x53\x59\x4d\x42\x4f\x4c\x5f\x50\x52\x45\x46\x49\x58\x20\x22\x22\x0a\x23\x65\x6e\x64\x69\x66\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x28\x5f\x66\x75\x6e\x63\x29\x20\x47\x5f\x4d\x53\x56\x43\x5f\x43\x54\x4f\x52\x20\x28\x5f\x66\x75\x6e\x63\x2c\x20\x47\x5f\x4d\x53\x56\x43\x5f\x53\x59\x4d\x42\x4f\x4c\x5f\x50\x52\x45\x46\x49\x58\x29\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x44\x45\x53\x54\x52\x55\x43\x54\x4f\x52\x28\x5f\x66\x75\x6e\x63\x29\x20\x47\x5f\x4d\x53\x56\x43\x5f\x44\x54\x4f\x52\x20\x28\x5f\x66\x75\x6e\x63\x2c\x20\x47\x5f\x4d\x53\x56\x43\x5f\x53\x59\x4d\x42\x4f\x4c\x5f\x50\x52\x45\x46\x49\x58\x29\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x4d\x53\x56\x43\x5f\x43\x54\x4f\x52\x28\x5f\x66\x75\x6e\x63\x2c\x5f\x73\x79\x6d\x5f\x70\x72\x65\x66\x69\x78\x29\x20\x5c\x0a\x20\x20\x73\x74\x61\x74\x69\x63\x20\x76\x6f\x69\x64\x20\x5f\x66\x75\x6e\x63\x28\x76\x6f\x69\x64\x29\x3b\x20\x5c\x0a\x20\x20\x65\x78\x74\x65\x72\x6e\x20\x69\x6e\x74\x20\x28\x2a\x20\x5f\x61\x72\x72\x61\x79\x20\x23\x23\x20\x5f\x66\x75\x6e\x63\x29\x28\x76\x6f\x69\x64\x29\x3b\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x5c\x0a\x20\x20\x69\x6e\x74\x20\x5f\x66\x75\x6e\x63\x20\x23\x23\x20\x5f\x77\x72\x61\x70\x70\x65\x72\x28\x76\x6f\x69\x64\x29\x20\x7b\x20\x5f\x66\x75\x6e\x63\x28\x29\x3b\x20\x67\x5f\x73\x6c\x69\x73\x74\x5f\x66\x69\x6e\x64\x20\x28\x4e\x55\x4c\x4c\x2c\x20\x20\x5f\x61\x72\x72\x61\x79\x20\x23\x23\x20\x5f\x66\x75\x6e\x63\x29\x3b\x20\x72\x65\x74\x75\x72\x6e\x20\x30\x3b\x20\x7d\x20\x5c\x0a\x20\x20\x5f\x5f\x70\x72\x61\x67\x6d\x61\x28\x63\x6f\x6d\x6d\x65\x6e\x74\x28\x6c\x69\x6e\x6b\x65\x72\x2c\x22\x2f\x69\x6e\x63\x6c\x75\x64\x65\x3a\x22\x20\x5f\x73\x79\x6d\x5f\x70\x72\x65\x66\x69\x78\x20\x23\x20\x5f\x66\x75\x6e\x63\x20\x22\x5f\x77\x72\x61\x70\x70\x65\x72\x22\x29\x29\x20\x5c\x0a\x20\x20\x5f\x5f\x70\x72\x61\x67\x6d\x61\x28\x73\x65\x63\x74\x69\x6f\x6e\x28\x22\x2e\x43\x52\x54\x24\x58\x43\x55\x22\x2c\x72\x65\x61\x64\x29\x29\x20\x5c\x0a\x20\x20\x5f\x5f\x64\x65\x63\x6c\x73\x70\x65\x63\x28\x61\x6c\x6c\x6f\x63\x61\x74\x65\x28\x22\x2e\x43\x52\x54\x24\x58\x43\x55\x22\x29\x29\x20\x69\x6e\x74\x20\x28\x2a\x20\x5f\x61\x72\x72\x61\x79\x20\x23\x23\x20\x5f\x66\x75\x6e\x63\x29\x28\x76\x6f\x69\x64\x29\x20\x3d\x20\x5f\x66\x75\x6e\x63\x20\x23\x23\x20\x5f\x77\x72\x61\x70\x70\x65\x72\x3b\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x4d\x53\x56\x43\x5f\x44\x54\x4f\x52\x28\x5f\x66\x75\x6e\x63\x2c\x5f\x73\x79\x6d\x5f\x70\x72\x65\x66\x69\x78\x29\x20\x5c\x0a\x20\x20\x73\x74\x61\x74\x69\x63\x20\x76\x6f\x69\x64\x20\x5f\x66\x75\x6e\x63\x28\x76\x6f\x69\x64\x29\x3b\x20\x5c\x0a\x20\x20\x65\x78\x74\x65\x72\x6e\x20\x69\x6e\x74\x20\x28\x2a\x20\x5f\x61\x72\x72\x61\x79\x20\x23\x23\x20\x5f\x66\x75\x6e\x63\x29\x28\x76\x6f\x69\x64\x29\x3b\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x5c\x0a\x20\x20\x69\x6e\x74\x20\x5f\x66\x75\x6e\x63\x20\x23\x23\x20\x5f\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x28\x76\x6f\x69\x64\x29\x20\x7b\x20\x61\x74\x65\x78\x69\x74\x20\x28\x5f\x66\x75\x6e\x63\x29\x3b\x20\x67\x5f\x73\x6c\x69\x73\x74\x5f\x66\x69\x6e\x64\x20\x28\x4e\x55\x4c\x4c\x2c\x20\x20\x5f\x61\x72\x72\x61\x79\x20\x23\x23\x20\x5f\x66\x75\x6e\x63\x29\x3b\x20\x72\x65\x74\x75\x72\x6e\x20\x30\x3b\x20\x7d\x20\x5c\x0a\x20\x20\x20\x5f\x5f\x70\x72\x61\x67\x6d\x61\x28\x63\x6f\x6d\x6d\x65\x6e\x74\x28\x6c\x69\x6e\x6b\x65\x72\x2c\x22\x2f\x69\x6e\x63\x6c\x75\x64\x65\x3a\x22\x20\x5f\x73\x79\x6d\x5f\x70\x72\x65\x66\x69\x78\x20\x23\x20\x5f\x66\x75\x6e\x63\x20\x22\x5f\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x22\x29\x29\x20\x5c\x0a\x20\x20\x5f\x5f\x70\x72\x61\x67\x6d\x61\x28\x73\x65\x63\x74\x69\x6f\x6e\x28\x22\x2e\x43\x52\x54\x24\x58\x43\x55\x22\x2c\x72\x65\x61\x64\x29\x29\x20\x5c\x0a\x20\x20\x5f\x5f\x64\x65\x63\x6c\x73\x70\x65\x63\x28\x61\x6c\x6c\x6f\x63\x61\x74\x65\x28\x22\x2e\x43\x52\x54\x24\x58\x43\x55\x22\x29\x29\x20\x69\x6e\x74\x20\x28\x2a\x20\x5f\x61\x72\x72\x61\x79\x20\x23\x23\x20\x5f\x66\x75\x6e\x63\x29\x28\x76\x6f\x69\x64\x29\x20\x3d\x20\x5f\x66\x75\x6e\x63\x20\x23\x23\x20\x5f\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x3b\x0a\x0a\x23\x65\x6c\x69\x66\x20\x64\x65\x66\x69\x6e\x65\x64\x20\x28\x5f\x4d\x53\x43\x5f\x56\x45\x52\x29\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x48\x41\x53\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x53\x20\x31\x0a\x0a\x2f\x2a\x20\x50\x72\x65\x20\x56\x69\x73\x75\x61\x6c\x20\x73\x74\x75\x64\x69\x6f\x20\x32\x30\x30\x38\x20\x6d\x75\x73\x74\x20\x75\x73\x65\x20\x23\x70\x72\x61\x67\x6d\x61\x20\x73\x65\x63\x74\x69\x6f\x6e\x20\x2a\x2f\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x5f\x4e\x45\x45\x44\x53\x5f\x50\x52\x41\x47\x4d\x41\x20\x31\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x44\x45\x53\x54\x52\x55\x43\x54\x4f\x52\x5f\x4e\x45\x45\x44\x53\x5f\x50\x52\x41\x47\x4d\x41\x20\x31\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x5f\x50\x52\x41\x47\x4d\x41\x5f\x41\x52\x47\x53\x28\x5f\x66\x75\x6e\x63\x29\x20\x5c\x0a\x20\x20\x73\x65\x63\x74\x69\x6f\x6e\x28\x22\x2e\x43\x52\x54\x24\x58\x43\x55\x22\x2c\x72\x65\x61\x64\x29\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x28\x5f\x66\x75\x6e\x63\x29\x20\x5c\x0a\x20\x20\x73\x74\x61\x74\x69\x63\x20\x76\x6f\x69\x64\x20\x5f\x66\x75\x6e\x63\x28\x76\x6f\x69\x64\x29\x3b\x20\x5c\x0a\x20\x20\x73\x74\x61\x74\x69\x63\x20\x69\x6e\x74\x20\x5f\x66\x75\x6e\x63\x20\x23\x23\x20\x5f\x77\x72\x61\x70\x70\x65\x72\x28\x76\x6f\x69\x64\x29\x20\x7b\x20\x5f\x66\x75\x6e\x63\x28\x29\x3b\x20\x72\x65\x74\x75\x72\x6e\x20\x30\x3b\x20\x7d\x20\x5c\x0a\x20\x20\x5f\x5f\x64\x65\x63\x6c\x73\x70\x65\x63\x28\x61\x6c\x6c\x6f\x63\x61\x74\x65\x28\x22\x2e\x43\x52\x54\x24\x58\x43\x55\x22\x29\x29\x20\x73\x74\x61\x74\x69\x63\x20\x69\x6e\x74\x20\x28\x2a\x70\x29\x28\x76\x6f\x69\x64\x29\x20\x3d\x20\x5f\x66\x75\x6e\x63\x20\x23\x23\x20\x5f\x77\x72\x61\x70\x70\x65\x72\x3b\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x44\x45\x53\x54\x52\x55\x43\x54\x4f\x52\x5f\x50\x52\x41\x47\x4d\x41\x5f\x41\x52\x47\x53\x28\x5f\x66\x75\x6e\x63\x29\x20\x5c\x0a\x20\x20\x73\x65\x63\x74\x69\x6f\x6e\x28\x22\x2e\x43\x52\x54\x24\x58\x43\x55\x22\x2c\x72\x65\x61\x64\x29\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x44\x45\x53\x54\x52\x55\x43\x54\x4f\x52\x28\x5f\x66\x75\x6e\x63\x29\x20\x5c\x0a\x20\x20\x73\x74\x61\x74\x69\x63\x20\x76\x6f\x69\x64\x20\x5f\x66\x75\x6e\x63\x28\x76\x6f\x69\x64\x29\x3b\x20\x5c\x0a\x20\x20\x73\x74\x61\x74\x69\x63\x20\x69\x6e\x74\x20\x5f\x66\x75\x6e\x63\x20\x23\x23\x20\x5f\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x28\x76\x6f\x69\x64\x29\x20\x7b\x20\x61\x74\x65\x78\x69\x74\x20\x28\x5f\x66\x75\x6e\x63\x29\x3b\x20\x72\x65\x74\x75\x72\x6e\x20\x30\x3b\x20\x7d\x20\x5c\x0a\x20\x20\x5f\x5f\x64\x65\x63\x6c\x73\x70\x65\x63\x28\x61\x6c\x6c\x6f\x63\x61\x74\x65\x28\x22\x2e\x43\x52\x54\x24\x58\x43\x55\x22\x29\x29\x20\x73\x74\x61\x74\x69\x63\x20\x69\x6e\x74\x20\x28\x2a\x20\x5f\x61\x72\x72\x61\x79\x20\x23\x23\x20\x5f\x66\x75\x6e\x63\x29\x28\x76\x6f\x69\x64\x29\x20\x3d\x20\x5f\x66\x75\x6e\x63\x20\x23\x23\x20\x5f\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x3b\x0a\x0a\x23\x65\x6c\x69\x66\x20\x64\x65\x66\x69\x6e\x65\x64\x28\x5f\x5f\x53\x55\x4e\x50\x52\x4f\x5f\x43\x29\x0a\x0a\x2f\x2a\x20\x54\x68\x69\x73\x20\x69\x73\x20\x6e\x6f\x74\x20\x74\x65\x73\x74\x65\x64\x2c\x20\x62\x75\x74\x20\x69\x20\x62\x65\x6c\x69\x65\x76\x65\x20\x69\x74\x20\x73\x68\x6f\x75\x6c\x64\x20\x77\x6f\x72\x6b\x2c\x20\x62\x61\x73\x65\x64\x20\x6f\x6e\x3a\x0a\x20\x2a\x20\x68\x74\x74\x70\x3a\x2f\x2f\x6f\x70\x65\x6e\x73\x6f\x75\x72\x63\x65\x2e\x61\x70\x70\x6c\x65\x2e\x63\x6f\x6d\x2f\x73\x6f\x75\x72\x63\x65\x2f\x4f\x70\x65\x6e\x53\x53\x4c\x30\x39\x38\x2f\x4f\x70\x65\x6e\x53\x53\x4c\x30\x39\x38\x2d\x33\x35\x2f\x73\x72\x63\x2f\x66\x69\x70\x73\x2f\x66\x69\x70\x73\x5f\x70\x72\x65\x6d\x61\x69\x6e\x2e\x63\x0a\x20\x2a\x2f\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x48\x41\x53\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x53\x20\x31\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x5f\x4e\x45\x45\x44\x53\x5f\x50\x52\x41\x47\x4d\x41\x20\x31\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x44\x45\x53\x54\x52\x55\x43\x54\x4f\x52\x5f\x4e\x45\x45\x44\x53\x5f\x50\x52\x41\x47\x4d\x41\x20\x31\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x5f\x50\x52\x41\x47\x4d\x41\x5f\x41\x52\x47\x53\x28\x5f\x66\x75\x6e\x63\x29\x20\x5c\x0a\x20\x20\x69\x6e\x69\x74\x28\x5f\x66\x75\x6e\x63\x29\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x43\x4f\x4e\x53\x54\x52\x55\x43\x54\x4f\x52\x28\x5f\x66\x75\x6e\x63\x29\x20\x5c\x0a\x20\x20\x73\x74\x61\x74\x69\x63\x20\x76\x6f\x69\x64\x20\x5f\x66\x75\x6e\x63\x28\x76\x6f\x69\x64\x29\x3b\x0a\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x44\x45\x53\x54\x52\x55\x43\x54\x4f\x52\x5f\x50\x52\x41\x47\x4d\x41\x5f\x41\x52\x47\x53\x28\x5f\x66\x75\x6e\x63\x29\x20\x5c\x0a\x20\x20\x66\x69\x6e\x69\x28\x5f\x66\x75\x6e\x63\x29\x0a\x23\x64\x65\x66\x69\x6e\x65\x20\x47\x5f\x44\x45\x46\x49\x4e\x45\x5f\x44\x45\x53\x54\x52\x55\x43\x54\x4f\x52\x28\x5f\x66\x75\x6e\x63\x29\x20\x5c\x0a\x20\x20\x73\x74\x61\x74\x69\x63\x20\x76\x6f\x69\x64\x20\x5f\x66\x75\x6e\x63\x28\x76\x6f\x69\x64\x29\x3b\x0a\x0a\x23\x65\x6c\x73\x65\x0a\x0a\x2f\x2a\x20\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x73\x20\x6e\x6f\x74\x20\x73\x75\x70\x70\x6f\x72\x74\x65\x64\x20\x66\x6f\x72\x20\x74\x68\x69\x73\x20\x63\x6f\x6d\x70\x69\x6c\x65\x72\x20\x2a\x2f\x0a\x0a\x23\x65\x6e\x64\x69\x66\x0a\x0a\x23\x65\x6e\x64\x69\x66\x20\x2f\x2a\x20\x5f\x5f\x47\x54\x4b\x5f\x44\x4f\x43\x5f\x49\x47\x4e\x4f\x52\x45\x5f\x5f\x20\x2a\x2f\x0a"; +\ No newline at end of file +diff --git a/gio/gdbus-daemon-generated.c b/gio/gdbus-daemon-generated.c +new file mode 100644 +index 0000000..bbdf7ff +--- /dev/null ++++ b/gio/gdbus-daemon-generated.c +@@ -0,0 +1,4339 @@ ++/* ++ * This file is generated by gdbus-codegen, do not modify it. ++ * ++ * The license of this code is the same as for the D-Bus interface description ++ * it was derived from. Note that it links to GLib, so must comply with the ++ * LGPL linking clauses. ++ */ ++ ++#ifdef HAVE_CONFIG_H ++# include "config.h" ++#endif ++ ++#include "gdbus-daemon-generated.h" ++ ++#include ++#ifdef G_OS_UNIX ++# include ++#endif ++ ++typedef struct ++{ ++ GDBusArgInfo parent_struct; ++ gboolean use_gvariant; ++} _ExtendedGDBusArgInfo; ++ ++typedef struct ++{ ++ GDBusMethodInfo parent_struct; ++ const gchar *signal_name; ++ gboolean pass_fdlist; ++} _ExtendedGDBusMethodInfo; ++ ++typedef struct ++{ ++ GDBusSignalInfo parent_struct; ++ const gchar *signal_name; ++} _ExtendedGDBusSignalInfo; ++ ++typedef struct ++{ ++ GDBusPropertyInfo parent_struct; ++ const gchar *hyphen_name; ++ guint use_gvariant : 1; ++ guint emits_changed_signal : 1; ++} _ExtendedGDBusPropertyInfo; ++ ++typedef struct ++{ ++ GDBusInterfaceInfo parent_struct; ++ const gchar *hyphen_name; ++} _ExtendedGDBusInterfaceInfo; ++ ++typedef struct ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ guint prop_id; ++ GValue orig_value; /* the value before the change */ ++} ChangedProperty; ++ ++static void ++_changed_property_free (ChangedProperty *data) ++{ ++ g_value_unset (&data->orig_value); ++ g_free (data); ++} ++ ++static gboolean ++_g_strv_equal0 (gchar **a, gchar **b) ++{ ++ gboolean ret = FALSE; ++ guint n; ++ if (a == NULL && b == NULL) ++ { ++ ret = TRUE; ++ goto out; ++ } ++ if (a == NULL || b == NULL) ++ goto out; ++ if (g_strv_length (a) != g_strv_length (b)) ++ goto out; ++ for (n = 0; a[n] != NULL; n++) ++ if (g_strcmp0 (a[n], b[n]) != 0) ++ goto out; ++ ret = TRUE; ++out: ++ return ret; ++} ++ ++static gboolean ++_g_variant_equal0 (GVariant *a, GVariant *b) ++{ ++ gboolean ret = FALSE; ++ if (a == NULL && b == NULL) ++ { ++ ret = TRUE; ++ goto out; ++ } ++ if (a == NULL || b == NULL) ++ goto out; ++ ret = g_variant_equal (a, b); ++out: ++ return ret; ++} ++ ++G_GNUC_UNUSED static gboolean ++_g_value_equal (const GValue *a, const GValue *b) ++{ ++ gboolean ret = FALSE; ++ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); ++ switch (G_VALUE_TYPE (a)) ++ { ++ case G_TYPE_BOOLEAN: ++ ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); ++ break; ++ case G_TYPE_UCHAR: ++ ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); ++ break; ++ case G_TYPE_INT: ++ ret = (g_value_get_int (a) == g_value_get_int (b)); ++ break; ++ case G_TYPE_UINT: ++ ret = (g_value_get_uint (a) == g_value_get_uint (b)); ++ break; ++ case G_TYPE_INT64: ++ ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); ++ break; ++ case G_TYPE_UINT64: ++ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); ++ break; ++ case G_TYPE_DOUBLE: ++ { ++ /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ ++ gdouble da = g_value_get_double (a); ++ gdouble db = g_value_get_double (b); ++ ret = memcmp (&da, &db, sizeof (gdouble)) == 0; ++ } ++ break; ++ case G_TYPE_STRING: ++ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); ++ break; ++ case G_TYPE_VARIANT: ++ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); ++ break; ++ default: ++ if (G_VALUE_TYPE (a) == G_TYPE_STRV) ++ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); ++ else ++ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); ++ break; ++ } ++ return ret; ++} ++ ++/* ------------------------------------------------------------------------ ++ * Code for interface org.freedesktop.DBus ++ * ------------------------------------------------------------------------ ++ */ ++ ++/** ++ * SECTION:_GFreedesktopDBus ++ * @title: _GFreedesktopDBus ++ * @short_description: Generated C code for the org.freedesktop.DBus D-Bus interface ++ * ++ * This section contains code for working with the org.freedesktop.DBus D-Bus interface in C. ++ */ ++ ++/* ---- Introspection data for org.freedesktop.DBus ---- */ ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_hello_OUT_ARG_assigned_name = ++{ ++ { ++ -1, ++ (gchar *) "assigned_name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_hello_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_hello_OUT_ARG_assigned_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_hello = ++{ ++ { ++ -1, ++ (gchar *) "Hello", ++ NULL, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_hello_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-hello", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_request_name_IN_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_request_name_IN_ARG_flags = ++{ ++ { ++ -1, ++ (gchar *) "flags", ++ (gchar *) "u", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_request_name_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_request_name_IN_ARG_name.parent_struct, ++ &__g_freedesktop_dbus_method_info_request_name_IN_ARG_flags.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_request_name_OUT_ARG_value = ++{ ++ { ++ -1, ++ (gchar *) "value", ++ (gchar *) "u", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_request_name_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_request_name_OUT_ARG_value.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_request_name = ++{ ++ { ++ -1, ++ (gchar *) "RequestName", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_request_name_IN_ARG_pointers, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_request_name_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-request-name", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_release_name_IN_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_release_name_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_release_name_IN_ARG_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_release_name_OUT_ARG_value = ++{ ++ { ++ -1, ++ (gchar *) "value", ++ (gchar *) "u", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_release_name_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_release_name_OUT_ARG_value.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_release_name = ++{ ++ { ++ -1, ++ (gchar *) "ReleaseName", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_release_name_IN_ARG_pointers, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_release_name_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-release-name", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_start_service_by_name_IN_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_start_service_by_name_IN_ARG_flags = ++{ ++ { ++ -1, ++ (gchar *) "flags", ++ (gchar *) "u", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_start_service_by_name_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_start_service_by_name_IN_ARG_name.parent_struct, ++ &__g_freedesktop_dbus_method_info_start_service_by_name_IN_ARG_flags.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_start_service_by_name_OUT_ARG_value = ++{ ++ { ++ -1, ++ (gchar *) "value", ++ (gchar *) "u", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_start_service_by_name_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_start_service_by_name_OUT_ARG_value.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_start_service_by_name = ++{ ++ { ++ -1, ++ (gchar *) "StartServiceByName", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_start_service_by_name_IN_ARG_pointers, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_start_service_by_name_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-start-service-by-name", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_name_has_owner_IN_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_name_has_owner_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_name_has_owner_IN_ARG_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_name_has_owner_OUT_ARG_has_owner = ++{ ++ { ++ -1, ++ (gchar *) "has_owner", ++ (gchar *) "b", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_name_has_owner_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_name_has_owner_OUT_ARG_has_owner.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_name_has_owner = ++{ ++ { ++ -1, ++ (gchar *) "NameHasOwner", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_name_has_owner_IN_ARG_pointers, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_name_has_owner_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-name-has-owner", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_list_names_OUT_ARG_names = ++{ ++ { ++ -1, ++ (gchar *) "names", ++ (gchar *) "as", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_list_names_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_list_names_OUT_ARG_names.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_list_names = ++{ ++ { ++ -1, ++ (gchar *) "ListNames", ++ NULL, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_list_names_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-list-names", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_list_activatable_names_OUT_ARG_activatable_names = ++{ ++ { ++ -1, ++ (gchar *) "activatable_names", ++ (gchar *) "as", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_list_activatable_names_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_list_activatable_names_OUT_ARG_activatable_names.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_list_activatable_names = ++{ ++ { ++ -1, ++ (gchar *) "ListActivatableNames", ++ NULL, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_list_activatable_names_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-list-activatable-names", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_add_match_IN_ARG_rule = ++{ ++ { ++ -1, ++ (gchar *) "rule", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_add_match_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_add_match_IN_ARG_rule.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_add_match = ++{ ++ { ++ -1, ++ (gchar *) "AddMatch", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_add_match_IN_ARG_pointers, ++ NULL, ++ NULL ++ }, ++ "handle-add-match", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_remove_match_IN_ARG_rule = ++{ ++ { ++ -1, ++ (gchar *) "rule", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_remove_match_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_remove_match_IN_ARG_rule.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_remove_match = ++{ ++ { ++ -1, ++ (gchar *) "RemoveMatch", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_remove_match_IN_ARG_pointers, ++ NULL, ++ NULL ++ }, ++ "handle-remove-match", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_get_name_owner_IN_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_get_name_owner_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_get_name_owner_IN_ARG_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_get_name_owner_OUT_ARG_unique_name = ++{ ++ { ++ -1, ++ (gchar *) "unique_name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_get_name_owner_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_get_name_owner_OUT_ARG_unique_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_get_name_owner = ++{ ++ { ++ -1, ++ (gchar *) "GetNameOwner", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_get_name_owner_IN_ARG_pointers, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_get_name_owner_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-get-name-owner", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_list_queued_owners_IN_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_list_queued_owners_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_list_queued_owners_IN_ARG_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_list_queued_owners_OUT_ARG_queued_owners = ++{ ++ { ++ -1, ++ (gchar *) "queued_owners", ++ (gchar *) "as", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_list_queued_owners_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_list_queued_owners_OUT_ARG_queued_owners.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_list_queued_owners = ++{ ++ { ++ -1, ++ (gchar *) "ListQueuedOwners", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_list_queued_owners_IN_ARG_pointers, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_list_queued_owners_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-list-queued-owners", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_get_connection_unix_user_IN_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_get_connection_unix_user_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_get_connection_unix_user_IN_ARG_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_get_connection_unix_user_OUT_ARG_uid = ++{ ++ { ++ -1, ++ (gchar *) "uid", ++ (gchar *) "u", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_get_connection_unix_user_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_get_connection_unix_user_OUT_ARG_uid.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_get_connection_unix_user = ++{ ++ { ++ -1, ++ (gchar *) "GetConnectionUnixUser", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_get_connection_unix_user_IN_ARG_pointers, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_get_connection_unix_user_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-get-connection-unix-user", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_get_connection_unix_process_id_IN_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_get_connection_unix_process_id_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_get_connection_unix_process_id_IN_ARG_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_get_connection_unix_process_id_OUT_ARG_pid = ++{ ++ { ++ -1, ++ (gchar *) "pid", ++ (gchar *) "u", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_get_connection_unix_process_id_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_get_connection_unix_process_id_OUT_ARG_pid.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_get_connection_unix_process_id = ++{ ++ { ++ -1, ++ (gchar *) "GetConnectionUnixProcessID", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_get_connection_unix_process_id_IN_ARG_pointers, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_get_connection_unix_process_id_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-get-connection-unix-process-id", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_get_connection_selinux_security_context_IN_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_get_connection_selinux_security_context_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_get_connection_selinux_security_context_IN_ARG_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_get_connection_selinux_security_context_OUT_ARG_security_context = ++{ ++ { ++ -1, ++ (gchar *) "security_context", ++ (gchar *) "ay", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_get_connection_selinux_security_context_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_get_connection_selinux_security_context_OUT_ARG_security_context.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_get_connection_selinux_security_context = ++{ ++ { ++ -1, ++ (gchar *) "GetConnectionSELinuxSecurityContext", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_get_connection_selinux_security_context_IN_ARG_pointers, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_get_connection_selinux_security_context_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-get-connection-selinux-security-context", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_update_activation_environment_IN_ARG_environment = ++{ ++ { ++ -1, ++ (gchar *) "environment", ++ (gchar *) "a{ss}", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_update_activation_environment_IN_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_update_activation_environment_IN_ARG_environment.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_update_activation_environment = ++{ ++ { ++ -1, ++ (gchar *) "UpdateActivationEnvironment", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_update_activation_environment_IN_ARG_pointers, ++ NULL, ++ NULL ++ }, ++ "handle-update-activation-environment", ++ FALSE ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_reload_config = ++{ ++ { ++ -1, ++ (gchar *) "ReloadConfig", ++ NULL, ++ NULL, ++ NULL ++ }, ++ "handle-reload-config", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_method_info_get_id_OUT_ARG_unique_id = ++{ ++ { ++ -1, ++ (gchar *) "unique_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_method_info_get_id_OUT_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_get_id_OUT_ARG_unique_id.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo __g_freedesktop_dbus_method_info_get_id = ++{ ++ { ++ -1, ++ (gchar *) "GetId", ++ NULL, ++ (GDBusArgInfo **) &__g_freedesktop_dbus_method_info_get_id_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-get-id", ++ FALSE ++}; ++ ++static const GDBusMethodInfo * const __g_freedesktop_dbus_method_info_pointers[] = ++{ ++ &__g_freedesktop_dbus_method_info_hello.parent_struct, ++ &__g_freedesktop_dbus_method_info_request_name.parent_struct, ++ &__g_freedesktop_dbus_method_info_release_name.parent_struct, ++ &__g_freedesktop_dbus_method_info_start_service_by_name.parent_struct, ++ &__g_freedesktop_dbus_method_info_name_has_owner.parent_struct, ++ &__g_freedesktop_dbus_method_info_list_names.parent_struct, ++ &__g_freedesktop_dbus_method_info_list_activatable_names.parent_struct, ++ &__g_freedesktop_dbus_method_info_add_match.parent_struct, ++ &__g_freedesktop_dbus_method_info_remove_match.parent_struct, ++ &__g_freedesktop_dbus_method_info_get_name_owner.parent_struct, ++ &__g_freedesktop_dbus_method_info_list_queued_owners.parent_struct, ++ &__g_freedesktop_dbus_method_info_get_connection_unix_user.parent_struct, ++ &__g_freedesktop_dbus_method_info_get_connection_unix_process_id.parent_struct, ++ &__g_freedesktop_dbus_method_info_get_connection_selinux_security_context.parent_struct, ++ &__g_freedesktop_dbus_method_info_update_activation_environment.parent_struct, ++ &__g_freedesktop_dbus_method_info_reload_config.parent_struct, ++ &__g_freedesktop_dbus_method_info_get_id.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_signal_info_name_owner_changed_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_signal_info_name_owner_changed_ARG_old_owner = ++{ ++ { ++ -1, ++ (gchar *) "old_owner", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_signal_info_name_owner_changed_ARG_new_owner = ++{ ++ { ++ -1, ++ (gchar *) "new_owner", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_signal_info_name_owner_changed_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_signal_info_name_owner_changed_ARG_name.parent_struct, ++ &__g_freedesktop_dbus_signal_info_name_owner_changed_ARG_old_owner.parent_struct, ++ &__g_freedesktop_dbus_signal_info_name_owner_changed_ARG_new_owner.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusSignalInfo __g_freedesktop_dbus_signal_info_name_owner_changed = ++{ ++ { ++ -1, ++ (gchar *) "NameOwnerChanged", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_signal_info_name_owner_changed_ARG_pointers, ++ NULL ++ }, ++ "name-owner-changed" ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_signal_info_name_lost_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_signal_info_name_lost_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_signal_info_name_lost_ARG_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusSignalInfo __g_freedesktop_dbus_signal_info_name_lost = ++{ ++ { ++ -1, ++ (gchar *) "NameLost", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_signal_info_name_lost_ARG_pointers, ++ NULL ++ }, ++ "name-lost" ++}; ++ ++static const _ExtendedGDBusArgInfo __g_freedesktop_dbus_signal_info_name_acquired_ARG_name = ++{ ++ { ++ -1, ++ (gchar *) "name", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const __g_freedesktop_dbus_signal_info_name_acquired_ARG_pointers[] = ++{ ++ &__g_freedesktop_dbus_signal_info_name_acquired_ARG_name.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusSignalInfo __g_freedesktop_dbus_signal_info_name_acquired = ++{ ++ { ++ -1, ++ (gchar *) "NameAcquired", ++ (GDBusArgInfo **) &__g_freedesktop_dbus_signal_info_name_acquired_ARG_pointers, ++ NULL ++ }, ++ "name-acquired" ++}; ++ ++static const GDBusSignalInfo * const __g_freedesktop_dbus_signal_info_pointers[] = ++{ ++ &__g_freedesktop_dbus_signal_info_name_owner_changed.parent_struct, ++ &__g_freedesktop_dbus_signal_info_name_lost.parent_struct, ++ &__g_freedesktop_dbus_signal_info_name_acquired.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusInterfaceInfo __g_freedesktop_dbus_interface_info = ++{ ++ { ++ -1, ++ (gchar *) "org.freedesktop.DBus", ++ (GDBusMethodInfo **) &__g_freedesktop_dbus_method_info_pointers, ++ (GDBusSignalInfo **) &__g_freedesktop_dbus_signal_info_pointers, ++ NULL, ++ NULL ++ }, ++ "freedesktop-dbus", ++}; ++ ++ ++/** ++ * _g_freedesktop_dbus_interface_info: ++ * ++ * Gets a machine-readable description of the org.freedesktop.DBus D-Bus interface. ++ * ++ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. ++ */ ++GDBusInterfaceInfo * ++_g_freedesktop_dbus_interface_info (void) ++{ ++ return (GDBusInterfaceInfo *) &__g_freedesktop_dbus_interface_info.parent_struct; ++} ++ ++/** ++ * _g_freedesktop_dbus_override_properties: ++ * @klass: The class structure for a #GObject derived class. ++ * @property_id_begin: The property id to assign to the first overridden property. ++ * ++ * Overrides all #GObject properties in the #_GFreedesktopDBus interface for a concrete class. ++ * The properties are overridden in the order they are defined. ++ * ++ * Returns: The last property id. ++ */ ++guint ++_g_freedesktop_dbus_override_properties (GObjectClass *klass G_GNUC_UNUSED, guint property_id_begin) ++{ ++ return property_id_begin - 1; ++} ++ ++ ++ ++/** ++ * _GFreedesktopDBus: ++ * ++ * Abstract interface type for the D-Bus interface org.freedesktop.DBus. ++ */ ++ ++/** ++ * _GFreedesktopDBusIface: ++ * @parent_iface: The parent interface. ++ * @handle_add_match: Handler for the #_GFreedesktopDBus::handle-add-match signal. ++ * @handle_get_connection_selinux_security_context: Handler for the #_GFreedesktopDBus::handle-get-connection-selinux-security-context signal. ++ * @handle_get_connection_unix_process_id: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-process-id signal. ++ * @handle_get_connection_unix_user: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-user signal. ++ * @handle_get_id: Handler for the #_GFreedesktopDBus::handle-get-id signal. ++ * @handle_get_name_owner: Handler for the #_GFreedesktopDBus::handle-get-name-owner signal. ++ * @handle_hello: Handler for the #_GFreedesktopDBus::handle-hello signal. ++ * @handle_list_activatable_names: Handler for the #_GFreedesktopDBus::handle-list-activatable-names signal. ++ * @handle_list_names: Handler for the #_GFreedesktopDBus::handle-list-names signal. ++ * @handle_list_queued_owners: Handler for the #_GFreedesktopDBus::handle-list-queued-owners signal. ++ * @handle_name_has_owner: Handler for the #_GFreedesktopDBus::handle-name-has-owner signal. ++ * @handle_release_name: Handler for the #_GFreedesktopDBus::handle-release-name signal. ++ * @handle_reload_config: Handler for the #_GFreedesktopDBus::handle-reload-config signal. ++ * @handle_remove_match: Handler for the #_GFreedesktopDBus::handle-remove-match signal. ++ * @handle_request_name: Handler for the #_GFreedesktopDBus::handle-request-name signal. ++ * @handle_start_service_by_name: Handler for the #_GFreedesktopDBus::handle-start-service-by-name signal. ++ * @handle_update_activation_environment: Handler for the #_GFreedesktopDBus::handle-update-activation-environment signal. ++ * @name_acquired: Handler for the #_GFreedesktopDBus::name-acquired signal. ++ * @name_lost: Handler for the #_GFreedesktopDBus::name-lost signal. ++ * @name_owner_changed: Handler for the #_GFreedesktopDBus::name-owner-changed signal. ++ * ++ * Virtual table for the D-Bus interface org.freedesktop.DBus. ++ */ ++ ++typedef _GFreedesktopDBusIface _GFreedesktopDBusInterface; ++G_DEFINE_INTERFACE (_GFreedesktopDBus, _g_freedesktop_dbus, G_TYPE_OBJECT) ++ ++static void ++_g_freedesktop_dbus_default_init (_GFreedesktopDBusIface *iface) ++{ ++ /* GObject signals for incoming D-Bus method calls: */ ++ /** ++ * _GFreedesktopDBus::handle-hello: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * ++ * Signal emitted when a remote caller is invoking the Hello() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_hello() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-hello", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_hello), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 1, ++ G_TYPE_DBUS_METHOD_INVOCATION); ++ ++ /** ++ * _GFreedesktopDBus::handle-request-name: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_name: Argument passed by remote caller. ++ * @arg_flags: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the RequestName() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_request_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-request-name", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_request_name), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 3, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_UINT); ++ ++ /** ++ * _GFreedesktopDBus::handle-release-name: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_name: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the ReleaseName() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_release_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-release-name", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_release_name), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::handle-start-service-by-name: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_name: Argument passed by remote caller. ++ * @arg_flags: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the StartServiceByName() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_start_service_by_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-start-service-by-name", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_start_service_by_name), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 3, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_UINT); ++ ++ /** ++ * _GFreedesktopDBus::handle-name-has-owner: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_name: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the NameHasOwner() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_name_has_owner() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-name-has-owner", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_name_has_owner), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::handle-list-names: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * ++ * Signal emitted when a remote caller is invoking the ListNames() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_names() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-list-names", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_list_names), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 1, ++ G_TYPE_DBUS_METHOD_INVOCATION); ++ ++ /** ++ * _GFreedesktopDBus::handle-list-activatable-names: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * ++ * Signal emitted when a remote caller is invoking the ListActivatableNames() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_activatable_names() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-list-activatable-names", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_list_activatable_names), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 1, ++ G_TYPE_DBUS_METHOD_INVOCATION); ++ ++ /** ++ * _GFreedesktopDBus::handle-add-match: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_rule: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the AddMatch() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_add_match() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-add-match", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_add_match), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::handle-remove-match: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_rule: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the RemoveMatch() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_remove_match() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-remove-match", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_remove_match), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::handle-get-name-owner: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_name: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the GetNameOwner() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_name_owner() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-get-name-owner", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_get_name_owner), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::handle-list-queued-owners: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_name: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the ListQueuedOwners() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_queued_owners() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-list-queued-owners", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_list_queued_owners), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::handle-get-connection-unix-user: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_name: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the GetConnectionUnixUser() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_unix_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-get-connection-unix-user", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_get_connection_unix_user), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::handle-get-connection-unix-process-id: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_name: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the GetConnectionUnixProcessID() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_unix_process_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-get-connection-unix-process-id", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_get_connection_unix_process_id), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::handle-get-connection-selinux-security-context: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_name: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the GetConnectionSELinuxSecurityContext() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_selinux_security_context() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-get-connection-selinux-security-context", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_get_connection_selinux_security_context), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::handle-update-activation-environment: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_environment: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the UpdateActivationEnvironment() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_update_activation_environment() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-update-activation-environment", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_update_activation_environment), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); ++ ++ /** ++ * _GFreedesktopDBus::handle-reload-config: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * ++ * Signal emitted when a remote caller is invoking the ReloadConfig() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_reload_config() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-reload-config", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_reload_config), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 1, ++ G_TYPE_DBUS_METHOD_INVOCATION); ++ ++ /** ++ * _GFreedesktopDBus::handle-get-id: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: A #GDBusMethodInvocation. ++ * ++ * Signal emitted when a remote caller is invoking the GetId() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-get-id", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, handle_get_id), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 1, ++ G_TYPE_DBUS_METHOD_INVOCATION); ++ ++ /* GObject signals for received D-Bus signals: */ ++ /** ++ * _GFreedesktopDBus::name-owner-changed: ++ * @object: A #_GFreedesktopDBus. ++ * @arg_name: Argument. ++ * @arg_old_owner: Argument. ++ * @arg_new_owner: Argument. ++ * ++ * On the client-side, this signal is emitted whenever the D-Bus signal "NameOwnerChanged" is received. ++ * ++ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. ++ */ ++ g_signal_new ("name-owner-changed", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, name_owner_changed), ++ NULL, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_NONE, ++ 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::name-lost: ++ * @object: A #_GFreedesktopDBus. ++ * @arg_name: Argument. ++ * ++ * On the client-side, this signal is emitted whenever the D-Bus signal "NameLost" is received. ++ * ++ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. ++ */ ++ g_signal_new ("name-lost", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, name_lost), ++ NULL, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_NONE, ++ 1, G_TYPE_STRING); ++ ++ /** ++ * _GFreedesktopDBus::name-acquired: ++ * @object: A #_GFreedesktopDBus. ++ * @arg_name: Argument. ++ * ++ * On the client-side, this signal is emitted whenever the D-Bus signal "NameAcquired" is received. ++ * ++ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. ++ */ ++ g_signal_new ("name-acquired", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (_GFreedesktopDBusIface, name_acquired), ++ NULL, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_NONE, ++ 1, G_TYPE_STRING); ++ ++} ++ ++/** ++ * _g_freedesktop_dbus_emit_name_owner_changed: ++ * @object: A #_GFreedesktopDBus. ++ * @arg_name: Argument to pass with the signal. ++ * @arg_old_owner: Argument to pass with the signal. ++ * @arg_new_owner: Argument to pass with the signal. ++ * ++ * Emits the "NameOwnerChanged" D-Bus signal. ++ */ ++void ++_g_freedesktop_dbus_emit_name_owner_changed ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name, ++ const gchar *arg_old_owner, ++ const gchar *arg_new_owner) ++{ ++ g_signal_emit_by_name (object, "name-owner-changed", arg_name, arg_old_owner, arg_new_owner); ++} ++ ++/** ++ * _g_freedesktop_dbus_emit_name_lost: ++ * @object: A #_GFreedesktopDBus. ++ * @arg_name: Argument to pass with the signal. ++ * ++ * Emits the "NameLost" D-Bus signal. ++ */ ++void ++_g_freedesktop_dbus_emit_name_lost ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name) ++{ ++ g_signal_emit_by_name (object, "name-lost", arg_name); ++} ++ ++/** ++ * _g_freedesktop_dbus_emit_name_acquired: ++ * @object: A #_GFreedesktopDBus. ++ * @arg_name: Argument to pass with the signal. ++ * ++ * Emits the "NameAcquired" D-Bus signal. ++ */ ++void ++_g_freedesktop_dbus_emit_name_acquired ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name) ++{ ++ g_signal_emit_by_name (object, "name-acquired", arg_name); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_hello: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the Hello() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_hello_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_hello ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "Hello", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_hello_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_assigned_name: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_hello(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_hello(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_hello_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_assigned_name, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_assigned_name); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_hello_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_assigned_name: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the Hello() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_hello() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_hello_sync ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_assigned_name, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "Hello", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_assigned_name); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_request_name: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @arg_flags: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the RequestName() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_request_name_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_request_name_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_request_name ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint arg_flags, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "RequestName", ++ g_variant_new ("(su)", ++ arg_name, ++ arg_flags), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_request_name_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_value: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_request_name(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_request_name(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_request_name_finish ( ++ _GFreedesktopDBus *proxy, ++ guint *out_value, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_value); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_request_name_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @arg_flags: Argument to pass with the method invocation. ++ * @out_value: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the RequestName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_request_name() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_request_name_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint arg_flags, ++ guint *out_value, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "RequestName", ++ g_variant_new ("(su)", ++ arg_name, ++ arg_flags), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_value); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_release_name: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the ReleaseName() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_release_name_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_release_name_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_release_name ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "ReleaseName", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_release_name_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_value: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_release_name(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_release_name(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_release_name_finish ( ++ _GFreedesktopDBus *proxy, ++ guint *out_value, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_value); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_release_name_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @out_value: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the ReleaseName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_release_name() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_release_name_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint *out_value, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "ReleaseName", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_value); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_start_service_by_name: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @arg_flags: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the StartServiceByName() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_start_service_by_name_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_start_service_by_name_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_start_service_by_name ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint arg_flags, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "StartServiceByName", ++ g_variant_new ("(su)", ++ arg_name, ++ arg_flags), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_start_service_by_name_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_value: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_start_service_by_name(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_start_service_by_name(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_start_service_by_name_finish ( ++ _GFreedesktopDBus *proxy, ++ guint *out_value, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_value); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_start_service_by_name_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @arg_flags: Argument to pass with the method invocation. ++ * @out_value: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the StartServiceByName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_start_service_by_name() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_start_service_by_name_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint arg_flags, ++ guint *out_value, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "StartServiceByName", ++ g_variant_new ("(su)", ++ arg_name, ++ arg_flags), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_value); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_name_has_owner: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the NameHasOwner() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_name_has_owner_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_name_has_owner_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_name_has_owner ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "NameHasOwner", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_name_has_owner_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_has_owner: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_name_has_owner(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_name_has_owner(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_name_has_owner_finish ( ++ _GFreedesktopDBus *proxy, ++ gboolean *out_has_owner, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(b)", ++ out_has_owner); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_name_has_owner_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @out_has_owner: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the NameHasOwner() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_name_has_owner() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_name_has_owner_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ gboolean *out_has_owner, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "NameHasOwner", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(b)", ++ out_has_owner); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_list_names: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the ListNames() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_list_names_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_list_names_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_list_names ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "ListNames", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_list_names_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_names: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_names(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_list_names(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_list_names_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar ***out_names, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^as)", ++ out_names); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_list_names_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_names: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the ListNames() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_list_names() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_list_names_sync ( ++ _GFreedesktopDBus *proxy, ++ gchar ***out_names, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "ListNames", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^as)", ++ out_names); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_list_activatable_names: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the ListActivatableNames() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_list_activatable_names_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_list_activatable_names_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_list_activatable_names ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "ListActivatableNames", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_list_activatable_names_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_activatable_names: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_activatable_names(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_list_activatable_names(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_list_activatable_names_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar ***out_activatable_names, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^as)", ++ out_activatable_names); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_list_activatable_names_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_activatable_names: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the ListActivatableNames() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_list_activatable_names() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_list_activatable_names_sync ( ++ _GFreedesktopDBus *proxy, ++ gchar ***out_activatable_names, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "ListActivatableNames", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^as)", ++ out_activatable_names); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_add_match: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_rule: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the AddMatch() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_add_match_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_add_match_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_add_match ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_rule, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "AddMatch", ++ g_variant_new ("(s)", ++ arg_rule), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_add_match_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_add_match(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_add_match(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_add_match_finish ( ++ _GFreedesktopDBus *proxy, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_add_match_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_rule: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the AddMatch() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_add_match() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_add_match_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_rule, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "AddMatch", ++ g_variant_new ("(s)", ++ arg_rule), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_remove_match: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_rule: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the RemoveMatch() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_remove_match_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_remove_match_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_remove_match ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_rule, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "RemoveMatch", ++ g_variant_new ("(s)", ++ arg_rule), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_remove_match_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_remove_match(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_remove_match(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_remove_match_finish ( ++ _GFreedesktopDBus *proxy, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_remove_match_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_rule: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the RemoveMatch() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_remove_match() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_remove_match_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_rule, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "RemoveMatch", ++ g_variant_new ("(s)", ++ arg_rule), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_name_owner: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the GetNameOwner() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_get_name_owner_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_get_name_owner_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_get_name_owner ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "GetNameOwner", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_name_owner_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_unique_name: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_name_owner(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_get_name_owner(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_get_name_owner_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_unique_name, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_unique_name); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_name_owner_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @out_unique_name: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the GetNameOwner() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_get_name_owner() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_get_name_owner_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ gchar **out_unique_name, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "GetNameOwner", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_unique_name); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_list_queued_owners: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the ListQueuedOwners() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_list_queued_owners_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_list_queued_owners_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_list_queued_owners ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "ListQueuedOwners", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_list_queued_owners_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_queued_owners: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_queued_owners(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_list_queued_owners(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_list_queued_owners_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar ***out_queued_owners, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^as)", ++ out_queued_owners); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_list_queued_owners_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @out_queued_owners: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the ListQueuedOwners() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_list_queued_owners() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_list_queued_owners_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ gchar ***out_queued_owners, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "ListQueuedOwners", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^as)", ++ out_queued_owners); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_connection_unix_user: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the GetConnectionUnixUser() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_get_connection_unix_user_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_get_connection_unix_user_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_get_connection_unix_user ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "GetConnectionUnixUser", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_connection_unix_user_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_uid: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_user(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_user(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_get_connection_unix_user_finish ( ++ _GFreedesktopDBus *proxy, ++ guint *out_uid, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_uid); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_connection_unix_user_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @out_uid: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the GetConnectionUnixUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_get_connection_unix_user() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_get_connection_unix_user_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint *out_uid, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "GetConnectionUnixUser", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_uid); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_connection_unix_process_id: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the GetConnectionUnixProcessID() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_get_connection_unix_process_id_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_get_connection_unix_process_id_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_get_connection_unix_process_id ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "GetConnectionUnixProcessID", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_connection_unix_process_id_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_pid: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_process_id(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_process_id(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_get_connection_unix_process_id_finish ( ++ _GFreedesktopDBus *proxy, ++ guint *out_pid, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_pid); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_connection_unix_process_id_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @out_pid: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the GetConnectionUnixProcessID() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_get_connection_unix_process_id() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_get_connection_unix_process_id_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint *out_pid, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "GetConnectionUnixProcessID", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_pid); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_connection_selinux_security_context: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the GetConnectionSELinuxSecurityContext() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_get_connection_selinux_security_context ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "GetConnectionSELinuxSecurityContext", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_security_context: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_selinux_security_context(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_selinux_security_context(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_get_connection_selinux_security_context_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_security_context, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^ay)", ++ out_security_context); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_name: Argument to pass with the method invocation. ++ * @out_security_context: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the GetConnectionSELinuxSecurityContext() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_get_connection_selinux_security_context() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_get_connection_selinux_security_context_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ gchar **out_security_context, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "GetConnectionSELinuxSecurityContext", ++ g_variant_new ("(s)", ++ arg_name), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^ay)", ++ out_security_context); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_update_activation_environment: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_environment: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the UpdateActivationEnvironment() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_update_activation_environment_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_update_activation_environment_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_update_activation_environment ( ++ _GFreedesktopDBus *proxy, ++ GVariant *arg_environment, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "UpdateActivationEnvironment", ++ g_variant_new ("(@a{ss})", ++ arg_environment), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_update_activation_environment_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_update_activation_environment(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_update_activation_environment(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_update_activation_environment_finish ( ++ _GFreedesktopDBus *proxy, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_update_activation_environment_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @arg_environment: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the UpdateActivationEnvironment() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_update_activation_environment() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_update_activation_environment_sync ( ++ _GFreedesktopDBus *proxy, ++ GVariant *arg_environment, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "UpdateActivationEnvironment", ++ g_variant_new ("(@a{ss})", ++ arg_environment), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_reload_config: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the ReloadConfig() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_reload_config_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_reload_config_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_reload_config ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "ReloadConfig", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_reload_config_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_reload_config(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_reload_config(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_reload_config_finish ( ++ _GFreedesktopDBus *proxy, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_reload_config_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the ReloadConfig() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_reload_config() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_reload_config_sync ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "ReloadConfig", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_id: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the GetId() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_call_get_id_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_call_get_id_sync() for the synchronous, blocking version of this method. ++ */ ++void ++_g_freedesktop_dbus_call_get_id ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "GetId", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_id_finish: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_unique_id: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_id(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_call_get_id(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_get_id_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_unique_id, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_unique_id); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_call_get_id_sync: ++ * @proxy: A #_GFreedesktopDBusProxy. ++ * @out_unique_id: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the GetId() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_call_get_id() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++_g_freedesktop_dbus_call_get_id_sync ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_unique_id, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "GetId", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_unique_id); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_hello: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @assigned_name: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the Hello() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_hello ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *assigned_name) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(s)", ++ assigned_name)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_request_name: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @value: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the RequestName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_request_name ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ guint value) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(u)", ++ value)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_release_name: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @value: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the ReleaseName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_release_name ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ guint value) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(u)", ++ value)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_start_service_by_name: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @value: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the StartServiceByName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_start_service_by_name ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ guint value) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(u)", ++ value)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_name_has_owner: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @has_owner: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the NameHasOwner() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_name_has_owner ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ gboolean has_owner) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(b)", ++ has_owner)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_list_names: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @names: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the ListNames() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_list_names ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *const *names) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(^as)", ++ names)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_list_activatable_names: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @activatable_names: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the ListActivatableNames() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_list_activatable_names ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *const *activatable_names) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(^as)", ++ activatable_names)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_add_match: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * ++ * Helper function used in service implementations to finish handling invocations of the AddMatch() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_add_match ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("()")); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_remove_match: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * ++ * Helper function used in service implementations to finish handling invocations of the RemoveMatch() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_remove_match ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("()")); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_get_name_owner: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @unique_name: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the GetNameOwner() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_get_name_owner ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *unique_name) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(s)", ++ unique_name)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_list_queued_owners: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @queued_owners: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the ListQueuedOwners() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_list_queued_owners ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *const *queued_owners) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(^as)", ++ queued_owners)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_get_connection_unix_user: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @uid: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the GetConnectionUnixUser() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_get_connection_unix_user ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ guint uid) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(u)", ++ uid)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_get_connection_unix_process_id: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @pid: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the GetConnectionUnixProcessID() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_get_connection_unix_process_id ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ guint pid) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(u)", ++ pid)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_get_connection_selinux_security_context: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @security_context: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the GetConnectionSELinuxSecurityContext() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_get_connection_selinux_security_context ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *security_context) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(^ay)", ++ security_context)); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_update_activation_environment: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * ++ * Helper function used in service implementations to finish handling invocations of the UpdateActivationEnvironment() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_update_activation_environment ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("()")); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_reload_config: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * ++ * Helper function used in service implementations to finish handling invocations of the ReloadConfig() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_reload_config ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("()")); ++} ++ ++/** ++ * _g_freedesktop_dbus_complete_get_id: ++ * @object: A #_GFreedesktopDBus. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @unique_id: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the GetId() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++_g_freedesktop_dbus_complete_get_id ( ++ _GFreedesktopDBus *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *unique_id) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(s)", ++ unique_id)); ++} ++ ++/* ------------------------------------------------------------------------ */ ++ ++/** ++ * _GFreedesktopDBusProxy: ++ * ++ * The #_GFreedesktopDBusProxy structure contains only private data and should only be accessed using the provided API. ++ */ ++ ++/** ++ * _GFreedesktopDBusProxyClass: ++ * @parent_class: The parent class. ++ * ++ * Class structure for #_GFreedesktopDBusProxy. ++ */ ++ ++struct __GFreedesktopDBusProxyPrivate ++{ ++ GData *qdata; ++}; ++ ++static void _g_freedesktop_dbus_proxy_iface_init (_GFreedesktopDBusIface *iface); ++ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++G_DEFINE_TYPE_WITH_CODE (_GFreedesktopDBusProxy, _g_freedesktop_dbus_proxy, G_TYPE_DBUS_PROXY, ++ G_ADD_PRIVATE (_GFreedesktopDBusProxy) ++ G_IMPLEMENT_INTERFACE (_G_TYPE_FREEDESKTOP_DBUS, _g_freedesktop_dbus_proxy_iface_init)) ++ ++#else ++G_DEFINE_TYPE_WITH_CODE (_GFreedesktopDBusProxy, _g_freedesktop_dbus_proxy, G_TYPE_DBUS_PROXY, ++ G_IMPLEMENT_INTERFACE (_G_TYPE_FREEDESKTOP_DBUS, _g_freedesktop_dbus_proxy_iface_init)) ++ ++#endif ++static void ++_g_freedesktop_dbus_proxy_finalize (GObject *object) ++{ ++ _GFreedesktopDBusProxy *proxy = _G_FREEDESKTOP_DBUS_PROXY (object); ++ g_datalist_clear (&proxy->priv->qdata); ++ G_OBJECT_CLASS (_g_freedesktop_dbus_proxy_parent_class)->finalize (object); ++} ++ ++static void ++_g_freedesktop_dbus_proxy_get_property (GObject *object G_GNUC_UNUSED, ++ guint prop_id G_GNUC_UNUSED, ++ GValue *value G_GNUC_UNUSED, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++} ++ ++static void ++_g_freedesktop_dbus_proxy_set_property (GObject *object G_GNUC_UNUSED, ++ guint prop_id G_GNUC_UNUSED, ++ const GValue *value G_GNUC_UNUSED, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++} ++ ++static void ++_g_freedesktop_dbus_proxy_g_signal (GDBusProxy *proxy, ++ const gchar *sender_name G_GNUC_UNUSED, ++ const gchar *signal_name, ++ GVariant *parameters) ++{ ++ _ExtendedGDBusSignalInfo *info; ++ GVariantIter iter; ++ GVariant *child; ++ GValue *paramv; ++ gsize num_params; ++ gsize n; ++ guint signal_id; ++ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &__g_freedesktop_dbus_interface_info.parent_struct, signal_name); ++ if (info == NULL) ++ return; ++ num_params = g_variant_n_children (parameters); ++ paramv = g_new0 (GValue, num_params + 1); ++ g_value_init (¶mv[0], _G_TYPE_FREEDESKTOP_DBUS); ++ g_value_set_object (¶mv[0], proxy); ++ g_variant_iter_init (&iter, parameters); ++ n = 1; ++ while ((child = g_variant_iter_next_value (&iter)) != NULL) ++ { ++ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; ++ if (arg_info->use_gvariant) ++ { ++ g_value_init (¶mv[n], G_TYPE_VARIANT); ++ g_value_set_variant (¶mv[n], child); ++ n++; ++ } ++ else ++ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); ++ g_variant_unref (child); ++ } ++ signal_id = g_signal_lookup (info->signal_name, _G_TYPE_FREEDESKTOP_DBUS); ++ g_signal_emitv (paramv, signal_id, 0, NULL); ++ for (n = 0; n < num_params + 1; n++) ++ g_value_unset (¶mv[n]); ++ g_free (paramv); ++} ++ ++static void ++_g_freedesktop_dbus_proxy_g_properties_changed (GDBusProxy *_proxy, ++ GVariant *changed_properties, ++ const gchar *const *invalidated_properties) ++{ ++ _GFreedesktopDBusProxy *proxy = _G_FREEDESKTOP_DBUS_PROXY (_proxy); ++ guint n; ++ const gchar *key; ++ GVariantIter *iter; ++ _ExtendedGDBusPropertyInfo *info; ++ g_variant_get (changed_properties, "a{sv}", &iter); ++ while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) ++ { ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &__g_freedesktop_dbus_interface_info.parent_struct, key); ++ g_datalist_remove_data (&proxy->priv->qdata, key); ++ if (info != NULL) ++ g_object_notify (G_OBJECT (proxy), info->hyphen_name); ++ } ++ g_variant_iter_free (iter); ++ for (n = 0; invalidated_properties[n] != NULL; n++) ++ { ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &__g_freedesktop_dbus_interface_info.parent_struct, invalidated_properties[n]); ++ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); ++ if (info != NULL) ++ g_object_notify (G_OBJECT (proxy), info->hyphen_name); ++ } ++} ++ ++static void ++_g_freedesktop_dbus_proxy_init (_GFreedesktopDBusProxy *proxy) ++{ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++ proxy->priv = _g_freedesktop_dbus_proxy_get_instance_private (proxy); ++#else ++ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, _G_TYPE_FREEDESKTOP_DBUS_PROXY, _GFreedesktopDBusProxyPrivate); ++#endif ++ ++ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), _g_freedesktop_dbus_interface_info ()); ++} ++ ++static void ++_g_freedesktop_dbus_proxy_class_init (_GFreedesktopDBusProxyClass *klass) ++{ ++ GObjectClass *gobject_class; ++ GDBusProxyClass *proxy_class; ++ ++ gobject_class = G_OBJECT_CLASS (klass); ++ gobject_class->finalize = _g_freedesktop_dbus_proxy_finalize; ++ gobject_class->get_property = _g_freedesktop_dbus_proxy_get_property; ++ gobject_class->set_property = _g_freedesktop_dbus_proxy_set_property; ++ ++ proxy_class = G_DBUS_PROXY_CLASS (klass); ++ proxy_class->g_signal = _g_freedesktop_dbus_proxy_g_signal; ++ proxy_class->g_properties_changed = _g_freedesktop_dbus_proxy_g_properties_changed; ++ ++#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 ++ g_type_class_add_private (klass, sizeof (_GFreedesktopDBusProxyPrivate)); ++#endif ++} ++ ++static void ++_g_freedesktop_dbus_proxy_iface_init (_GFreedesktopDBusIface *iface G_GNUC_UNUSED) ++{ ++} ++ ++/** ++ * _g_freedesktop_dbus_proxy_new: ++ * @connection: A #GDBusConnection. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously creates a proxy for the D-Bus interface org.freedesktop.DBus. See g_dbus_proxy_new() for more details. ++ * ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_proxy_new_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor. ++ */ ++void ++_g_freedesktop_dbus_proxy_new ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_async_initable_new_async (_G_TYPE_FREEDESKTOP_DBUS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus", NULL); ++} ++ ++/** ++ * _g_freedesktop_dbus_proxy_new_finish: ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new(). ++ * @error: Return location for error or %NULL ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_proxy_new(). ++ * ++ * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++_GFreedesktopDBus * ++_g_freedesktop_dbus_proxy_new_finish ( ++ GAsyncResult *res, ++ GError **error) ++{ ++ GObject *ret; ++ GObject *source_object; ++ source_object = g_async_result_get_source_object (res); ++ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); ++ g_object_unref (source_object); ++ if (ret != NULL) ++ return _G_FREEDESKTOP_DBUS (ret); ++ else ++ return NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_proxy_new_sync: ++ * @connection: A #GDBusConnection. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL ++ * ++ * Synchronously creates a proxy for the D-Bus interface org.freedesktop.DBus. See g_dbus_proxy_new_sync() for more details. ++ * ++ * The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_proxy_new() for the asynchronous version of this constructor. ++ * ++ * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++_GFreedesktopDBus * ++_g_freedesktop_dbus_proxy_new_sync ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GInitable *ret; ++ ret = g_initable_new (_G_TYPE_FREEDESKTOP_DBUS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus", NULL); ++ if (ret != NULL) ++ return _G_FREEDESKTOP_DBUS (ret); ++ else ++ return NULL; ++} ++ ++ ++/** ++ * _g_freedesktop_dbus_proxy_new_for_bus: ++ * @bus_type: A #GBusType. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: A bus name (well-known or unique). ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied. ++ * @user_data: User data to pass to @callback. ++ * ++ * Like _g_freedesktop_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection. ++ * ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call _g_freedesktop_dbus_proxy_new_for_bus_finish() to get the result of the operation. ++ * ++ * See _g_freedesktop_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. ++ */ ++void ++_g_freedesktop_dbus_proxy_new_for_bus ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_async_initable_new_async (_G_TYPE_FREEDESKTOP_DBUS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus", NULL); ++} ++ ++/** ++ * _g_freedesktop_dbus_proxy_new_for_bus_finish: ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new_for_bus(). ++ * @error: Return location for error or %NULL ++ * ++ * Finishes an operation started with _g_freedesktop_dbus_proxy_new_for_bus(). ++ * ++ * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++_GFreedesktopDBus * ++_g_freedesktop_dbus_proxy_new_for_bus_finish ( ++ GAsyncResult *res, ++ GError **error) ++{ ++ GObject *ret; ++ GObject *source_object; ++ source_object = g_async_result_get_source_object (res); ++ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); ++ g_object_unref (source_object); ++ if (ret != NULL) ++ return _G_FREEDESKTOP_DBUS (ret); ++ else ++ return NULL; ++} ++ ++/** ++ * _g_freedesktop_dbus_proxy_new_for_bus_sync: ++ * @bus_type: A #GBusType. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: A bus name (well-known or unique). ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL ++ * ++ * Like _g_freedesktop_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. ++ * ++ * The calling thread is blocked until a reply is received. ++ * ++ * See _g_freedesktop_dbus_proxy_new_for_bus() for the asynchronous version of this constructor. ++ * ++ * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++_GFreedesktopDBus * ++_g_freedesktop_dbus_proxy_new_for_bus_sync ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GInitable *ret; ++ ret = g_initable_new (_G_TYPE_FREEDESKTOP_DBUS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus", NULL); ++ if (ret != NULL) ++ return _G_FREEDESKTOP_DBUS (ret); ++ else ++ return NULL; ++} ++ ++ ++/* ------------------------------------------------------------------------ */ ++ ++/** ++ * _GFreedesktopDBusSkeleton: ++ * ++ * The #_GFreedesktopDBusSkeleton structure contains only private data and should only be accessed using the provided API. ++ */ ++ ++/** ++ * _GFreedesktopDBusSkeletonClass: ++ * @parent_class: The parent class. ++ * ++ * Class structure for #_GFreedesktopDBusSkeleton. ++ */ ++ ++struct __GFreedesktopDBusSkeletonPrivate ++{ ++ GValue *properties; ++ GList *changed_properties; ++ GSource *changed_properties_idle_source; ++ GMainContext *context; ++ GMutex lock; ++}; ++ ++static void ++__g_freedesktop_dbus_skeleton_handle_method_call ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name, ++ const gchar *method_name, ++ GVariant *parameters, ++ GDBusMethodInvocation *invocation, ++ gpointer user_data) ++{ ++ _GFreedesktopDBusSkeleton *skeleton = _G_FREEDESKTOP_DBUS_SKELETON (user_data); ++ _ExtendedGDBusMethodInfo *info; ++ GVariantIter iter; ++ GVariant *child; ++ GValue *paramv; ++ gsize num_params; ++ guint num_extra; ++ gsize n; ++ guint signal_id; ++ GValue return_value = G_VALUE_INIT; ++ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); ++ g_assert (info != NULL); ++ num_params = g_variant_n_children (parameters); ++ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); ++ n = 0; ++ g_value_init (¶mv[n], _G_TYPE_FREEDESKTOP_DBUS); ++ g_value_set_object (¶mv[n++], skeleton); ++ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); ++ g_value_set_object (¶mv[n++], invocation); ++ if (info->pass_fdlist) ++ { ++#ifdef G_OS_UNIX ++ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); ++ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); ++#else ++ g_assert_not_reached (); ++#endif ++ } ++ g_variant_iter_init (&iter, parameters); ++ while ((child = g_variant_iter_next_value (&iter)) != NULL) ++ { ++ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; ++ if (arg_info->use_gvariant) ++ { ++ g_value_init (¶mv[n], G_TYPE_VARIANT); ++ g_value_set_variant (¶mv[n], child); ++ n++; ++ } ++ else ++ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); ++ g_variant_unref (child); ++ } ++ signal_id = g_signal_lookup (info->signal_name, _G_TYPE_FREEDESKTOP_DBUS); ++ g_value_init (&return_value, G_TYPE_BOOLEAN); ++ g_signal_emitv (paramv, signal_id, 0, &return_value); ++ if (!g_value_get_boolean (&return_value)) ++ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); ++ g_value_unset (&return_value); ++ for (n = 0; n < num_params + num_extra; n++) ++ g_value_unset (¶mv[n]); ++ g_free (paramv); ++} ++ ++static GVariant * ++__g_freedesktop_dbus_skeleton_handle_get_property ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name G_GNUC_UNUSED, ++ const gchar *property_name, ++ GError **error, ++ gpointer user_data) ++{ ++ _GFreedesktopDBusSkeleton *skeleton = _G_FREEDESKTOP_DBUS_SKELETON (user_data); ++ GValue value = G_VALUE_INIT; ++ GParamSpec *pspec; ++ _ExtendedGDBusPropertyInfo *info; ++ GVariant *ret; ++ ret = NULL; ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &__g_freedesktop_dbus_interface_info.parent_struct, property_name); ++ g_assert (info != NULL); ++ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); ++ if (pspec == NULL) ++ { ++ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); ++ } ++ else ++ { ++ g_value_init (&value, pspec->value_type); ++ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); ++ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); ++ g_value_unset (&value); ++ } ++ return ret; ++} ++ ++static gboolean ++__g_freedesktop_dbus_skeleton_handle_set_property ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name G_GNUC_UNUSED, ++ const gchar *property_name, ++ GVariant *variant, ++ GError **error, ++ gpointer user_data) ++{ ++ _GFreedesktopDBusSkeleton *skeleton = _G_FREEDESKTOP_DBUS_SKELETON (user_data); ++ GValue value = G_VALUE_INIT; ++ GParamSpec *pspec; ++ _ExtendedGDBusPropertyInfo *info; ++ gboolean ret; ++ ret = FALSE; ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &__g_freedesktop_dbus_interface_info.parent_struct, property_name); ++ g_assert (info != NULL); ++ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); ++ if (pspec == NULL) ++ { ++ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); ++ } ++ else ++ { ++ if (info->use_gvariant) ++ g_value_set_variant (&value, variant); ++ else ++ g_dbus_gvariant_to_gvalue (variant, &value); ++ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); ++ g_value_unset (&value); ++ ret = TRUE; ++ } ++ return ret; ++} ++ ++static const GDBusInterfaceVTable __g_freedesktop_dbus_skeleton_vtable = ++{ ++ __g_freedesktop_dbus_skeleton_handle_method_call, ++ __g_freedesktop_dbus_skeleton_handle_get_property, ++ __g_freedesktop_dbus_skeleton_handle_set_property, ++ {NULL} ++}; ++ ++static GDBusInterfaceInfo * ++_g_freedesktop_dbus_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) ++{ ++ return _g_freedesktop_dbus_interface_info (); ++} ++ ++static GDBusInterfaceVTable * ++_g_freedesktop_dbus_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) ++{ ++ return (GDBusInterfaceVTable *) &__g_freedesktop_dbus_skeleton_vtable; ++} ++ ++static GVariant * ++_g_freedesktop_dbus_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) ++{ ++ _GFreedesktopDBusSkeleton *skeleton = _G_FREEDESKTOP_DBUS_SKELETON (_skeleton); ++ ++ GVariantBuilder builder; ++ guint n; ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); ++ if (__g_freedesktop_dbus_interface_info.parent_struct.properties == NULL) ++ goto out; ++ for (n = 0; __g_freedesktop_dbus_interface_info.parent_struct.properties[n] != NULL; n++) ++ { ++ GDBusPropertyInfo *info = __g_freedesktop_dbus_interface_info.parent_struct.properties[n]; ++ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) ++ { ++ GVariant *value; ++ value = __g_freedesktop_dbus_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.DBus", info->name, NULL, skeleton); ++ if (value != NULL) ++ { ++ g_variant_take_ref (value); ++ g_variant_builder_add (&builder, "{sv}", info->name, value); ++ g_variant_unref (value); ++ } ++ } ++ } ++out: ++ return g_variant_builder_end (&builder); ++} ++ ++static void ++_g_freedesktop_dbus_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton G_GNUC_UNUSED) ++{ ++} ++ ++static void ++__g_freedesktop_dbus_on_signal_name_owner_changed ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name, ++ const gchar *arg_old_owner, ++ const gchar *arg_new_owner) ++{ ++ _GFreedesktopDBusSkeleton *skeleton = _G_FREEDESKTOP_DBUS_SKELETON (object); ++ ++ GList *connections, *l; ++ GVariant *signal_variant; ++ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); ++ ++ signal_variant = g_variant_ref_sink (g_variant_new ("(sss)", ++ arg_name, ++ arg_old_owner, ++ arg_new_owner)); ++ for (l = connections; l != NULL; l = l->next) ++ { ++ GDBusConnection *connection = l->data; ++ g_dbus_connection_emit_signal (connection, ++ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.DBus", "NameOwnerChanged", ++ signal_variant, NULL); ++ } ++ g_variant_unref (signal_variant); ++ g_list_free_full (connections, g_object_unref); ++} ++ ++static void ++__g_freedesktop_dbus_on_signal_name_lost ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name) ++{ ++ _GFreedesktopDBusSkeleton *skeleton = _G_FREEDESKTOP_DBUS_SKELETON (object); ++ ++ GList *connections, *l; ++ GVariant *signal_variant; ++ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); ++ ++ signal_variant = g_variant_ref_sink (g_variant_new ("(s)", ++ arg_name)); ++ for (l = connections; l != NULL; l = l->next) ++ { ++ GDBusConnection *connection = l->data; ++ g_dbus_connection_emit_signal (connection, ++ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.DBus", "NameLost", ++ signal_variant, NULL); ++ } ++ g_variant_unref (signal_variant); ++ g_list_free_full (connections, g_object_unref); ++} ++ ++static void ++__g_freedesktop_dbus_on_signal_name_acquired ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name) ++{ ++ _GFreedesktopDBusSkeleton *skeleton = _G_FREEDESKTOP_DBUS_SKELETON (object); ++ ++ GList *connections, *l; ++ GVariant *signal_variant; ++ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); ++ ++ signal_variant = g_variant_ref_sink (g_variant_new ("(s)", ++ arg_name)); ++ for (l = connections; l != NULL; l = l->next) ++ { ++ GDBusConnection *connection = l->data; ++ g_dbus_connection_emit_signal (connection, ++ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.DBus", "NameAcquired", ++ signal_variant, NULL); ++ } ++ g_variant_unref (signal_variant); ++ g_list_free_full (connections, g_object_unref); ++} ++ ++static void _g_freedesktop_dbus_skeleton_iface_init (_GFreedesktopDBusIface *iface); ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++G_DEFINE_TYPE_WITH_CODE (_GFreedesktopDBusSkeleton, _g_freedesktop_dbus_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, ++ G_ADD_PRIVATE (_GFreedesktopDBusSkeleton) ++ G_IMPLEMENT_INTERFACE (_G_TYPE_FREEDESKTOP_DBUS, _g_freedesktop_dbus_skeleton_iface_init)) ++ ++#else ++G_DEFINE_TYPE_WITH_CODE (_GFreedesktopDBusSkeleton, _g_freedesktop_dbus_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, ++ G_IMPLEMENT_INTERFACE (_G_TYPE_FREEDESKTOP_DBUS, _g_freedesktop_dbus_skeleton_iface_init)) ++ ++#endif ++static void ++_g_freedesktop_dbus_skeleton_finalize (GObject *object) ++{ ++ _GFreedesktopDBusSkeleton *skeleton = _G_FREEDESKTOP_DBUS_SKELETON (object); ++ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); ++ if (skeleton->priv->changed_properties_idle_source != NULL) ++ g_source_destroy (skeleton->priv->changed_properties_idle_source); ++ g_main_context_unref (skeleton->priv->context); ++ g_mutex_clear (&skeleton->priv->lock); ++ G_OBJECT_CLASS (_g_freedesktop_dbus_skeleton_parent_class)->finalize (object); ++} ++ ++static void ++_g_freedesktop_dbus_skeleton_init (_GFreedesktopDBusSkeleton *skeleton) ++{ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++ skeleton->priv = _g_freedesktop_dbus_skeleton_get_instance_private (skeleton); ++#else ++ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, _G_TYPE_FREEDESKTOP_DBUS_SKELETON, _GFreedesktopDBusSkeletonPrivate); ++#endif ++ ++ g_mutex_init (&skeleton->priv->lock); ++ skeleton->priv->context = g_main_context_ref_thread_default (); ++} ++ ++static void ++_g_freedesktop_dbus_skeleton_class_init (_GFreedesktopDBusSkeletonClass *klass) ++{ ++ GObjectClass *gobject_class; ++ GDBusInterfaceSkeletonClass *skeleton_class; ++ ++ gobject_class = G_OBJECT_CLASS (klass); ++ gobject_class->finalize = _g_freedesktop_dbus_skeleton_finalize; ++ ++ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); ++ skeleton_class->get_info = _g_freedesktop_dbus_skeleton_dbus_interface_get_info; ++ skeleton_class->get_properties = _g_freedesktop_dbus_skeleton_dbus_interface_get_properties; ++ skeleton_class->flush = _g_freedesktop_dbus_skeleton_dbus_interface_flush; ++ skeleton_class->get_vtable = _g_freedesktop_dbus_skeleton_dbus_interface_get_vtable; ++ ++#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 ++ g_type_class_add_private (klass, sizeof (_GFreedesktopDBusSkeletonPrivate)); ++#endif ++} ++ ++static void ++_g_freedesktop_dbus_skeleton_iface_init (_GFreedesktopDBusIface *iface) ++{ ++ iface->name_owner_changed = __g_freedesktop_dbus_on_signal_name_owner_changed; ++ iface->name_lost = __g_freedesktop_dbus_on_signal_name_lost; ++ iface->name_acquired = __g_freedesktop_dbus_on_signal_name_acquired; ++} ++ ++/** ++ * _g_freedesktop_dbus_skeleton_new: ++ * ++ * Creates a skeleton object for the D-Bus interface org.freedesktop.DBus. ++ * ++ * Returns: (transfer full) (type _GFreedesktopDBusSkeleton): The skeleton object. ++ */ ++_GFreedesktopDBus * ++_g_freedesktop_dbus_skeleton_new (void) ++{ ++ return _G_FREEDESKTOP_DBUS (g_object_new (_G_TYPE_FREEDESKTOP_DBUS_SKELETON, NULL)); ++} ++ +diff --git a/gio/gdbus-daemon-generated.h b/gio/gdbus-daemon-generated.h +new file mode 100644 +index 0000000..8a99684 +--- /dev/null ++++ b/gio/gdbus-daemon-generated.h +@@ -0,0 +1,674 @@ ++/* ++ * This file is generated by gdbus-codegen, do not modify it. ++ * ++ * The license of this code is the same as for the D-Bus interface description ++ * it was derived from. Note that it links to GLib, so must comply with the ++ * LGPL linking clauses. ++ */ ++ ++#ifndef __GDBUS_DAEMON_GENERATED_H__ ++#define __GDBUS_DAEMON_GENERATED_H__ ++ ++#include ++ ++G_BEGIN_DECLS ++ ++ ++/* ------------------------------------------------------------------------ */ ++/* Declarations for org.freedesktop.DBus */ ++ ++#define _G_TYPE_FREEDESKTOP_DBUS (_g_freedesktop_dbus_get_type ()) ++#define _G_FREEDESKTOP_DBUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), _G_TYPE_FREEDESKTOP_DBUS, _GFreedesktopDBus)) ++#define _G_IS_FREEDESKTOP_DBUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), _G_TYPE_FREEDESKTOP_DBUS)) ++#define _G_FREEDESKTOP_DBUS_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), _G_TYPE_FREEDESKTOP_DBUS, _GFreedesktopDBusIface)) ++ ++struct __GFreedesktopDBus; ++typedef struct __GFreedesktopDBus _GFreedesktopDBus; ++typedef struct __GFreedesktopDBusIface _GFreedesktopDBusIface; ++ ++struct __GFreedesktopDBusIface ++{ ++ GTypeInterface parent_iface; ++ ++ ++ gboolean (*handle_add_match) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_rule); ++ ++ gboolean (*handle_get_connection_selinux_security_context) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_name); ++ ++ gboolean (*handle_get_connection_unix_process_id) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_name); ++ ++ gboolean (*handle_get_connection_unix_user) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_name); ++ ++ gboolean (*handle_get_id) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation); ++ ++ gboolean (*handle_get_name_owner) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_name); ++ ++ gboolean (*handle_hello) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation); ++ ++ gboolean (*handle_list_activatable_names) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation); ++ ++ gboolean (*handle_list_names) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation); ++ ++ gboolean (*handle_list_queued_owners) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_name); ++ ++ gboolean (*handle_name_has_owner) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_name); ++ ++ gboolean (*handle_release_name) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_name); ++ ++ gboolean (*handle_reload_config) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation); ++ ++ gboolean (*handle_remove_match) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_rule); ++ ++ gboolean (*handle_request_name) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_name, ++ guint arg_flags); ++ ++ gboolean (*handle_start_service_by_name) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_name, ++ guint arg_flags); ++ ++ gboolean (*handle_update_activation_environment) ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ GVariant *arg_environment); ++ ++ void (*name_acquired) ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name); ++ ++ void (*name_lost) ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name); ++ ++ void (*name_owner_changed) ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name, ++ const gchar *arg_old_owner, ++ const gchar *arg_new_owner); ++ ++}; ++ ++GType _g_freedesktop_dbus_get_type (void) G_GNUC_CONST; ++ ++GDBusInterfaceInfo *_g_freedesktop_dbus_interface_info (void); ++guint _g_freedesktop_dbus_override_properties (GObjectClass *klass, guint property_id_begin); ++ ++ ++/* D-Bus method call completion functions: */ ++void _g_freedesktop_dbus_complete_hello ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *assigned_name); ++ ++void _g_freedesktop_dbus_complete_request_name ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ guint value); ++ ++void _g_freedesktop_dbus_complete_release_name ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ guint value); ++ ++void _g_freedesktop_dbus_complete_start_service_by_name ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ guint value); ++ ++void _g_freedesktop_dbus_complete_name_has_owner ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ gboolean has_owner); ++ ++void _g_freedesktop_dbus_complete_list_names ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *const *names); ++ ++void _g_freedesktop_dbus_complete_list_activatable_names ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *const *activatable_names); ++ ++void _g_freedesktop_dbus_complete_add_match ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation); ++ ++void _g_freedesktop_dbus_complete_remove_match ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation); ++ ++void _g_freedesktop_dbus_complete_get_name_owner ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *unique_name); ++ ++void _g_freedesktop_dbus_complete_list_queued_owners ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *const *queued_owners); ++ ++void _g_freedesktop_dbus_complete_get_connection_unix_user ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ guint uid); ++ ++void _g_freedesktop_dbus_complete_get_connection_unix_process_id ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ guint pid); ++ ++void _g_freedesktop_dbus_complete_get_connection_selinux_security_context ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *security_context); ++ ++void _g_freedesktop_dbus_complete_update_activation_environment ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation); ++ ++void _g_freedesktop_dbus_complete_reload_config ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation); ++ ++void _g_freedesktop_dbus_complete_get_id ( ++ _GFreedesktopDBus *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *unique_id); ++ ++ ++ ++/* D-Bus signal emissions functions: */ ++void _g_freedesktop_dbus_emit_name_owner_changed ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name, ++ const gchar *arg_old_owner, ++ const gchar *arg_new_owner); ++ ++void _g_freedesktop_dbus_emit_name_lost ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name); ++ ++void _g_freedesktop_dbus_emit_name_acquired ( ++ _GFreedesktopDBus *object, ++ const gchar *arg_name); ++ ++ ++ ++/* D-Bus method calls: */ ++void _g_freedesktop_dbus_call_hello ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_hello_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_assigned_name, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_hello_sync ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_assigned_name, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_request_name ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint arg_flags, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_request_name_finish ( ++ _GFreedesktopDBus *proxy, ++ guint *out_value, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_request_name_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint arg_flags, ++ guint *out_value, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_release_name ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_release_name_finish ( ++ _GFreedesktopDBus *proxy, ++ guint *out_value, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_release_name_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint *out_value, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_start_service_by_name ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint arg_flags, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_start_service_by_name_finish ( ++ _GFreedesktopDBus *proxy, ++ guint *out_value, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_start_service_by_name_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint arg_flags, ++ guint *out_value, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_name_has_owner ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_name_has_owner_finish ( ++ _GFreedesktopDBus *proxy, ++ gboolean *out_has_owner, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_name_has_owner_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ gboolean *out_has_owner, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_list_names ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_list_names_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar ***out_names, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_list_names_sync ( ++ _GFreedesktopDBus *proxy, ++ gchar ***out_names, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_list_activatable_names ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_list_activatable_names_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar ***out_activatable_names, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_list_activatable_names_sync ( ++ _GFreedesktopDBus *proxy, ++ gchar ***out_activatable_names, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_add_match ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_rule, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_add_match_finish ( ++ _GFreedesktopDBus *proxy, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_add_match_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_rule, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_remove_match ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_rule, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_remove_match_finish ( ++ _GFreedesktopDBus *proxy, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_remove_match_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_rule, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_get_name_owner ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_get_name_owner_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_unique_name, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_get_name_owner_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ gchar **out_unique_name, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_list_queued_owners ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_list_queued_owners_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar ***out_queued_owners, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_list_queued_owners_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ gchar ***out_queued_owners, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_get_connection_unix_user ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_get_connection_unix_user_finish ( ++ _GFreedesktopDBus *proxy, ++ guint *out_uid, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_get_connection_unix_user_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint *out_uid, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_get_connection_unix_process_id ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_get_connection_unix_process_id_finish ( ++ _GFreedesktopDBus *proxy, ++ guint *out_pid, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_get_connection_unix_process_id_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ guint *out_pid, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_get_connection_selinux_security_context ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_security_context, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync ( ++ _GFreedesktopDBus *proxy, ++ const gchar *arg_name, ++ gchar **out_security_context, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_update_activation_environment ( ++ _GFreedesktopDBus *proxy, ++ GVariant *arg_environment, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_update_activation_environment_finish ( ++ _GFreedesktopDBus *proxy, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_update_activation_environment_sync ( ++ _GFreedesktopDBus *proxy, ++ GVariant *arg_environment, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_reload_config ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_reload_config_finish ( ++ _GFreedesktopDBus *proxy, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_reload_config_sync ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_call_get_id ( ++ _GFreedesktopDBus *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean _g_freedesktop_dbus_call_get_id_finish ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_unique_id, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean _g_freedesktop_dbus_call_get_id_sync ( ++ _GFreedesktopDBus *proxy, ++ gchar **out_unique_id, ++ GCancellable *cancellable, ++ GError **error); ++ ++ ++ ++/* ---- */ ++ ++#define _G_TYPE_FREEDESKTOP_DBUS_PROXY (_g_freedesktop_dbus_proxy_get_type ()) ++#define _G_FREEDESKTOP_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), _G_TYPE_FREEDESKTOP_DBUS_PROXY, _GFreedesktopDBusProxy)) ++#define _G_FREEDESKTOP_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), _G_TYPE_FREEDESKTOP_DBUS_PROXY, _GFreedesktopDBusProxyClass)) ++#define _G_FREEDESKTOP_DBUS_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), _G_TYPE_FREEDESKTOP_DBUS_PROXY, _GFreedesktopDBusProxyClass)) ++#define _G_IS_FREEDESKTOP_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), _G_TYPE_FREEDESKTOP_DBUS_PROXY)) ++#define _G_IS_FREEDESKTOP_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), _G_TYPE_FREEDESKTOP_DBUS_PROXY)) ++ ++typedef struct __GFreedesktopDBusProxy _GFreedesktopDBusProxy; ++typedef struct __GFreedesktopDBusProxyClass _GFreedesktopDBusProxyClass; ++typedef struct __GFreedesktopDBusProxyPrivate _GFreedesktopDBusProxyPrivate; ++ ++struct __GFreedesktopDBusProxy ++{ ++ /*< private >*/ ++ GDBusProxy parent_instance; ++ _GFreedesktopDBusProxyPrivate *priv; ++}; ++ ++struct __GFreedesktopDBusProxyClass ++{ ++ GDBusProxyClass parent_class; ++}; ++ ++GType _g_freedesktop_dbus_proxy_get_type (void) G_GNUC_CONST; ++ ++#if GLIB_CHECK_VERSION(2, 44, 0) ++G_DEFINE_AUTOPTR_CLEANUP_FUNC (_GFreedesktopDBusProxy, g_object_unref) ++#endif ++ ++void _g_freedesktop_dbus_proxy_new ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++_GFreedesktopDBus *_g_freedesktop_dbus_proxy_new_finish ( ++ GAsyncResult *res, ++ GError **error); ++_GFreedesktopDBus *_g_freedesktop_dbus_proxy_new_sync ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++void _g_freedesktop_dbus_proxy_new_for_bus ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++_GFreedesktopDBus *_g_freedesktop_dbus_proxy_new_for_bus_finish ( ++ GAsyncResult *res, ++ GError **error); ++_GFreedesktopDBus *_g_freedesktop_dbus_proxy_new_for_bus_sync ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++ ++/* ---- */ ++ ++#define _G_TYPE_FREEDESKTOP_DBUS_SKELETON (_g_freedesktop_dbus_skeleton_get_type ()) ++#define _G_FREEDESKTOP_DBUS_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), _G_TYPE_FREEDESKTOP_DBUS_SKELETON, _GFreedesktopDBusSkeleton)) ++#define _G_FREEDESKTOP_DBUS_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), _G_TYPE_FREEDESKTOP_DBUS_SKELETON, _GFreedesktopDBusSkeletonClass)) ++#define _G_FREEDESKTOP_DBUS_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), _G_TYPE_FREEDESKTOP_DBUS_SKELETON, _GFreedesktopDBusSkeletonClass)) ++#define _G_IS_FREEDESKTOP_DBUS_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), _G_TYPE_FREEDESKTOP_DBUS_SKELETON)) ++#define _G_IS_FREEDESKTOP_DBUS_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), _G_TYPE_FREEDESKTOP_DBUS_SKELETON)) ++ ++typedef struct __GFreedesktopDBusSkeleton _GFreedesktopDBusSkeleton; ++typedef struct __GFreedesktopDBusSkeletonClass _GFreedesktopDBusSkeletonClass; ++typedef struct __GFreedesktopDBusSkeletonPrivate _GFreedesktopDBusSkeletonPrivate; ++ ++struct __GFreedesktopDBusSkeleton ++{ ++ /*< private >*/ ++ GDBusInterfaceSkeleton parent_instance; ++ _GFreedesktopDBusSkeletonPrivate *priv; ++}; ++ ++struct __GFreedesktopDBusSkeletonClass ++{ ++ GDBusInterfaceSkeletonClass parent_class; ++}; ++ ++GType _g_freedesktop_dbus_skeleton_get_type (void) G_GNUC_CONST; ++ ++#if GLIB_CHECK_VERSION(2, 44, 0) ++G_DEFINE_AUTOPTR_CLEANUP_FUNC (_GFreedesktopDBusSkeleton, g_object_unref) ++#endif ++ ++_GFreedesktopDBus *_g_freedesktop_dbus_skeleton_new (void); ++ ++ ++G_END_DECLS ++ ++#endif /* __GDBUS_DAEMON_GENERATED_H__ */ +diff --git a/gio/gioenumtypes.c b/gio/gioenumtypes.c +new file mode 100644 +index 0000000..8c0c3e6 +--- /dev/null ++++ b/gio/gioenumtypes.c +@@ -0,0 +1,1801 @@ ++ ++/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ ++ ++#include "config.h" ++#include "gioenumtypes.h" ++#include ++/* enumerations from "../gio/gioenums.h" */ ++GType ++g_app_info_create_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_APP_INFO_CREATE_NONE, "G_APP_INFO_CREATE_NONE", "none" }, ++ { G_APP_INFO_CREATE_NEEDS_TERMINAL, "G_APP_INFO_CREATE_NEEDS_TERMINAL", "needs-terminal" }, ++ { G_APP_INFO_CREATE_SUPPORTS_URIS, "G_APP_INFO_CREATE_SUPPORTS_URIS", "supports-uris" }, ++ { G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION, "G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION", "supports-startup-notification" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GAppInfoCreateFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_converter_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_CONVERTER_NO_FLAGS, "G_CONVERTER_NO_FLAGS", "none" }, ++ { G_CONVERTER_INPUT_AT_END, "G_CONVERTER_INPUT_AT_END", "input-at-end" }, ++ { G_CONVERTER_FLUSH, "G_CONVERTER_FLUSH", "flush" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GConverterFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_converter_result_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_CONVERTER_ERROR, "G_CONVERTER_ERROR", "error" }, ++ { G_CONVERTER_CONVERTED, "G_CONVERTER_CONVERTED", "converted" }, ++ { G_CONVERTER_FINISHED, "G_CONVERTER_FINISHED", "finished" }, ++ { G_CONVERTER_FLUSHED, "G_CONVERTER_FLUSHED", "flushed" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GConverterResult"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_data_stream_byte_order_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN, "G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN", "big-endian" }, ++ { G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN, "G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN", "little-endian" }, ++ { G_DATA_STREAM_BYTE_ORDER_HOST_ENDIAN, "G_DATA_STREAM_BYTE_ORDER_HOST_ENDIAN", "host-endian" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GDataStreamByteOrder"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_data_stream_newline_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_DATA_STREAM_NEWLINE_TYPE_LF, "G_DATA_STREAM_NEWLINE_TYPE_LF", "lf" }, ++ { G_DATA_STREAM_NEWLINE_TYPE_CR, "G_DATA_STREAM_NEWLINE_TYPE_CR", "cr" }, ++ { G_DATA_STREAM_NEWLINE_TYPE_CR_LF, "G_DATA_STREAM_NEWLINE_TYPE_CR_LF", "cr-lf" }, ++ { G_DATA_STREAM_NEWLINE_TYPE_ANY, "G_DATA_STREAM_NEWLINE_TYPE_ANY", "any" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GDataStreamNewlineType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_file_attribute_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_FILE_ATTRIBUTE_TYPE_INVALID, "G_FILE_ATTRIBUTE_TYPE_INVALID", "invalid" }, ++ { G_FILE_ATTRIBUTE_TYPE_STRING, "G_FILE_ATTRIBUTE_TYPE_STRING", "string" }, ++ { G_FILE_ATTRIBUTE_TYPE_BYTE_STRING, "G_FILE_ATTRIBUTE_TYPE_BYTE_STRING", "byte-string" }, ++ { G_FILE_ATTRIBUTE_TYPE_BOOLEAN, "G_FILE_ATTRIBUTE_TYPE_BOOLEAN", "boolean" }, ++ { G_FILE_ATTRIBUTE_TYPE_UINT32, "G_FILE_ATTRIBUTE_TYPE_UINT32", "uint32" }, ++ { G_FILE_ATTRIBUTE_TYPE_INT32, "G_FILE_ATTRIBUTE_TYPE_INT32", "int32" }, ++ { G_FILE_ATTRIBUTE_TYPE_UINT64, "G_FILE_ATTRIBUTE_TYPE_UINT64", "uint64" }, ++ { G_FILE_ATTRIBUTE_TYPE_INT64, "G_FILE_ATTRIBUTE_TYPE_INT64", "int64" }, ++ { G_FILE_ATTRIBUTE_TYPE_OBJECT, "G_FILE_ATTRIBUTE_TYPE_OBJECT", "object" }, ++ { G_FILE_ATTRIBUTE_TYPE_STRINGV, "G_FILE_ATTRIBUTE_TYPE_STRINGV", "stringv" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GFileAttributeType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_file_attribute_info_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_FILE_ATTRIBUTE_INFO_NONE, "G_FILE_ATTRIBUTE_INFO_NONE", "none" }, ++ { G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE, "G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE", "copy-with-file" }, ++ { G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED, "G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED", "copy-when-moved" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GFileAttributeInfoFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_file_attribute_status_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_FILE_ATTRIBUTE_STATUS_UNSET, "G_FILE_ATTRIBUTE_STATUS_UNSET", "unset" }, ++ { G_FILE_ATTRIBUTE_STATUS_SET, "G_FILE_ATTRIBUTE_STATUS_SET", "set" }, ++ { G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, "G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING", "error-setting" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GFileAttributeStatus"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_file_query_info_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_FILE_QUERY_INFO_NONE, "G_FILE_QUERY_INFO_NONE", "none" }, ++ { G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, "G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS", "nofollow-symlinks" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GFileQueryInfoFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_file_create_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_FILE_CREATE_NONE, "G_FILE_CREATE_NONE", "none" }, ++ { G_FILE_CREATE_PRIVATE, "G_FILE_CREATE_PRIVATE", "private" }, ++ { G_FILE_CREATE_REPLACE_DESTINATION, "G_FILE_CREATE_REPLACE_DESTINATION", "replace-destination" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GFileCreateFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_file_measure_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_FILE_MEASURE_NONE, "G_FILE_MEASURE_NONE", "none" }, ++ { G_FILE_MEASURE_REPORT_ANY_ERROR, "G_FILE_MEASURE_REPORT_ANY_ERROR", "report-any-error" }, ++ { G_FILE_MEASURE_APPARENT_SIZE, "G_FILE_MEASURE_APPARENT_SIZE", "apparent-size" }, ++ { G_FILE_MEASURE_NO_XDEV, "G_FILE_MEASURE_NO_XDEV", "no-xdev" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GFileMeasureFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_mount_mount_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_MOUNT_MOUNT_NONE, "G_MOUNT_MOUNT_NONE", "none" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GMountMountFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_mount_unmount_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_MOUNT_UNMOUNT_NONE, "G_MOUNT_UNMOUNT_NONE", "none" }, ++ { G_MOUNT_UNMOUNT_FORCE, "G_MOUNT_UNMOUNT_FORCE", "force" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GMountUnmountFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_drive_start_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DRIVE_START_NONE, "G_DRIVE_START_NONE", "none" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDriveStartFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_drive_start_stop_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_DRIVE_START_STOP_TYPE_UNKNOWN, "G_DRIVE_START_STOP_TYPE_UNKNOWN", "unknown" }, ++ { G_DRIVE_START_STOP_TYPE_SHUTDOWN, "G_DRIVE_START_STOP_TYPE_SHUTDOWN", "shutdown" }, ++ { G_DRIVE_START_STOP_TYPE_NETWORK, "G_DRIVE_START_STOP_TYPE_NETWORK", "network" }, ++ { G_DRIVE_START_STOP_TYPE_MULTIDISK, "G_DRIVE_START_STOP_TYPE_MULTIDISK", "multidisk" }, ++ { G_DRIVE_START_STOP_TYPE_PASSWORD, "G_DRIVE_START_STOP_TYPE_PASSWORD", "password" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GDriveStartStopType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_file_copy_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_FILE_COPY_NONE, "G_FILE_COPY_NONE", "none" }, ++ { G_FILE_COPY_OVERWRITE, "G_FILE_COPY_OVERWRITE", "overwrite" }, ++ { G_FILE_COPY_BACKUP, "G_FILE_COPY_BACKUP", "backup" }, ++ { G_FILE_COPY_NOFOLLOW_SYMLINKS, "G_FILE_COPY_NOFOLLOW_SYMLINKS", "nofollow-symlinks" }, ++ { G_FILE_COPY_ALL_METADATA, "G_FILE_COPY_ALL_METADATA", "all-metadata" }, ++ { G_FILE_COPY_NO_FALLBACK_FOR_MOVE, "G_FILE_COPY_NO_FALLBACK_FOR_MOVE", "no-fallback-for-move" }, ++ { G_FILE_COPY_TARGET_DEFAULT_PERMS, "G_FILE_COPY_TARGET_DEFAULT_PERMS", "target-default-perms" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GFileCopyFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_file_monitor_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_FILE_MONITOR_NONE, "G_FILE_MONITOR_NONE", "none" }, ++ { G_FILE_MONITOR_WATCH_MOUNTS, "G_FILE_MONITOR_WATCH_MOUNTS", "watch-mounts" }, ++ { G_FILE_MONITOR_SEND_MOVED, "G_FILE_MONITOR_SEND_MOVED", "send-moved" }, ++ { G_FILE_MONITOR_WATCH_HARD_LINKS, "G_FILE_MONITOR_WATCH_HARD_LINKS", "watch-hard-links" }, ++ { G_FILE_MONITOR_WATCH_MOVES, "G_FILE_MONITOR_WATCH_MOVES", "watch-moves" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GFileMonitorFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_file_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_FILE_TYPE_UNKNOWN, "G_FILE_TYPE_UNKNOWN", "unknown" }, ++ { G_FILE_TYPE_REGULAR, "G_FILE_TYPE_REGULAR", "regular" }, ++ { G_FILE_TYPE_DIRECTORY, "G_FILE_TYPE_DIRECTORY", "directory" }, ++ { G_FILE_TYPE_SYMBOLIC_LINK, "G_FILE_TYPE_SYMBOLIC_LINK", "symbolic-link" }, ++ { G_FILE_TYPE_SPECIAL, "G_FILE_TYPE_SPECIAL", "special" }, ++ { G_FILE_TYPE_SHORTCUT, "G_FILE_TYPE_SHORTCUT", "shortcut" }, ++ { G_FILE_TYPE_MOUNTABLE, "G_FILE_TYPE_MOUNTABLE", "mountable" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GFileType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_filesystem_preview_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYS, "G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYS", "if-always" }, ++ { G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL, "G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL", "if-local" }, ++ { G_FILESYSTEM_PREVIEW_TYPE_NEVER, "G_FILESYSTEM_PREVIEW_TYPE_NEVER", "never" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GFilesystemPreviewType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_file_monitor_event_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_FILE_MONITOR_EVENT_CHANGED, "G_FILE_MONITOR_EVENT_CHANGED", "changed" }, ++ { G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT, "G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT", "changes-done-hint" }, ++ { G_FILE_MONITOR_EVENT_DELETED, "G_FILE_MONITOR_EVENT_DELETED", "deleted" }, ++ { G_FILE_MONITOR_EVENT_CREATED, "G_FILE_MONITOR_EVENT_CREATED", "created" }, ++ { G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED, "G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED", "attribute-changed" }, ++ { G_FILE_MONITOR_EVENT_PRE_UNMOUNT, "G_FILE_MONITOR_EVENT_PRE_UNMOUNT", "pre-unmount" }, ++ { G_FILE_MONITOR_EVENT_UNMOUNTED, "G_FILE_MONITOR_EVENT_UNMOUNTED", "unmounted" }, ++ { G_FILE_MONITOR_EVENT_MOVED, "G_FILE_MONITOR_EVENT_MOVED", "moved" }, ++ { G_FILE_MONITOR_EVENT_RENAMED, "G_FILE_MONITOR_EVENT_RENAMED", "renamed" }, ++ { G_FILE_MONITOR_EVENT_MOVED_IN, "G_FILE_MONITOR_EVENT_MOVED_IN", "moved-in" }, ++ { G_FILE_MONITOR_EVENT_MOVED_OUT, "G_FILE_MONITOR_EVENT_MOVED_OUT", "moved-out" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GFileMonitorEvent"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_io_error_enum_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_IO_ERROR_FAILED, "G_IO_ERROR_FAILED", "failed" }, ++ { G_IO_ERROR_NOT_FOUND, "G_IO_ERROR_NOT_FOUND", "not-found" }, ++ { G_IO_ERROR_EXISTS, "G_IO_ERROR_EXISTS", "exists" }, ++ { G_IO_ERROR_IS_DIRECTORY, "G_IO_ERROR_IS_DIRECTORY", "is-directory" }, ++ { G_IO_ERROR_NOT_DIRECTORY, "G_IO_ERROR_NOT_DIRECTORY", "not-directory" }, ++ { G_IO_ERROR_NOT_EMPTY, "G_IO_ERROR_NOT_EMPTY", "not-empty" }, ++ { G_IO_ERROR_NOT_REGULAR_FILE, "G_IO_ERROR_NOT_REGULAR_FILE", "not-regular-file" }, ++ { G_IO_ERROR_NOT_SYMBOLIC_LINK, "G_IO_ERROR_NOT_SYMBOLIC_LINK", "not-symbolic-link" }, ++ { G_IO_ERROR_NOT_MOUNTABLE_FILE, "G_IO_ERROR_NOT_MOUNTABLE_FILE", "not-mountable-file" }, ++ { G_IO_ERROR_FILENAME_TOO_LONG, "G_IO_ERROR_FILENAME_TOO_LONG", "filename-too-long" }, ++ { G_IO_ERROR_INVALID_FILENAME, "G_IO_ERROR_INVALID_FILENAME", "invalid-filename" }, ++ { G_IO_ERROR_TOO_MANY_LINKS, "G_IO_ERROR_TOO_MANY_LINKS", "too-many-links" }, ++ { G_IO_ERROR_NO_SPACE, "G_IO_ERROR_NO_SPACE", "no-space" }, ++ { G_IO_ERROR_INVALID_ARGUMENT, "G_IO_ERROR_INVALID_ARGUMENT", "invalid-argument" }, ++ { G_IO_ERROR_PERMISSION_DENIED, "G_IO_ERROR_PERMISSION_DENIED", "permission-denied" }, ++ { G_IO_ERROR_NOT_SUPPORTED, "G_IO_ERROR_NOT_SUPPORTED", "not-supported" }, ++ { G_IO_ERROR_NOT_MOUNTED, "G_IO_ERROR_NOT_MOUNTED", "not-mounted" }, ++ { G_IO_ERROR_ALREADY_MOUNTED, "G_IO_ERROR_ALREADY_MOUNTED", "already-mounted" }, ++ { G_IO_ERROR_CLOSED, "G_IO_ERROR_CLOSED", "closed" }, ++ { G_IO_ERROR_CANCELLED, "G_IO_ERROR_CANCELLED", "cancelled" }, ++ { G_IO_ERROR_PENDING, "G_IO_ERROR_PENDING", "pending" }, ++ { G_IO_ERROR_READ_ONLY, "G_IO_ERROR_READ_ONLY", "read-only" }, ++ { G_IO_ERROR_CANT_CREATE_BACKUP, "G_IO_ERROR_CANT_CREATE_BACKUP", "cant-create-backup" }, ++ { G_IO_ERROR_WRONG_ETAG, "G_IO_ERROR_WRONG_ETAG", "wrong-etag" }, ++ { G_IO_ERROR_TIMED_OUT, "G_IO_ERROR_TIMED_OUT", "timed-out" }, ++ { G_IO_ERROR_WOULD_RECURSE, "G_IO_ERROR_WOULD_RECURSE", "would-recurse" }, ++ { G_IO_ERROR_BUSY, "G_IO_ERROR_BUSY", "busy" }, ++ { G_IO_ERROR_WOULD_BLOCK, "G_IO_ERROR_WOULD_BLOCK", "would-block" }, ++ { G_IO_ERROR_HOST_NOT_FOUND, "G_IO_ERROR_HOST_NOT_FOUND", "host-not-found" }, ++ { G_IO_ERROR_WOULD_MERGE, "G_IO_ERROR_WOULD_MERGE", "would-merge" }, ++ { G_IO_ERROR_FAILED_HANDLED, "G_IO_ERROR_FAILED_HANDLED", "failed-handled" }, ++ { G_IO_ERROR_TOO_MANY_OPEN_FILES, "G_IO_ERROR_TOO_MANY_OPEN_FILES", "too-many-open-files" }, ++ { G_IO_ERROR_NOT_INITIALIZED, "G_IO_ERROR_NOT_INITIALIZED", "not-initialized" }, ++ { G_IO_ERROR_ADDRESS_IN_USE, "G_IO_ERROR_ADDRESS_IN_USE", "address-in-use" }, ++ { G_IO_ERROR_PARTIAL_INPUT, "G_IO_ERROR_PARTIAL_INPUT", "partial-input" }, ++ { G_IO_ERROR_INVALID_DATA, "G_IO_ERROR_INVALID_DATA", "invalid-data" }, ++ { G_IO_ERROR_DBUS_ERROR, "G_IO_ERROR_DBUS_ERROR", "dbus-error" }, ++ { G_IO_ERROR_HOST_UNREACHABLE, "G_IO_ERROR_HOST_UNREACHABLE", "host-unreachable" }, ++ { G_IO_ERROR_NETWORK_UNREACHABLE, "G_IO_ERROR_NETWORK_UNREACHABLE", "network-unreachable" }, ++ { G_IO_ERROR_CONNECTION_REFUSED, "G_IO_ERROR_CONNECTION_REFUSED", "connection-refused" }, ++ { G_IO_ERROR_PROXY_FAILED, "G_IO_ERROR_PROXY_FAILED", "proxy-failed" }, ++ { G_IO_ERROR_PROXY_AUTH_FAILED, "G_IO_ERROR_PROXY_AUTH_FAILED", "proxy-auth-failed" }, ++ { G_IO_ERROR_PROXY_NEED_AUTH, "G_IO_ERROR_PROXY_NEED_AUTH", "proxy-need-auth" }, ++ { G_IO_ERROR_PROXY_NOT_ALLOWED, "G_IO_ERROR_PROXY_NOT_ALLOWED", "proxy-not-allowed" }, ++ { G_IO_ERROR_BROKEN_PIPE, "G_IO_ERROR_BROKEN_PIPE", "broken-pipe" }, ++ { G_IO_ERROR_CONNECTION_CLOSED, "G_IO_ERROR_CONNECTION_CLOSED", "connection-closed" }, ++ { G_IO_ERROR_NOT_CONNECTED, "G_IO_ERROR_NOT_CONNECTED", "not-connected" }, ++ { G_IO_ERROR_MESSAGE_TOO_LARGE, "G_IO_ERROR_MESSAGE_TOO_LARGE", "message-too-large" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GIOErrorEnum"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_ask_password_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_ASK_PASSWORD_NEED_PASSWORD, "G_ASK_PASSWORD_NEED_PASSWORD", "need-password" }, ++ { G_ASK_PASSWORD_NEED_USERNAME, "G_ASK_PASSWORD_NEED_USERNAME", "need-username" }, ++ { G_ASK_PASSWORD_NEED_DOMAIN, "G_ASK_PASSWORD_NEED_DOMAIN", "need-domain" }, ++ { G_ASK_PASSWORD_SAVING_SUPPORTED, "G_ASK_PASSWORD_SAVING_SUPPORTED", "saving-supported" }, ++ { G_ASK_PASSWORD_ANONYMOUS_SUPPORTED, "G_ASK_PASSWORD_ANONYMOUS_SUPPORTED", "anonymous-supported" }, ++ { G_ASK_PASSWORD_TCRYPT, "G_ASK_PASSWORD_TCRYPT", "tcrypt" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GAskPasswordFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_password_save_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_PASSWORD_SAVE_NEVER, "G_PASSWORD_SAVE_NEVER", "never" }, ++ { G_PASSWORD_SAVE_FOR_SESSION, "G_PASSWORD_SAVE_FOR_SESSION", "for-session" }, ++ { G_PASSWORD_SAVE_PERMANENTLY, "G_PASSWORD_SAVE_PERMANENTLY", "permanently" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GPasswordSave"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_mount_operation_result_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_MOUNT_OPERATION_HANDLED, "G_MOUNT_OPERATION_HANDLED", "handled" }, ++ { G_MOUNT_OPERATION_ABORTED, "G_MOUNT_OPERATION_ABORTED", "aborted" }, ++ { G_MOUNT_OPERATION_UNHANDLED, "G_MOUNT_OPERATION_UNHANDLED", "unhandled" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GMountOperationResult"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_output_stream_splice_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_OUTPUT_STREAM_SPLICE_NONE, "G_OUTPUT_STREAM_SPLICE_NONE", "none" }, ++ { G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE, "G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE", "close-source" }, ++ { G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, "G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET", "close-target" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GOutputStreamSpliceFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_io_stream_splice_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_IO_STREAM_SPLICE_NONE, "G_IO_STREAM_SPLICE_NONE", "none" }, ++ { G_IO_STREAM_SPLICE_CLOSE_STREAM1, "G_IO_STREAM_SPLICE_CLOSE_STREAM1", "close-stream1" }, ++ { G_IO_STREAM_SPLICE_CLOSE_STREAM2, "G_IO_STREAM_SPLICE_CLOSE_STREAM2", "close-stream2" }, ++ { G_IO_STREAM_SPLICE_WAIT_FOR_BOTH, "G_IO_STREAM_SPLICE_WAIT_FOR_BOTH", "wait-for-both" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GIOStreamSpliceFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_emblem_origin_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_EMBLEM_ORIGIN_UNKNOWN, "G_EMBLEM_ORIGIN_UNKNOWN", "unknown" }, ++ { G_EMBLEM_ORIGIN_DEVICE, "G_EMBLEM_ORIGIN_DEVICE", "device" }, ++ { G_EMBLEM_ORIGIN_LIVEMETADATA, "G_EMBLEM_ORIGIN_LIVEMETADATA", "livemetadata" }, ++ { G_EMBLEM_ORIGIN_TAG, "G_EMBLEM_ORIGIN_TAG", "tag" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GEmblemOrigin"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_resolver_error_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_RESOLVER_ERROR_NOT_FOUND, "G_RESOLVER_ERROR_NOT_FOUND", "not-found" }, ++ { G_RESOLVER_ERROR_TEMPORARY_FAILURE, "G_RESOLVER_ERROR_TEMPORARY_FAILURE", "temporary-failure" }, ++ { G_RESOLVER_ERROR_INTERNAL, "G_RESOLVER_ERROR_INTERNAL", "internal" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GResolverError"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_resolver_record_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_RESOLVER_RECORD_SRV, "G_RESOLVER_RECORD_SRV", "srv" }, ++ { G_RESOLVER_RECORD_MX, "G_RESOLVER_RECORD_MX", "mx" }, ++ { G_RESOLVER_RECORD_TXT, "G_RESOLVER_RECORD_TXT", "txt" }, ++ { G_RESOLVER_RECORD_SOA, "G_RESOLVER_RECORD_SOA", "soa" }, ++ { G_RESOLVER_RECORD_NS, "G_RESOLVER_RECORD_NS", "ns" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GResolverRecordType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_resource_error_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_RESOURCE_ERROR_NOT_FOUND, "G_RESOURCE_ERROR_NOT_FOUND", "not-found" }, ++ { G_RESOURCE_ERROR_INTERNAL, "G_RESOURCE_ERROR_INTERNAL", "internal" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GResourceError"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_resource_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_RESOURCE_FLAGS_NONE, "G_RESOURCE_FLAGS_NONE", "none" }, ++ { G_RESOURCE_FLAGS_COMPRESSED, "G_RESOURCE_FLAGS_COMPRESSED", "compressed" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GResourceFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_resource_lookup_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_RESOURCE_LOOKUP_FLAGS_NONE, "G_RESOURCE_LOOKUP_FLAGS_NONE", "none" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GResourceLookupFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_socket_family_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_SOCKET_FAMILY_INVALID, "G_SOCKET_FAMILY_INVALID", "invalid" }, ++ { G_SOCKET_FAMILY_UNIX, "G_SOCKET_FAMILY_UNIX", "unix" }, ++ { G_SOCKET_FAMILY_IPV4, "G_SOCKET_FAMILY_IPV4", "ipv4" }, ++ { G_SOCKET_FAMILY_IPV6, "G_SOCKET_FAMILY_IPV6", "ipv6" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GSocketFamily"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_socket_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_SOCKET_TYPE_INVALID, "G_SOCKET_TYPE_INVALID", "invalid" }, ++ { G_SOCKET_TYPE_STREAM, "G_SOCKET_TYPE_STREAM", "stream" }, ++ { G_SOCKET_TYPE_DATAGRAM, "G_SOCKET_TYPE_DATAGRAM", "datagram" }, ++ { G_SOCKET_TYPE_SEQPACKET, "G_SOCKET_TYPE_SEQPACKET", "seqpacket" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GSocketType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_socket_msg_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_SOCKET_MSG_NONE, "G_SOCKET_MSG_NONE", "none" }, ++ { G_SOCKET_MSG_OOB, "G_SOCKET_MSG_OOB", "oob" }, ++ { G_SOCKET_MSG_PEEK, "G_SOCKET_MSG_PEEK", "peek" }, ++ { G_SOCKET_MSG_DONTROUTE, "G_SOCKET_MSG_DONTROUTE", "dontroute" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GSocketMsgFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_socket_protocol_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_SOCKET_PROTOCOL_UNKNOWN, "G_SOCKET_PROTOCOL_UNKNOWN", "unknown" }, ++ { G_SOCKET_PROTOCOL_DEFAULT, "G_SOCKET_PROTOCOL_DEFAULT", "default" }, ++ { G_SOCKET_PROTOCOL_TCP, "G_SOCKET_PROTOCOL_TCP", "tcp" }, ++ { G_SOCKET_PROTOCOL_UDP, "G_SOCKET_PROTOCOL_UDP", "udp" }, ++ { G_SOCKET_PROTOCOL_SCTP, "G_SOCKET_PROTOCOL_SCTP", "sctp" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GSocketProtocol"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_zlib_compressor_format_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_ZLIB_COMPRESSOR_FORMAT_ZLIB, "G_ZLIB_COMPRESSOR_FORMAT_ZLIB", "zlib" }, ++ { G_ZLIB_COMPRESSOR_FORMAT_GZIP, "G_ZLIB_COMPRESSOR_FORMAT_GZIP", "gzip" }, ++ { G_ZLIB_COMPRESSOR_FORMAT_RAW, "G_ZLIB_COMPRESSOR_FORMAT_RAW", "raw" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GZlibCompressorFormat"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_unix_socket_address_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_UNIX_SOCKET_ADDRESS_INVALID, "G_UNIX_SOCKET_ADDRESS_INVALID", "invalid" }, ++ { G_UNIX_SOCKET_ADDRESS_ANONYMOUS, "G_UNIX_SOCKET_ADDRESS_ANONYMOUS", "anonymous" }, ++ { G_UNIX_SOCKET_ADDRESS_PATH, "G_UNIX_SOCKET_ADDRESS_PATH", "path" }, ++ { G_UNIX_SOCKET_ADDRESS_ABSTRACT, "G_UNIX_SOCKET_ADDRESS_ABSTRACT", "abstract" }, ++ { G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, "G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED", "abstract-padded" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GUnixSocketAddressType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_bus_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_BUS_TYPE_STARTER, "G_BUS_TYPE_STARTER", "starter" }, ++ { G_BUS_TYPE_NONE, "G_BUS_TYPE_NONE", "none" }, ++ { G_BUS_TYPE_SYSTEM, "G_BUS_TYPE_SYSTEM", "system" }, ++ { G_BUS_TYPE_SESSION, "G_BUS_TYPE_SESSION", "session" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GBusType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_bus_name_owner_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_BUS_NAME_OWNER_FLAGS_NONE, "G_BUS_NAME_OWNER_FLAGS_NONE", "none" }, ++ { G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, "G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT", "allow-replacement" }, ++ { G_BUS_NAME_OWNER_FLAGS_REPLACE, "G_BUS_NAME_OWNER_FLAGS_REPLACE", "replace" }, ++ { G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE, "G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE", "do-not-queue" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GBusNameOwnerFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_bus_name_watcher_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_BUS_NAME_WATCHER_FLAGS_NONE, "G_BUS_NAME_WATCHER_FLAGS_NONE", "none" }, ++ { G_BUS_NAME_WATCHER_FLAGS_AUTO_START, "G_BUS_NAME_WATCHER_FLAGS_AUTO_START", "auto-start" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GBusNameWatcherFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_proxy_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_PROXY_FLAGS_NONE, "G_DBUS_PROXY_FLAGS_NONE", "none" }, ++ { G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES", "do-not-load-properties" }, ++ { G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, "G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS", "do-not-connect-signals" }, ++ { G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START", "do-not-auto-start" }, ++ { G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES, "G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES", "get-invalidated-properties" }, ++ { G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION, "G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION", "do-not-auto-start-at-construction" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusProxyFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_error_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_DBUS_ERROR_FAILED, "G_DBUS_ERROR_FAILED", "failed" }, ++ { G_DBUS_ERROR_NO_MEMORY, "G_DBUS_ERROR_NO_MEMORY", "no-memory" }, ++ { G_DBUS_ERROR_SERVICE_UNKNOWN, "G_DBUS_ERROR_SERVICE_UNKNOWN", "service-unknown" }, ++ { G_DBUS_ERROR_NAME_HAS_NO_OWNER, "G_DBUS_ERROR_NAME_HAS_NO_OWNER", "name-has-no-owner" }, ++ { G_DBUS_ERROR_NO_REPLY, "G_DBUS_ERROR_NO_REPLY", "no-reply" }, ++ { G_DBUS_ERROR_IO_ERROR, "G_DBUS_ERROR_IO_ERROR", "io-error" }, ++ { G_DBUS_ERROR_BAD_ADDRESS, "G_DBUS_ERROR_BAD_ADDRESS", "bad-address" }, ++ { G_DBUS_ERROR_NOT_SUPPORTED, "G_DBUS_ERROR_NOT_SUPPORTED", "not-supported" }, ++ { G_DBUS_ERROR_LIMITS_EXCEEDED, "G_DBUS_ERROR_LIMITS_EXCEEDED", "limits-exceeded" }, ++ { G_DBUS_ERROR_ACCESS_DENIED, "G_DBUS_ERROR_ACCESS_DENIED", "access-denied" }, ++ { G_DBUS_ERROR_AUTH_FAILED, "G_DBUS_ERROR_AUTH_FAILED", "auth-failed" }, ++ { G_DBUS_ERROR_NO_SERVER, "G_DBUS_ERROR_NO_SERVER", "no-server" }, ++ { G_DBUS_ERROR_TIMEOUT, "G_DBUS_ERROR_TIMEOUT", "timeout" }, ++ { G_DBUS_ERROR_NO_NETWORK, "G_DBUS_ERROR_NO_NETWORK", "no-network" }, ++ { G_DBUS_ERROR_ADDRESS_IN_USE, "G_DBUS_ERROR_ADDRESS_IN_USE", "address-in-use" }, ++ { G_DBUS_ERROR_DISCONNECTED, "G_DBUS_ERROR_DISCONNECTED", "disconnected" }, ++ { G_DBUS_ERROR_INVALID_ARGS, "G_DBUS_ERROR_INVALID_ARGS", "invalid-args" }, ++ { G_DBUS_ERROR_FILE_NOT_FOUND, "G_DBUS_ERROR_FILE_NOT_FOUND", "file-not-found" }, ++ { G_DBUS_ERROR_FILE_EXISTS, "G_DBUS_ERROR_FILE_EXISTS", "file-exists" }, ++ { G_DBUS_ERROR_UNKNOWN_METHOD, "G_DBUS_ERROR_UNKNOWN_METHOD", "unknown-method" }, ++ { G_DBUS_ERROR_TIMED_OUT, "G_DBUS_ERROR_TIMED_OUT", "timed-out" }, ++ { G_DBUS_ERROR_MATCH_RULE_NOT_FOUND, "G_DBUS_ERROR_MATCH_RULE_NOT_FOUND", "match-rule-not-found" }, ++ { G_DBUS_ERROR_MATCH_RULE_INVALID, "G_DBUS_ERROR_MATCH_RULE_INVALID", "match-rule-invalid" }, ++ { G_DBUS_ERROR_SPAWN_EXEC_FAILED, "G_DBUS_ERROR_SPAWN_EXEC_FAILED", "spawn-exec-failed" }, ++ { G_DBUS_ERROR_SPAWN_FORK_FAILED, "G_DBUS_ERROR_SPAWN_FORK_FAILED", "spawn-fork-failed" }, ++ { G_DBUS_ERROR_SPAWN_CHILD_EXITED, "G_DBUS_ERROR_SPAWN_CHILD_EXITED", "spawn-child-exited" }, ++ { G_DBUS_ERROR_SPAWN_CHILD_SIGNALED, "G_DBUS_ERROR_SPAWN_CHILD_SIGNALED", "spawn-child-signaled" }, ++ { G_DBUS_ERROR_SPAWN_FAILED, "G_DBUS_ERROR_SPAWN_FAILED", "spawn-failed" }, ++ { G_DBUS_ERROR_SPAWN_SETUP_FAILED, "G_DBUS_ERROR_SPAWN_SETUP_FAILED", "spawn-setup-failed" }, ++ { G_DBUS_ERROR_SPAWN_CONFIG_INVALID, "G_DBUS_ERROR_SPAWN_CONFIG_INVALID", "spawn-config-invalid" }, ++ { G_DBUS_ERROR_SPAWN_SERVICE_INVALID, "G_DBUS_ERROR_SPAWN_SERVICE_INVALID", "spawn-service-invalid" }, ++ { G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND, "G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND", "spawn-service-not-found" }, ++ { G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID, "G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID", "spawn-permissions-invalid" }, ++ { G_DBUS_ERROR_SPAWN_FILE_INVALID, "G_DBUS_ERROR_SPAWN_FILE_INVALID", "spawn-file-invalid" }, ++ { G_DBUS_ERROR_SPAWN_NO_MEMORY, "G_DBUS_ERROR_SPAWN_NO_MEMORY", "spawn-no-memory" }, ++ { G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN, "G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN", "unix-process-id-unknown" }, ++ { G_DBUS_ERROR_INVALID_SIGNATURE, "G_DBUS_ERROR_INVALID_SIGNATURE", "invalid-signature" }, ++ { G_DBUS_ERROR_INVALID_FILE_CONTENT, "G_DBUS_ERROR_INVALID_FILE_CONTENT", "invalid-file-content" }, ++ { G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, "G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN", "selinux-security-context-unknown" }, ++ { G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN, "G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN", "adt-audit-data-unknown" }, ++ { G_DBUS_ERROR_OBJECT_PATH_IN_USE, "G_DBUS_ERROR_OBJECT_PATH_IN_USE", "object-path-in-use" }, ++ { G_DBUS_ERROR_UNKNOWN_OBJECT, "G_DBUS_ERROR_UNKNOWN_OBJECT", "unknown-object" }, ++ { G_DBUS_ERROR_UNKNOWN_INTERFACE, "G_DBUS_ERROR_UNKNOWN_INTERFACE", "unknown-interface" }, ++ { G_DBUS_ERROR_UNKNOWN_PROPERTY, "G_DBUS_ERROR_UNKNOWN_PROPERTY", "unknown-property" }, ++ { G_DBUS_ERROR_PROPERTY_READ_ONLY, "G_DBUS_ERROR_PROPERTY_READ_ONLY", "property-read-only" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GDBusError"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_connection_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_CONNECTION_FLAGS_NONE, "G_DBUS_CONNECTION_FLAGS_NONE", "none" }, ++ { G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT", "authentication-client" }, ++ { G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER, "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER", "authentication-server" }, ++ { G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS, "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS", "authentication-allow-anonymous" }, ++ { G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION, "G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION", "message-bus-connection" }, ++ { G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, "G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING", "delay-message-processing" }, ++ { G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER, "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER", "authentication-require-same-user" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusConnectionFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_capability_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_CAPABILITY_FLAGS_NONE, "G_DBUS_CAPABILITY_FLAGS_NONE", "none" }, ++ { G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING, "G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING", "unix-fd-passing" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusCapabilityFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_call_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_CALL_FLAGS_NONE, "G_DBUS_CALL_FLAGS_NONE", "none" }, ++ { G_DBUS_CALL_FLAGS_NO_AUTO_START, "G_DBUS_CALL_FLAGS_NO_AUTO_START", "no-auto-start" }, ++ { G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, "G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION", "allow-interactive-authorization" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusCallFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_message_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_DBUS_MESSAGE_TYPE_INVALID, "G_DBUS_MESSAGE_TYPE_INVALID", "invalid" }, ++ { G_DBUS_MESSAGE_TYPE_METHOD_CALL, "G_DBUS_MESSAGE_TYPE_METHOD_CALL", "method-call" }, ++ { G_DBUS_MESSAGE_TYPE_METHOD_RETURN, "G_DBUS_MESSAGE_TYPE_METHOD_RETURN", "method-return" }, ++ { G_DBUS_MESSAGE_TYPE_ERROR, "G_DBUS_MESSAGE_TYPE_ERROR", "error" }, ++ { G_DBUS_MESSAGE_TYPE_SIGNAL, "G_DBUS_MESSAGE_TYPE_SIGNAL", "signal" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GDBusMessageType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_message_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_MESSAGE_FLAGS_NONE, "G_DBUS_MESSAGE_FLAGS_NONE", "none" }, ++ { G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED, "G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED", "no-reply-expected" }, ++ { G_DBUS_MESSAGE_FLAGS_NO_AUTO_START, "G_DBUS_MESSAGE_FLAGS_NO_AUTO_START", "no-auto-start" }, ++ { G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, "G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION", "allow-interactive-authorization" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusMessageFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_message_header_field_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_DBUS_MESSAGE_HEADER_FIELD_INVALID, "G_DBUS_MESSAGE_HEADER_FIELD_INVALID", "invalid" }, ++ { G_DBUS_MESSAGE_HEADER_FIELD_PATH, "G_DBUS_MESSAGE_HEADER_FIELD_PATH", "path" }, ++ { G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE, "G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE", "interface" }, ++ { G_DBUS_MESSAGE_HEADER_FIELD_MEMBER, "G_DBUS_MESSAGE_HEADER_FIELD_MEMBER", "member" }, ++ { G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME, "G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME", "error-name" }, ++ { G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL, "G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL", "reply-serial" }, ++ { G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION, "G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION", "destination" }, ++ { G_DBUS_MESSAGE_HEADER_FIELD_SENDER, "G_DBUS_MESSAGE_HEADER_FIELD_SENDER", "sender" }, ++ { G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE, "G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE", "signature" }, ++ { G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS, "G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS", "num-unix-fds" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GDBusMessageHeaderField"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_property_info_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_PROPERTY_INFO_FLAGS_NONE, "G_DBUS_PROPERTY_INFO_FLAGS_NONE", "none" }, ++ { G_DBUS_PROPERTY_INFO_FLAGS_READABLE, "G_DBUS_PROPERTY_INFO_FLAGS_READABLE", "readable" }, ++ { G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, "G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE", "writable" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusPropertyInfoFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_subtree_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_SUBTREE_FLAGS_NONE, "G_DBUS_SUBTREE_FLAGS_NONE", "none" }, ++ { G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES, "G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES", "dispatch-to-unenumerated-nodes" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusSubtreeFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_server_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_SERVER_FLAGS_NONE, "G_DBUS_SERVER_FLAGS_NONE", "none" }, ++ { G_DBUS_SERVER_FLAGS_RUN_IN_THREAD, "G_DBUS_SERVER_FLAGS_RUN_IN_THREAD", "run-in-thread" }, ++ { G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS, "G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS", "authentication-allow-anonymous" }, ++ { G_DBUS_SERVER_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER, "G_DBUS_SERVER_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER", "authentication-require-same-user" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusServerFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_signal_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_SIGNAL_FLAGS_NONE, "G_DBUS_SIGNAL_FLAGS_NONE", "none" }, ++ { G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, "G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE", "no-match-rule" }, ++ { G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE, "G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE", "match-arg0-namespace" }, ++ { G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH, "G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH", "match-arg0-path" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusSignalFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_send_message_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_SEND_MESSAGE_FLAGS_NONE, "G_DBUS_SEND_MESSAGE_FLAGS_NONE", "none" }, ++ { G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL, "G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL", "preserve-serial" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusSendMessageFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_credentials_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_CREDENTIALS_TYPE_INVALID, "G_CREDENTIALS_TYPE_INVALID", "invalid" }, ++ { G_CREDENTIALS_TYPE_LINUX_UCRED, "G_CREDENTIALS_TYPE_LINUX_UCRED", "linux-ucred" }, ++ { G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED, "G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED", "freebsd-cmsgcred" }, ++ { G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED, "G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED", "openbsd-sockpeercred" }, ++ { G_CREDENTIALS_TYPE_SOLARIS_UCRED, "G_CREDENTIALS_TYPE_SOLARIS_UCRED", "solaris-ucred" }, ++ { G_CREDENTIALS_TYPE_NETBSD_UNPCBID, "G_CREDENTIALS_TYPE_NETBSD_UNPCBID", "netbsd-unpcbid" }, ++ { G_CREDENTIALS_TYPE_APPLE_XUCRED, "G_CREDENTIALS_TYPE_APPLE_XUCRED", "apple-xucred" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GCredentialsType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_message_byte_order_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN, "G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN", "big-endian" }, ++ { G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN, "G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN", "little-endian" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GDBusMessageByteOrder"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_application_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_APPLICATION_FLAGS_NONE, "G_APPLICATION_FLAGS_NONE", "flags-none" }, ++ { G_APPLICATION_IS_SERVICE, "G_APPLICATION_IS_SERVICE", "is-service" }, ++ { G_APPLICATION_IS_LAUNCHER, "G_APPLICATION_IS_LAUNCHER", "is-launcher" }, ++ { G_APPLICATION_HANDLES_OPEN, "G_APPLICATION_HANDLES_OPEN", "handles-open" }, ++ { G_APPLICATION_HANDLES_COMMAND_LINE, "G_APPLICATION_HANDLES_COMMAND_LINE", "handles-command-line" }, ++ { G_APPLICATION_SEND_ENVIRONMENT, "G_APPLICATION_SEND_ENVIRONMENT", "send-environment" }, ++ { G_APPLICATION_NON_UNIQUE, "G_APPLICATION_NON_UNIQUE", "non-unique" }, ++ { G_APPLICATION_CAN_OVERRIDE_APP_ID, "G_APPLICATION_CAN_OVERRIDE_APP_ID", "can-override-app-id" }, ++ { G_APPLICATION_ALLOW_REPLACEMENT, "G_APPLICATION_ALLOW_REPLACEMENT", "allow-replacement" }, ++ { G_APPLICATION_REPLACE, "G_APPLICATION_REPLACE", "replace" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GApplicationFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_error_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_TLS_ERROR_UNAVAILABLE, "G_TLS_ERROR_UNAVAILABLE", "unavailable" }, ++ { G_TLS_ERROR_MISC, "G_TLS_ERROR_MISC", "misc" }, ++ { G_TLS_ERROR_BAD_CERTIFICATE, "G_TLS_ERROR_BAD_CERTIFICATE", "bad-certificate" }, ++ { G_TLS_ERROR_NOT_TLS, "G_TLS_ERROR_NOT_TLS", "not-tls" }, ++ { G_TLS_ERROR_HANDSHAKE, "G_TLS_ERROR_HANDSHAKE", "handshake" }, ++ { G_TLS_ERROR_CERTIFICATE_REQUIRED, "G_TLS_ERROR_CERTIFICATE_REQUIRED", "certificate-required" }, ++ { G_TLS_ERROR_EOF, "G_TLS_ERROR_EOF", "eof" }, ++ { G_TLS_ERROR_INAPPROPRIATE_FALLBACK, "G_TLS_ERROR_INAPPROPRIATE_FALLBACK", "inappropriate-fallback" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GTlsError"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_certificate_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_TLS_CERTIFICATE_UNKNOWN_CA, "G_TLS_CERTIFICATE_UNKNOWN_CA", "unknown-ca" }, ++ { G_TLS_CERTIFICATE_BAD_IDENTITY, "G_TLS_CERTIFICATE_BAD_IDENTITY", "bad-identity" }, ++ { G_TLS_CERTIFICATE_NOT_ACTIVATED, "G_TLS_CERTIFICATE_NOT_ACTIVATED", "not-activated" }, ++ { G_TLS_CERTIFICATE_EXPIRED, "G_TLS_CERTIFICATE_EXPIRED", "expired" }, ++ { G_TLS_CERTIFICATE_REVOKED, "G_TLS_CERTIFICATE_REVOKED", "revoked" }, ++ { G_TLS_CERTIFICATE_INSECURE, "G_TLS_CERTIFICATE_INSECURE", "insecure" }, ++ { G_TLS_CERTIFICATE_GENERIC_ERROR, "G_TLS_CERTIFICATE_GENERIC_ERROR", "generic-error" }, ++ { G_TLS_CERTIFICATE_VALIDATE_ALL, "G_TLS_CERTIFICATE_VALIDATE_ALL", "validate-all" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GTlsCertificateFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_authentication_mode_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_TLS_AUTHENTICATION_NONE, "G_TLS_AUTHENTICATION_NONE", "none" }, ++ { G_TLS_AUTHENTICATION_REQUESTED, "G_TLS_AUTHENTICATION_REQUESTED", "requested" }, ++ { G_TLS_AUTHENTICATION_REQUIRED, "G_TLS_AUTHENTICATION_REQUIRED", "required" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GTlsAuthenticationMode"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_channel_binding_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_TLS_CHANNEL_BINDING_TLS_UNIQUE, "G_TLS_CHANNEL_BINDING_TLS_UNIQUE", "unique" }, ++ { G_TLS_CHANNEL_BINDING_TLS_SERVER_END_POINT, "G_TLS_CHANNEL_BINDING_TLS_SERVER_END_POINT", "server-end-point" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GTlsChannelBindingType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_channel_binding_error_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_TLS_CHANNEL_BINDING_ERROR_NOT_IMPLEMENTED, "G_TLS_CHANNEL_BINDING_ERROR_NOT_IMPLEMENTED", "not-implemented" }, ++ { G_TLS_CHANNEL_BINDING_ERROR_INVALID_STATE, "G_TLS_CHANNEL_BINDING_ERROR_INVALID_STATE", "invalid-state" }, ++ { G_TLS_CHANNEL_BINDING_ERROR_NOT_AVAILABLE, "G_TLS_CHANNEL_BINDING_ERROR_NOT_AVAILABLE", "not-available" }, ++ { G_TLS_CHANNEL_BINDING_ERROR_NOT_SUPPORTED, "G_TLS_CHANNEL_BINDING_ERROR_NOT_SUPPORTED", "not-supported" }, ++ { G_TLS_CHANNEL_BINDING_ERROR_GENERAL_ERROR, "G_TLS_CHANNEL_BINDING_ERROR_GENERAL_ERROR", "general-error" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GTlsChannelBindingError"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_rehandshake_mode_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_TLS_REHANDSHAKE_NEVER, "G_TLS_REHANDSHAKE_NEVER", "never" }, ++ { G_TLS_REHANDSHAKE_SAFELY, "G_TLS_REHANDSHAKE_SAFELY", "safely" }, ++ { G_TLS_REHANDSHAKE_UNSAFELY, "G_TLS_REHANDSHAKE_UNSAFELY", "unsafely" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GTlsRehandshakeMode"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_password_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_TLS_PASSWORD_NONE, "G_TLS_PASSWORD_NONE", "none" }, ++ { G_TLS_PASSWORD_RETRY, "G_TLS_PASSWORD_RETRY", "retry" }, ++ { G_TLS_PASSWORD_MANY_TRIES, "G_TLS_PASSWORD_MANY_TRIES", "many-tries" }, ++ { G_TLS_PASSWORD_FINAL_TRY, "G_TLS_PASSWORD_FINAL_TRY", "final-try" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GTlsPasswordFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_interaction_result_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_TLS_INTERACTION_UNHANDLED, "G_TLS_INTERACTION_UNHANDLED", "unhandled" }, ++ { G_TLS_INTERACTION_HANDLED, "G_TLS_INTERACTION_HANDLED", "handled" }, ++ { G_TLS_INTERACTION_FAILED, "G_TLS_INTERACTION_FAILED", "failed" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GTlsInteractionResult"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_interface_skeleton_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_INTERFACE_SKELETON_FLAGS_NONE, "G_DBUS_INTERFACE_SKELETON_FLAGS_NONE", "none" }, ++ { G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD, "G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD", "handle-method-invocations-in-thread" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusInterfaceSkeletonFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_dbus_object_manager_client_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE, "G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE", "none" }, ++ { G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START, "G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START", "do-not-auto-start" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GDBusObjectManagerClientFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_database_verify_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_TLS_DATABASE_VERIFY_NONE, "G_TLS_DATABASE_VERIFY_NONE", "none" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GTlsDatabaseVerifyFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_database_lookup_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_TLS_DATABASE_LOOKUP_NONE, "G_TLS_DATABASE_LOOKUP_NONE", "none" }, ++ { G_TLS_DATABASE_LOOKUP_KEYPAIR, "G_TLS_DATABASE_LOOKUP_KEYPAIR", "keypair" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GTlsDatabaseLookupFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_tls_certificate_request_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_TLS_CERTIFICATE_REQUEST_NONE, "G_TLS_CERTIFICATE_REQUEST_NONE", "none" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GTlsCertificateRequestFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_io_module_scope_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_IO_MODULE_SCOPE_NONE, "G_IO_MODULE_SCOPE_NONE", "none" }, ++ { G_IO_MODULE_SCOPE_BLOCK_DUPLICATES, "G_IO_MODULE_SCOPE_BLOCK_DUPLICATES", "block-duplicates" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GIOModuleScopeFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_socket_client_event_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_SOCKET_CLIENT_RESOLVING, "G_SOCKET_CLIENT_RESOLVING", "resolving" }, ++ { G_SOCKET_CLIENT_RESOLVED, "G_SOCKET_CLIENT_RESOLVED", "resolved" }, ++ { G_SOCKET_CLIENT_CONNECTING, "G_SOCKET_CLIENT_CONNECTING", "connecting" }, ++ { G_SOCKET_CLIENT_CONNECTED, "G_SOCKET_CLIENT_CONNECTED", "connected" }, ++ { G_SOCKET_CLIENT_PROXY_NEGOTIATING, "G_SOCKET_CLIENT_PROXY_NEGOTIATING", "proxy-negotiating" }, ++ { G_SOCKET_CLIENT_PROXY_NEGOTIATED, "G_SOCKET_CLIENT_PROXY_NEGOTIATED", "proxy-negotiated" }, ++ { G_SOCKET_CLIENT_TLS_HANDSHAKING, "G_SOCKET_CLIENT_TLS_HANDSHAKING", "tls-handshaking" }, ++ { G_SOCKET_CLIENT_TLS_HANDSHAKED, "G_SOCKET_CLIENT_TLS_HANDSHAKED", "tls-handshaked" }, ++ { G_SOCKET_CLIENT_COMPLETE, "G_SOCKET_CLIENT_COMPLETE", "complete" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GSocketClientEvent"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_socket_listener_event_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_SOCKET_LISTENER_BINDING, "G_SOCKET_LISTENER_BINDING", "binding" }, ++ { G_SOCKET_LISTENER_BOUND, "G_SOCKET_LISTENER_BOUND", "bound" }, ++ { G_SOCKET_LISTENER_LISTENING, "G_SOCKET_LISTENER_LISTENING", "listening" }, ++ { G_SOCKET_LISTENER_LISTENED, "G_SOCKET_LISTENER_LISTENED", "listened" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GSocketListenerEvent"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_test_dbus_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_TEST_DBUS_NONE, "G_TEST_DBUS_NONE", "none" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GTestDBusFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_subprocess_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_SUBPROCESS_FLAGS_NONE, "G_SUBPROCESS_FLAGS_NONE", "none" }, ++ { G_SUBPROCESS_FLAGS_STDIN_PIPE, "G_SUBPROCESS_FLAGS_STDIN_PIPE", "stdin-pipe" }, ++ { G_SUBPROCESS_FLAGS_STDIN_INHERIT, "G_SUBPROCESS_FLAGS_STDIN_INHERIT", "stdin-inherit" }, ++ { G_SUBPROCESS_FLAGS_STDOUT_PIPE, "G_SUBPROCESS_FLAGS_STDOUT_PIPE", "stdout-pipe" }, ++ { G_SUBPROCESS_FLAGS_STDOUT_SILENCE, "G_SUBPROCESS_FLAGS_STDOUT_SILENCE", "stdout-silence" }, ++ { G_SUBPROCESS_FLAGS_STDERR_PIPE, "G_SUBPROCESS_FLAGS_STDERR_PIPE", "stderr-pipe" }, ++ { G_SUBPROCESS_FLAGS_STDERR_SILENCE, "G_SUBPROCESS_FLAGS_STDERR_SILENCE", "stderr-silence" }, ++ { G_SUBPROCESS_FLAGS_STDERR_MERGE, "G_SUBPROCESS_FLAGS_STDERR_MERGE", "stderr-merge" }, ++ { G_SUBPROCESS_FLAGS_INHERIT_FDS, "G_SUBPROCESS_FLAGS_INHERIT_FDS", "inherit-fds" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GSubprocessFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_notification_priority_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_NOTIFICATION_PRIORITY_NORMAL, "G_NOTIFICATION_PRIORITY_NORMAL", "normal" }, ++ { G_NOTIFICATION_PRIORITY_LOW, "G_NOTIFICATION_PRIORITY_LOW", "low" }, ++ { G_NOTIFICATION_PRIORITY_HIGH, "G_NOTIFICATION_PRIORITY_HIGH", "high" }, ++ { G_NOTIFICATION_PRIORITY_URGENT, "G_NOTIFICATION_PRIORITY_URGENT", "urgent" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GNotificationPriority"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_network_connectivity_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_NETWORK_CONNECTIVITY_LOCAL, "G_NETWORK_CONNECTIVITY_LOCAL", "local" }, ++ { G_NETWORK_CONNECTIVITY_LIMITED, "G_NETWORK_CONNECTIVITY_LIMITED", "limited" }, ++ { G_NETWORK_CONNECTIVITY_PORTAL, "G_NETWORK_CONNECTIVITY_PORTAL", "portal" }, ++ { G_NETWORK_CONNECTIVITY_FULL, "G_NETWORK_CONNECTIVITY_FULL", "full" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GNetworkConnectivity"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_pollable_return_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_POLLABLE_RETURN_FAILED, "G_POLLABLE_RETURN_FAILED", "failed" }, ++ { G_POLLABLE_RETURN_OK, "G_POLLABLE_RETURN_OK", "ok" }, ++ { G_POLLABLE_RETURN_WOULD_BLOCK, "G_POLLABLE_RETURN_WOULD_BLOCK", "would-block" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GPollableReturn"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_memory_monitor_warning_level_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_MEMORY_MONITOR_WARNING_LEVEL_LOW, "G_MEMORY_MONITOR_WARNING_LEVEL_LOW", "low" }, ++ { G_MEMORY_MONITOR_WARNING_LEVEL_MEDIUM, "G_MEMORY_MONITOR_WARNING_LEVEL_MEDIUM", "medium" }, ++ { G_MEMORY_MONITOR_WARNING_LEVEL_CRITICAL, "G_MEMORY_MONITOR_WARNING_LEVEL_CRITICAL", "critical" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GMemoryMonitorWarningLevel"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++/* enumerations from "../gio/gresolver.h" */ ++GType ++g_resolver_name_lookup_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT, "G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT", "default" }, ++ { G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY, "G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY", "ipv4-only" }, ++ { G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY, "G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY", "ipv6-only" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GResolverNameLookupFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++/* enumerations from "../gio/gsettings.h" */ ++GType ++g_settings_bind_flags_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GFlagsValue values[] = { ++ { G_SETTINGS_BIND_DEFAULT, "G_SETTINGS_BIND_DEFAULT", "default" }, ++ { G_SETTINGS_BIND_GET, "G_SETTINGS_BIND_GET", "get" }, ++ { G_SETTINGS_BIND_SET, "G_SETTINGS_BIND_SET", "set" }, ++ { G_SETTINGS_BIND_NO_SENSITIVITY, "G_SETTINGS_BIND_NO_SENSITIVITY", "no-sensitivity" }, ++ { G_SETTINGS_BIND_GET_NO_CHANGES, "G_SETTINGS_BIND_GET_NO_CHANGES", "get-no-changes" }, ++ { G_SETTINGS_BIND_INVERT_BOOLEAN, "G_SETTINGS_BIND_INVERT_BOOLEAN", "invert-boolean" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_flags_register_static (g_intern_static_string ("GSettingsBindFlags"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++ ++/* Generated data ends here */ ++ +diff --git a/gio/gioenumtypes.h b/gio/gioenumtypes.h +new file mode 100644 +index 0000000..201be60 +--- /dev/null ++++ b/gio/gioenumtypes.h +@@ -0,0 +1,183 @@ ++ ++/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ ++ ++#ifndef __GIO_ENUM_TYPES_H__ ++#define __GIO_ENUM_TYPES_H__ ++ ++#include ++ ++G_BEGIN_DECLS ++ ++/* enumerations from "../gio/gioenums.h" */ ++GLIB_AVAILABLE_IN_ALL GType g_app_info_create_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_APP_INFO_CREATE_FLAGS (g_app_info_create_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_converter_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_CONVERTER_FLAGS (g_converter_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_converter_result_get_type (void) G_GNUC_CONST; ++#define G_TYPE_CONVERTER_RESULT (g_converter_result_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_data_stream_byte_order_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DATA_STREAM_BYTE_ORDER (g_data_stream_byte_order_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_data_stream_newline_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DATA_STREAM_NEWLINE_TYPE (g_data_stream_newline_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_file_attribute_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILE_ATTRIBUTE_TYPE (g_file_attribute_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_file_attribute_info_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS (g_file_attribute_info_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_file_attribute_status_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILE_ATTRIBUTE_STATUS (g_file_attribute_status_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_file_query_info_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILE_QUERY_INFO_FLAGS (g_file_query_info_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_file_create_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILE_CREATE_FLAGS (g_file_create_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_file_measure_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILE_MEASURE_FLAGS (g_file_measure_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_mount_mount_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_MOUNT_MOUNT_FLAGS (g_mount_mount_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_mount_unmount_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_MOUNT_UNMOUNT_FLAGS (g_mount_unmount_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_drive_start_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DRIVE_START_FLAGS (g_drive_start_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_drive_start_stop_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DRIVE_START_STOP_TYPE (g_drive_start_stop_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_file_copy_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILE_COPY_FLAGS (g_file_copy_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_file_monitor_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILE_MONITOR_FLAGS (g_file_monitor_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_file_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILE_TYPE (g_file_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_filesystem_preview_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILESYSTEM_PREVIEW_TYPE (g_filesystem_preview_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_file_monitor_event_get_type (void) G_GNUC_CONST; ++#define G_TYPE_FILE_MONITOR_EVENT (g_file_monitor_event_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_io_error_enum_get_type (void) G_GNUC_CONST; ++#define G_TYPE_IO_ERROR_ENUM (g_io_error_enum_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_ask_password_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_ASK_PASSWORD_FLAGS (g_ask_password_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_password_save_get_type (void) G_GNUC_CONST; ++#define G_TYPE_PASSWORD_SAVE (g_password_save_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_mount_operation_result_get_type (void) G_GNUC_CONST; ++#define G_TYPE_MOUNT_OPERATION_RESULT (g_mount_operation_result_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_output_stream_splice_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS (g_output_stream_splice_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_io_stream_splice_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_IO_STREAM_SPLICE_FLAGS (g_io_stream_splice_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_emblem_origin_get_type (void) G_GNUC_CONST; ++#define G_TYPE_EMBLEM_ORIGIN (g_emblem_origin_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_resolver_error_get_type (void) G_GNUC_CONST; ++#define G_TYPE_RESOLVER_ERROR (g_resolver_error_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_resolver_record_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_RESOLVER_RECORD_TYPE (g_resolver_record_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_resource_error_get_type (void) G_GNUC_CONST; ++#define G_TYPE_RESOURCE_ERROR (g_resource_error_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_resource_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_RESOURCE_FLAGS (g_resource_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_resource_lookup_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_RESOURCE_LOOKUP_FLAGS (g_resource_lookup_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_socket_family_get_type (void) G_GNUC_CONST; ++#define G_TYPE_SOCKET_FAMILY (g_socket_family_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_socket_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_SOCKET_TYPE (g_socket_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_socket_msg_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_SOCKET_MSG_FLAGS (g_socket_msg_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_socket_protocol_get_type (void) G_GNUC_CONST; ++#define G_TYPE_SOCKET_PROTOCOL (g_socket_protocol_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_zlib_compressor_format_get_type (void) G_GNUC_CONST; ++#define G_TYPE_ZLIB_COMPRESSOR_FORMAT (g_zlib_compressor_format_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_unix_socket_address_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_UNIX_SOCKET_ADDRESS_TYPE (g_unix_socket_address_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_bus_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_BUS_TYPE (g_bus_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_bus_name_owner_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_BUS_NAME_OWNER_FLAGS (g_bus_name_owner_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_bus_name_watcher_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_BUS_NAME_WATCHER_FLAGS (g_bus_name_watcher_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_proxy_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_PROXY_FLAGS (g_dbus_proxy_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_error_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_ERROR (g_dbus_error_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_connection_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_CONNECTION_FLAGS (g_dbus_connection_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_capability_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_CAPABILITY_FLAGS (g_dbus_capability_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_call_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_CALL_FLAGS (g_dbus_call_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_message_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_MESSAGE_TYPE (g_dbus_message_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_message_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_MESSAGE_FLAGS (g_dbus_message_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_message_header_field_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_MESSAGE_HEADER_FIELD (g_dbus_message_header_field_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_property_info_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_PROPERTY_INFO_FLAGS (g_dbus_property_info_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_subtree_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_SUBTREE_FLAGS (g_dbus_subtree_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_server_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_SERVER_FLAGS (g_dbus_server_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_signal_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_SIGNAL_FLAGS (g_dbus_signal_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_send_message_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_SEND_MESSAGE_FLAGS (g_dbus_send_message_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_credentials_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_CREDENTIALS_TYPE (g_credentials_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_message_byte_order_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_MESSAGE_BYTE_ORDER (g_dbus_message_byte_order_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_application_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_APPLICATION_FLAGS (g_application_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_error_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_ERROR (g_tls_error_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_certificate_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_CERTIFICATE_FLAGS (g_tls_certificate_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_authentication_mode_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_AUTHENTICATION_MODE (g_tls_authentication_mode_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_channel_binding_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_CHANNEL_BINDING_TYPE (g_tls_channel_binding_type_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_channel_binding_error_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_CHANNEL_BINDING_ERROR (g_tls_channel_binding_error_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_rehandshake_mode_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_REHANDSHAKE_MODE (g_tls_rehandshake_mode_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_password_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_PASSWORD_FLAGS (g_tls_password_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_interaction_result_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_INTERACTION_RESULT (g_tls_interaction_result_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_interface_skeleton_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_INTERFACE_SKELETON_FLAGS (g_dbus_interface_skeleton_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_dbus_object_manager_client_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_DBUS_OBJECT_MANAGER_CLIENT_FLAGS (g_dbus_object_manager_client_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_database_verify_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_DATABASE_VERIFY_FLAGS (g_tls_database_verify_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_database_lookup_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_DATABASE_LOOKUP_FLAGS (g_tls_database_lookup_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_tls_certificate_request_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TLS_CERTIFICATE_REQUEST_FLAGS (g_tls_certificate_request_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_io_module_scope_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_IO_MODULE_SCOPE_FLAGS (g_io_module_scope_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_socket_client_event_get_type (void) G_GNUC_CONST; ++#define G_TYPE_SOCKET_CLIENT_EVENT (g_socket_client_event_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_socket_listener_event_get_type (void) G_GNUC_CONST; ++#define G_TYPE_SOCKET_LISTENER_EVENT (g_socket_listener_event_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_test_dbus_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_TEST_DBUS_FLAGS (g_test_dbus_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_subprocess_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_SUBPROCESS_FLAGS (g_subprocess_flags_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_notification_priority_get_type (void) G_GNUC_CONST; ++#define G_TYPE_NOTIFICATION_PRIORITY (g_notification_priority_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_network_connectivity_get_type (void) G_GNUC_CONST; ++#define G_TYPE_NETWORK_CONNECTIVITY (g_network_connectivity_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_pollable_return_get_type (void) G_GNUC_CONST; ++#define G_TYPE_POLLABLE_RETURN (g_pollable_return_get_type ()) ++GLIB_AVAILABLE_IN_ALL GType g_memory_monitor_warning_level_get_type (void) G_GNUC_CONST; ++#define G_TYPE_MEMORY_MONITOR_WARNING_LEVEL (g_memory_monitor_warning_level_get_type ()) ++ ++/* enumerations from "../gio/gresolver.h" */ ++GLIB_AVAILABLE_IN_ALL GType g_resolver_name_lookup_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_RESOLVER_NAME_LOOKUP_FLAGS (g_resolver_name_lookup_flags_get_type ()) ++ ++/* enumerations from "../gio/gsettings.h" */ ++GLIB_AVAILABLE_IN_ALL GType g_settings_bind_flags_get_type (void) G_GNUC_CONST; ++#define G_TYPE_SETTINGS_BIND_FLAGS (g_settings_bind_flags_get_type ()) ++G_END_DECLS ++ ++#endif /* __GIO_ENUM_TYPES_H__ */ ++ ++/* Generated data ends here */ ++ +diff --git a/gio/gnetworking.h b/gio/gnetworking.h +new file mode 100644 +index 0000000..1f1124a +--- /dev/null ++++ b/gio/gnetworking.h +@@ -0,0 +1,78 @@ ++/* GIO - GLib Input, Output and Streaming Library ++ * ++ * Copyright (C) 2008-2011 Red Hat, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, see . ++ */ ++ ++#ifndef __G_NETWORKING_H__ ++#define __G_NETWORKING_H__ ++ ++#include ++ ++#ifdef G_OS_WIN32 ++#include ++#include ++#include ++#include ++#include ++#include ++#undef interface ++ ++#else /* !G_OS_WIN32 */ ++ ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++ ++#ifndef T_SRV ++#define T_SRV 33 ++#endif ++ ++#ifndef _PATH_RESCONF ++#define _PATH_RESCONF "/etc/resolv.conf" ++#endif ++ ++#ifndef CMSG_LEN ++/* CMSG_LEN and CMSG_SPACE are defined by RFC 2292, but missing on ++ * some older platforms. ++ */ ++#define CMSG_LEN(len) ((size_t)CMSG_DATA((struct cmsghdr *)NULL) + (len)) ++ ++/* CMSG_SPACE must add at least as much padding as CMSG_NXTHDR() ++ * adds. We overestimate here. ++ */ ++#define GLIB_ALIGN_TO_SIZEOF(len, obj) (((len) + sizeof (obj) - 1) & ~(sizeof (obj) - 1)) ++#define CMSG_SPACE(len) GLIB_ALIGN_TO_SIZEOF (CMSG_LEN (len), struct cmsghdr) ++#endif ++#endif ++ ++G_BEGIN_DECLS ++ ++GLIB_AVAILABLE_IN_2_36 ++void g_networking_init (void); ++ ++G_END_DECLS ++ ++#endif /* __G_NETWORKING_H__ */ +diff --git a/gio/meson.build b/gio/meson.build +index 49a37a7..492add3 100644 +--- a/gio/meson.build ++++ b/gio/meson.build +@@ -962,6 +962,7 @@ gio_querymodules = executable('gio-querymodules', 'gio-querymodules.c', 'giomodu + c_args : gio_c_args, + # intl.lib is not compatible with SAFESEH + link_args : noseh_link_args, ++ install_dir: glib_libexecdir, + dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) + + glib_compile_schemas = executable('glib-compile-schemas', +diff --git a/gio/tests/desktop-files/home/applications/epiphany-weather-for-toronto-island-9c6a4e022b b/gio/tests/desktop-files/home/applications/epiphany-weather-for-toronto-island-9c6a4e022b +new file mode 100644 +index 0000000..83976e0 +--- /dev/null ++++ b/gio/tests/desktop-files/home/applications/epiphany-weather-for-toronto-island-9c6a4e022b +@@ -0,0 +1,7 @@ ++[Desktop Entry] ++Name=Weather for Toronto Island ++Exec=true ++StartupNotify=true ++Terminal=false ++Type=Application ++StartupWMClass=epiphany-weather-for-toronto-island-9c6a4e022b17686306243dada811d550d25eb1fb +diff --git a/gio/xdp-dbus.c b/gio/xdp-dbus.c +new file mode 100644 +index 0000000..1372db7 +--- /dev/null ++++ b/gio/xdp-dbus.c +@@ -0,0 +1,7909 @@ ++/* ++ * This file is generated by gdbus-codegen, do not modify it. ++ * ++ * The license of this code is the same as for the D-Bus interface description ++ * it was derived from. Note that it links to GLib, so must comply with the ++ * LGPL linking clauses. ++ */ ++ ++#ifdef HAVE_CONFIG_H ++# include "config.h" ++#endif ++ ++#include "xdp-dbus.h" ++ ++#include ++#ifdef G_OS_UNIX ++# include ++#endif ++ ++typedef struct ++{ ++ GDBusArgInfo parent_struct; ++ gboolean use_gvariant; ++} _ExtendedGDBusArgInfo; ++ ++typedef struct ++{ ++ GDBusMethodInfo parent_struct; ++ const gchar *signal_name; ++ gboolean pass_fdlist; ++} _ExtendedGDBusMethodInfo; ++ ++typedef struct ++{ ++ GDBusSignalInfo parent_struct; ++ const gchar *signal_name; ++} _ExtendedGDBusSignalInfo; ++ ++typedef struct ++{ ++ GDBusPropertyInfo parent_struct; ++ const gchar *hyphen_name; ++ guint use_gvariant : 1; ++ guint emits_changed_signal : 1; ++} _ExtendedGDBusPropertyInfo; ++ ++typedef struct ++{ ++ GDBusInterfaceInfo parent_struct; ++ const gchar *hyphen_name; ++} _ExtendedGDBusInterfaceInfo; ++ ++typedef struct ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ guint prop_id; ++ GValue orig_value; /* the value before the change */ ++} ChangedProperty; ++ ++static void ++_changed_property_free (ChangedProperty *data) ++{ ++ g_value_unset (&data->orig_value); ++ g_free (data); ++} ++ ++static gboolean ++_g_strv_equal0 (gchar **a, gchar **b) ++{ ++ gboolean ret = FALSE; ++ guint n; ++ if (a == NULL && b == NULL) ++ { ++ ret = TRUE; ++ goto out; ++ } ++ if (a == NULL || b == NULL) ++ goto out; ++ if (g_strv_length (a) != g_strv_length (b)) ++ goto out; ++ for (n = 0; a[n] != NULL; n++) ++ if (g_strcmp0 (a[n], b[n]) != 0) ++ goto out; ++ ret = TRUE; ++out: ++ return ret; ++} ++ ++static gboolean ++_g_variant_equal0 (GVariant *a, GVariant *b) ++{ ++ gboolean ret = FALSE; ++ if (a == NULL && b == NULL) ++ { ++ ret = TRUE; ++ goto out; ++ } ++ if (a == NULL || b == NULL) ++ goto out; ++ ret = g_variant_equal (a, b); ++out: ++ return ret; ++} ++ ++G_GNUC_UNUSED static gboolean ++_g_value_equal (const GValue *a, const GValue *b) ++{ ++ gboolean ret = FALSE; ++ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); ++ switch (G_VALUE_TYPE (a)) ++ { ++ case G_TYPE_BOOLEAN: ++ ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); ++ break; ++ case G_TYPE_UCHAR: ++ ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); ++ break; ++ case G_TYPE_INT: ++ ret = (g_value_get_int (a) == g_value_get_int (b)); ++ break; ++ case G_TYPE_UINT: ++ ret = (g_value_get_uint (a) == g_value_get_uint (b)); ++ break; ++ case G_TYPE_INT64: ++ ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); ++ break; ++ case G_TYPE_UINT64: ++ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); ++ break; ++ case G_TYPE_DOUBLE: ++ { ++ /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ ++ gdouble da = g_value_get_double (a); ++ gdouble db = g_value_get_double (b); ++ ret = memcmp (&da, &db, sizeof (gdouble)) == 0; ++ } ++ break; ++ case G_TYPE_STRING: ++ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); ++ break; ++ case G_TYPE_VARIANT: ++ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); ++ break; ++ default: ++ if (G_VALUE_TYPE (a) == G_TYPE_STRV) ++ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); ++ else ++ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); ++ break; ++ } ++ return ret; ++} ++ ++/* ------------------------------------------------------------------------ ++ * Code for interface org.freedesktop.portal.Documents ++ * ------------------------------------------------------------------------ ++ */ ++ ++/** ++ * SECTION:GXdpDocuments ++ * @title: GXdpDocuments ++ * @short_description: Generated C code for the org.freedesktop.portal.Documents D-Bus interface ++ * ++ * This section contains code for working with the org.freedesktop.portal.Documents D-Bus interface in C. ++ */ ++ ++/* ---- Introspection data for org.freedesktop.portal.Documents ---- */ ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_get_mount_point_OUT_ARG_path = ++{ ++ { ++ -1, ++ (gchar *) "path", ++ (gchar *) "ay", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_get_mount_point_OUT_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_get_mount_point_OUT_ARG_path.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_get_mount_point = ++{ ++ { ++ -1, ++ (gchar *) "GetMountPoint", ++ NULL, ++ (GDBusArgInfo **) &_gxdp_documents_method_info_get_mount_point_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-get-mount-point", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_IN_ARG_o_path_fd = ++{ ++ { ++ -1, ++ (gchar *) "o_path_fd", ++ (gchar *) "h", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_IN_ARG_reuse_existing = ++{ ++ { ++ -1, ++ (gchar *) "reuse_existing", ++ (gchar *) "b", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_IN_ARG_persistent = ++{ ++ { ++ -1, ++ (gchar *) "persistent", ++ (gchar *) "b", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_add_IN_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_add_IN_ARG_o_path_fd.parent_struct, ++ &_gxdp_documents_method_info_add_IN_ARG_reuse_existing.parent_struct, ++ &_gxdp_documents_method_info_add_IN_ARG_persistent.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_OUT_ARG_doc_id = ++{ ++ { ++ -1, ++ (gchar *) "doc_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_add_OUT_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_add_OUT_ARG_doc_id.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_add = ++{ ++ { ++ -1, ++ (gchar *) "Add", ++ (GDBusArgInfo **) &_gxdp_documents_method_info_add_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_documents_method_info_add_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-add", ++ TRUE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_IN_ARG_o_path_parent_fd = ++{ ++ { ++ -1, ++ (gchar *) "o_path_parent_fd", ++ (gchar *) "h", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_IN_ARG_filename = ++{ ++ { ++ -1, ++ (gchar *) "filename", ++ (gchar *) "ay", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_IN_ARG_reuse_existing = ++{ ++ { ++ -1, ++ (gchar *) "reuse_existing", ++ (gchar *) "b", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_IN_ARG_persistent = ++{ ++ { ++ -1, ++ (gchar *) "persistent", ++ (gchar *) "b", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_add_named_IN_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_add_named_IN_ARG_o_path_parent_fd.parent_struct, ++ &_gxdp_documents_method_info_add_named_IN_ARG_filename.parent_struct, ++ &_gxdp_documents_method_info_add_named_IN_ARG_reuse_existing.parent_struct, ++ &_gxdp_documents_method_info_add_named_IN_ARG_persistent.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_OUT_ARG_doc_id = ++{ ++ { ++ -1, ++ (gchar *) "doc_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_add_named_OUT_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_add_named_OUT_ARG_doc_id.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_add_named = ++{ ++ { ++ -1, ++ (gchar *) "AddNamed", ++ (GDBusArgInfo **) &_gxdp_documents_method_info_add_named_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_documents_method_info_add_named_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-add-named", ++ TRUE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_IN_ARG_o_path_fds = ++{ ++ { ++ -1, ++ (gchar *) "o_path_fds", ++ (gchar *) "ah", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_IN_ARG_flags = ++{ ++ { ++ -1, ++ (gchar *) "flags", ++ (gchar *) "u", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_IN_ARG_app_id = ++{ ++ { ++ -1, ++ (gchar *) "app_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_IN_ARG_permissions = ++{ ++ { ++ -1, ++ (gchar *) "permissions", ++ (gchar *) "as", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_add_full_IN_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_add_full_IN_ARG_o_path_fds.parent_struct, ++ &_gxdp_documents_method_info_add_full_IN_ARG_flags.parent_struct, ++ &_gxdp_documents_method_info_add_full_IN_ARG_app_id.parent_struct, ++ &_gxdp_documents_method_info_add_full_IN_ARG_permissions.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_OUT_ARG_doc_ids = ++{ ++ { ++ -1, ++ (gchar *) "doc_ids", ++ (gchar *) "as", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_OUT_ARG_extra_out = ++{ ++ { ++ -1, ++ (gchar *) "extra_out", ++ (gchar *) "a{sv}", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_add_full_OUT_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_add_full_OUT_ARG_doc_ids.parent_struct, ++ &_gxdp_documents_method_info_add_full_OUT_ARG_extra_out.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_add_full = ++{ ++ { ++ -1, ++ (gchar *) "AddFull", ++ (GDBusArgInfo **) &_gxdp_documents_method_info_add_full_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_documents_method_info_add_full_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-add-full", ++ TRUE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_IN_ARG_o_path_fd = ++{ ++ { ++ -1, ++ (gchar *) "o_path_fd", ++ (gchar *) "h", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_IN_ARG_filename = ++{ ++ { ++ -1, ++ (gchar *) "filename", ++ (gchar *) "ay", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_IN_ARG_flags = ++{ ++ { ++ -1, ++ (gchar *) "flags", ++ (gchar *) "u", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_IN_ARG_app_id = ++{ ++ { ++ -1, ++ (gchar *) "app_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_IN_ARG_permissions = ++{ ++ { ++ -1, ++ (gchar *) "permissions", ++ (gchar *) "as", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_add_named_full_IN_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_add_named_full_IN_ARG_o_path_fd.parent_struct, ++ &_gxdp_documents_method_info_add_named_full_IN_ARG_filename.parent_struct, ++ &_gxdp_documents_method_info_add_named_full_IN_ARG_flags.parent_struct, ++ &_gxdp_documents_method_info_add_named_full_IN_ARG_app_id.parent_struct, ++ &_gxdp_documents_method_info_add_named_full_IN_ARG_permissions.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_OUT_ARG_doc_id = ++{ ++ { ++ -1, ++ (gchar *) "doc_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_OUT_ARG_extra_out = ++{ ++ { ++ -1, ++ (gchar *) "extra_out", ++ (gchar *) "a{sv}", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_add_named_full_OUT_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_add_named_full_OUT_ARG_doc_id.parent_struct, ++ &_gxdp_documents_method_info_add_named_full_OUT_ARG_extra_out.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_add_named_full = ++{ ++ { ++ -1, ++ (gchar *) "AddNamedFull", ++ (GDBusArgInfo **) &_gxdp_documents_method_info_add_named_full_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_documents_method_info_add_named_full_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-add-named-full", ++ TRUE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_grant_permissions_IN_ARG_doc_id = ++{ ++ { ++ -1, ++ (gchar *) "doc_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_grant_permissions_IN_ARG_app_id = ++{ ++ { ++ -1, ++ (gchar *) "app_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_grant_permissions_IN_ARG_permissions = ++{ ++ { ++ -1, ++ (gchar *) "permissions", ++ (gchar *) "as", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_grant_permissions_IN_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_grant_permissions_IN_ARG_doc_id.parent_struct, ++ &_gxdp_documents_method_info_grant_permissions_IN_ARG_app_id.parent_struct, ++ &_gxdp_documents_method_info_grant_permissions_IN_ARG_permissions.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_grant_permissions = ++{ ++ { ++ -1, ++ (gchar *) "GrantPermissions", ++ (GDBusArgInfo **) &_gxdp_documents_method_info_grant_permissions_IN_ARG_pointers, ++ NULL, ++ NULL ++ }, ++ "handle-grant-permissions", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_revoke_permissions_IN_ARG_doc_id = ++{ ++ { ++ -1, ++ (gchar *) "doc_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_revoke_permissions_IN_ARG_app_id = ++{ ++ { ++ -1, ++ (gchar *) "app_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_revoke_permissions_IN_ARG_permissions = ++{ ++ { ++ -1, ++ (gchar *) "permissions", ++ (gchar *) "as", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_revoke_permissions_IN_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_revoke_permissions_IN_ARG_doc_id.parent_struct, ++ &_gxdp_documents_method_info_revoke_permissions_IN_ARG_app_id.parent_struct, ++ &_gxdp_documents_method_info_revoke_permissions_IN_ARG_permissions.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_revoke_permissions = ++{ ++ { ++ -1, ++ (gchar *) "RevokePermissions", ++ (GDBusArgInfo **) &_gxdp_documents_method_info_revoke_permissions_IN_ARG_pointers, ++ NULL, ++ NULL ++ }, ++ "handle-revoke-permissions", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_delete_IN_ARG_doc_id = ++{ ++ { ++ -1, ++ (gchar *) "doc_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_delete_IN_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_delete_IN_ARG_doc_id.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_delete = ++{ ++ { ++ -1, ++ (gchar *) "Delete", ++ (GDBusArgInfo **) &_gxdp_documents_method_info_delete_IN_ARG_pointers, ++ NULL, ++ NULL ++ }, ++ "handle-delete", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_lookup_IN_ARG_filename = ++{ ++ { ++ -1, ++ (gchar *) "filename", ++ (gchar *) "ay", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_lookup_IN_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_lookup_IN_ARG_filename.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_lookup_OUT_ARG_doc_id = ++{ ++ { ++ -1, ++ (gchar *) "doc_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_lookup_OUT_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_lookup_OUT_ARG_doc_id.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_lookup = ++{ ++ { ++ -1, ++ (gchar *) "Lookup", ++ (GDBusArgInfo **) &_gxdp_documents_method_info_lookup_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_documents_method_info_lookup_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-lookup", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_info_IN_ARG_doc_id = ++{ ++ { ++ -1, ++ (gchar *) "doc_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_info_IN_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_info_IN_ARG_doc_id.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_info_OUT_ARG_path = ++{ ++ { ++ -1, ++ (gchar *) "path", ++ (gchar *) "ay", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_info_OUT_ARG_apps = ++{ ++ { ++ -1, ++ (gchar *) "apps", ++ (gchar *) "a{sas}", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_info_OUT_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_info_OUT_ARG_path.parent_struct, ++ &_gxdp_documents_method_info_info_OUT_ARG_apps.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_info = ++{ ++ { ++ -1, ++ (gchar *) "Info", ++ (GDBusArgInfo **) &_gxdp_documents_method_info_info_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_documents_method_info_info_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-info", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_list_IN_ARG_app_id = ++{ ++ { ++ -1, ++ (gchar *) "app_id", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_list_IN_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_list_IN_ARG_app_id.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_list_OUT_ARG_docs = ++{ ++ { ++ -1, ++ (gchar *) "docs", ++ (gchar *) "a{say}", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_documents_method_info_list_OUT_ARG_pointers[] = ++{ ++ &_gxdp_documents_method_info_list_OUT_ARG_docs.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_list = ++{ ++ { ++ -1, ++ (gchar *) "List", ++ (GDBusArgInfo **) &_gxdp_documents_method_info_list_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_documents_method_info_list_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-list", ++ FALSE ++}; ++ ++static const GDBusMethodInfo * const _gxdp_documents_method_info_pointers[] = ++{ ++ &_gxdp_documents_method_info_get_mount_point.parent_struct, ++ &_gxdp_documents_method_info_add.parent_struct, ++ &_gxdp_documents_method_info_add_named.parent_struct, ++ &_gxdp_documents_method_info_add_full.parent_struct, ++ &_gxdp_documents_method_info_add_named_full.parent_struct, ++ &_gxdp_documents_method_info_grant_permissions.parent_struct, ++ &_gxdp_documents_method_info_revoke_permissions.parent_struct, ++ &_gxdp_documents_method_info_delete.parent_struct, ++ &_gxdp_documents_method_info_lookup.parent_struct, ++ &_gxdp_documents_method_info_info.parent_struct, ++ &_gxdp_documents_method_info_list.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusPropertyInfo _gxdp_documents_property_info_version = ++{ ++ { ++ -1, ++ (gchar *) "version", ++ (gchar *) "u", ++ G_DBUS_PROPERTY_INFO_FLAGS_READABLE, ++ NULL ++ }, ++ "version", ++ FALSE, ++ TRUE ++}; ++ ++static const GDBusPropertyInfo * const _gxdp_documents_property_info_pointers[] = ++{ ++ &_gxdp_documents_property_info_version.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusInterfaceInfo _gxdp_documents_interface_info = ++{ ++ { ++ -1, ++ (gchar *) "org.freedesktop.portal.Documents", ++ (GDBusMethodInfo **) &_gxdp_documents_method_info_pointers, ++ NULL, ++ (GDBusPropertyInfo **) &_gxdp_documents_property_info_pointers, ++ NULL ++ }, ++ "documents", ++}; ++ ++ ++/** ++ * gxdp_documents_interface_info: ++ * ++ * Gets a machine-readable description of the org.freedesktop.portal.Documents D-Bus interface. ++ * ++ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. ++ */ ++GDBusInterfaceInfo * ++gxdp_documents_interface_info (void) ++{ ++ return (GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct; ++} ++ ++/** ++ * gxdp_documents_override_properties: ++ * @klass: The class structure for a #GObject derived class. ++ * @property_id_begin: The property id to assign to the first overridden property. ++ * ++ * Overrides all #GObject properties in the #GXdpDocuments interface for a concrete class. ++ * The properties are overridden in the order they are defined. ++ * ++ * Returns: The last property id. ++ */ ++guint ++gxdp_documents_override_properties (GObjectClass *klass, guint property_id_begin) ++{ ++ g_object_class_override_property (klass, property_id_begin++, "version"); ++ return property_id_begin - 1; ++} ++ ++ ++ ++/** ++ * GXdpDocuments: ++ * ++ * Abstract interface type for the D-Bus interface org.freedesktop.portal.Documents. ++ */ ++ ++/** ++ * GXdpDocumentsIface: ++ * @parent_iface: The parent interface. ++ * @handle_add: Handler for the #GXdpDocuments::handle-add signal. ++ * @handle_add_full: Handler for the #GXdpDocuments::handle-add-full signal. ++ * @handle_add_named: Handler for the #GXdpDocuments::handle-add-named signal. ++ * @handle_add_named_full: Handler for the #GXdpDocuments::handle-add-named-full signal. ++ * @handle_delete: Handler for the #GXdpDocuments::handle-delete signal. ++ * @handle_get_mount_point: Handler for the #GXdpDocuments::handle-get-mount-point signal. ++ * @handle_grant_permissions: Handler for the #GXdpDocuments::handle-grant-permissions signal. ++ * @handle_info: Handler for the #GXdpDocuments::handle-info signal. ++ * @handle_list: Handler for the #GXdpDocuments::handle-list signal. ++ * @handle_lookup: Handler for the #GXdpDocuments::handle-lookup signal. ++ * @handle_revoke_permissions: Handler for the #GXdpDocuments::handle-revoke-permissions signal. ++ * @get_version: Getter for the #GXdpDocuments:version property. ++ * ++ * Virtual table for the D-Bus interface org.freedesktop.portal.Documents. ++ */ ++ ++typedef GXdpDocumentsIface GXdpDocumentsInterface; ++G_DEFINE_INTERFACE (GXdpDocuments, gxdp_documents, G_TYPE_OBJECT) ++ ++static void ++gxdp_documents_default_init (GXdpDocumentsIface *iface) ++{ ++ /* GObject signals for incoming D-Bus method calls: */ ++ /** ++ * GXdpDocuments::handle-get-mount-point: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * ++ * Signal emitted when a remote caller is invoking the GetMountPoint() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_get_mount_point() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-get-mount-point", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_get_mount_point), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 1, ++ G_TYPE_DBUS_METHOD_INVOCATION); ++ ++ /** ++ * GXdpDocuments::handle-add: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @arg_o_path_fd: Argument passed by remote caller. ++ * @arg_reuse_existing: Argument passed by remote caller. ++ * @arg_persistent: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the Add() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_add() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-add", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_add), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 5, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); ++ ++ /** ++ * GXdpDocuments::handle-add-named: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @arg_o_path_parent_fd: Argument passed by remote caller. ++ * @arg_filename: Argument passed by remote caller. ++ * @arg_reuse_existing: Argument passed by remote caller. ++ * @arg_persistent: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the AddNamed() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_add_named() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-add-named", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_add_named), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 6, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); ++ ++ /** ++ * GXdpDocuments::handle-add-full: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @arg_o_path_fds: Argument passed by remote caller. ++ * @arg_flags: Argument passed by remote caller. ++ * @arg_app_id: Argument passed by remote caller. ++ * @arg_permissions: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the AddFull() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_add_full() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-add-full", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_add_full), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 6, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRV); ++ ++ /** ++ * GXdpDocuments::handle-add-named-full: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @arg_o_path_fd: Argument passed by remote caller. ++ * @arg_filename: Argument passed by remote caller. ++ * @arg_flags: Argument passed by remote caller. ++ * @arg_app_id: Argument passed by remote caller. ++ * @arg_permissions: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the AddNamedFull() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_add_named_full() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-add-named-full", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_add_named_full), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 7, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRV); ++ ++ /** ++ * GXdpDocuments::handle-grant-permissions: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_doc_id: Argument passed by remote caller. ++ * @arg_app_id: Argument passed by remote caller. ++ * @arg_permissions: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the GrantPermissions() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_grant_permissions() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-grant-permissions", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_grant_permissions), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 4, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRV); ++ ++ /** ++ * GXdpDocuments::handle-revoke-permissions: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_doc_id: Argument passed by remote caller. ++ * @arg_app_id: Argument passed by remote caller. ++ * @arg_permissions: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the RevokePermissions() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_revoke_permissions() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-revoke-permissions", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_revoke_permissions), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 4, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRV); ++ ++ /** ++ * GXdpDocuments::handle-delete: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_doc_id: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the Delete() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_delete() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-delete", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_delete), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * GXdpDocuments::handle-lookup: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_filename: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the Lookup() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_lookup() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-lookup", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_lookup), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * GXdpDocuments::handle-info: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_doc_id: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the Info() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_info() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-info", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_info), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /** ++ * GXdpDocuments::handle-list: ++ * @object: A #GXdpDocuments. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_app_id: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the List() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_list() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-list", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpDocumentsIface, handle_list), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /* GObject properties for D-Bus properties: */ ++ /** ++ * GXdpDocuments:version: ++ * ++ * Represents the D-Bus property "version". ++ * ++ * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. ++ */ ++ g_object_interface_install_property (iface, ++ g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++} ++ ++/** ++ * gxdp_documents_get_version: (skip) ++ * @object: A #GXdpDocuments. ++ * ++ * Gets the value of the "version" D-Bus property. ++ * ++ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. ++ * ++ * Returns: The property value. ++ */ ++guint ++gxdp_documents_get_version (GXdpDocuments *object) ++{ ++ return GXDP_DOCUMENTS_GET_IFACE (object)->get_version (object); ++} ++ ++/** ++ * gxdp_documents_set_version: (skip) ++ * @object: A #GXdpDocuments. ++ * @value: The value to set. ++ * ++ * Sets the "version" D-Bus property to @value. ++ * ++ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. ++ */ ++void ++gxdp_documents_set_version (GXdpDocuments *object, guint value) ++{ ++ g_object_set (G_OBJECT (object), "version", value, NULL); ++} ++ ++/** ++ * gxdp_documents_call_get_mount_point: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the GetMountPoint() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_get_mount_point_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_get_mount_point_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_get_mount_point ( ++ GXdpDocuments *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "GetMountPoint", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_get_mount_point_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @out_path: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_get_mount_point(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_get_mount_point(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_get_mount_point_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_path, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^ay)", ++ out_path); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_get_mount_point_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @out_path: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the GetMountPoint() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_get_mount_point() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_get_mount_point_sync ( ++ GXdpDocuments *proxy, ++ gchar **out_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "GetMountPoint", ++ g_variant_new ("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^ay)", ++ out_path); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_add: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_o_path_fd: Argument to pass with the method invocation. ++ * @arg_reuse_existing: Argument to pass with the method invocation. ++ * @arg_persistent: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the Add() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_add_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_add_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_add ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fd, ++ gboolean arg_reuse_existing, ++ gboolean arg_persistent, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy), ++ "Add", ++ g_variant_new ("(@hbb)", ++ arg_o_path_fd, ++ arg_reuse_existing, ++ arg_persistent), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_add_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_add(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_add_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_doc_id, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_doc_id); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_add_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_o_path_fd: Argument to pass with the method invocation. ++ * @arg_reuse_existing: Argument to pass with the method invocation. ++ * @arg_persistent: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the Add() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_add() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_add_sync ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fd, ++ gboolean arg_reuse_existing, ++ gboolean arg_persistent, ++ GUnixFDList *fd_list, ++ gchar **out_doc_id, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy), ++ "Add", ++ g_variant_new ("(@hbb)", ++ arg_o_path_fd, ++ arg_reuse_existing, ++ arg_persistent), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ out_fd_list, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_doc_id); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_add_named: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_o_path_parent_fd: Argument to pass with the method invocation. ++ * @arg_filename: Argument to pass with the method invocation. ++ * @arg_reuse_existing: Argument to pass with the method invocation. ++ * @arg_persistent: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the AddNamed() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_add_named_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_add_named_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_add_named ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_parent_fd, ++ const gchar *arg_filename, ++ gboolean arg_reuse_existing, ++ gboolean arg_persistent, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy), ++ "AddNamed", ++ g_variant_new ("(@h^aybb)", ++ arg_o_path_parent_fd, ++ arg_filename, ++ arg_reuse_existing, ++ arg_persistent), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_add_named_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add_named(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_add_named(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_add_named_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_doc_id, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_doc_id); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_add_named_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_o_path_parent_fd: Argument to pass with the method invocation. ++ * @arg_filename: Argument to pass with the method invocation. ++ * @arg_reuse_existing: Argument to pass with the method invocation. ++ * @arg_persistent: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the AddNamed() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_add_named() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_add_named_sync ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_parent_fd, ++ const gchar *arg_filename, ++ gboolean arg_reuse_existing, ++ gboolean arg_persistent, ++ GUnixFDList *fd_list, ++ gchar **out_doc_id, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy), ++ "AddNamed", ++ g_variant_new ("(@h^aybb)", ++ arg_o_path_parent_fd, ++ arg_filename, ++ arg_reuse_existing, ++ arg_persistent), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ out_fd_list, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_doc_id); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_add_full: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_o_path_fds: Argument to pass with the method invocation. ++ * @arg_flags: Argument to pass with the method invocation. ++ * @arg_app_id: Argument to pass with the method invocation. ++ * @arg_permissions: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the AddFull() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_add_full_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_add_full_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_add_full ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fds, ++ guint arg_flags, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy), ++ "AddFull", ++ g_variant_new ("(@ahus^as)", ++ arg_o_path_fds, ++ arg_flags, ++ arg_app_id, ++ arg_permissions), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_add_full_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @out_doc_ids: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. ++ * @out_extra_out: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add_full(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_add_full(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_add_full_finish ( ++ GXdpDocuments *proxy, ++ gchar ***out_doc_ids, ++ GVariant **out_extra_out, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^as@a{sv})", ++ out_doc_ids, ++ out_extra_out); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_add_full_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_o_path_fds: Argument to pass with the method invocation. ++ * @arg_flags: Argument to pass with the method invocation. ++ * @arg_app_id: Argument to pass with the method invocation. ++ * @arg_permissions: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @out_doc_ids: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. ++ * @out_extra_out: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the AddFull() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_add_full() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_add_full_sync ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fds, ++ guint arg_flags, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GUnixFDList *fd_list, ++ gchar ***out_doc_ids, ++ GVariant **out_extra_out, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy), ++ "AddFull", ++ g_variant_new ("(@ahus^as)", ++ arg_o_path_fds, ++ arg_flags, ++ arg_app_id, ++ arg_permissions), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ out_fd_list, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^as@a{sv})", ++ out_doc_ids, ++ out_extra_out); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_add_named_full: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_o_path_fd: Argument to pass with the method invocation. ++ * @arg_filename: Argument to pass with the method invocation. ++ * @arg_flags: Argument to pass with the method invocation. ++ * @arg_app_id: Argument to pass with the method invocation. ++ * @arg_permissions: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the AddNamedFull() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_add_named_full_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_add_named_full_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_add_named_full ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fd, ++ const gchar *arg_filename, ++ guint arg_flags, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy), ++ "AddNamedFull", ++ g_variant_new ("(@h^ayus^as)", ++ arg_o_path_fd, ++ arg_filename, ++ arg_flags, ++ arg_app_id, ++ arg_permissions), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_add_named_full_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_extra_out: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add_named_full(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_add_named_full(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_add_named_full_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_doc_id, ++ GVariant **out_extra_out, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s@a{sv})", ++ out_doc_id, ++ out_extra_out); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_add_named_full_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_o_path_fd: Argument to pass with the method invocation. ++ * @arg_filename: Argument to pass with the method invocation. ++ * @arg_flags: Argument to pass with the method invocation. ++ * @arg_app_id: Argument to pass with the method invocation. ++ * @arg_permissions: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_extra_out: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the AddNamedFull() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_add_named_full() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_add_named_full_sync ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fd, ++ const gchar *arg_filename, ++ guint arg_flags, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GUnixFDList *fd_list, ++ gchar **out_doc_id, ++ GVariant **out_extra_out, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy), ++ "AddNamedFull", ++ g_variant_new ("(@h^ayus^as)", ++ arg_o_path_fd, ++ arg_filename, ++ arg_flags, ++ arg_app_id, ++ arg_permissions), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ out_fd_list, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s@a{sv})", ++ out_doc_id, ++ out_extra_out); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_grant_permissions: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_doc_id: Argument to pass with the method invocation. ++ * @arg_app_id: Argument to pass with the method invocation. ++ * @arg_permissions: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the GrantPermissions() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_grant_permissions_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_grant_permissions_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_grant_permissions ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "GrantPermissions", ++ g_variant_new ("(ss^as)", ++ arg_doc_id, ++ arg_app_id, ++ arg_permissions), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_grant_permissions_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_grant_permissions(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_grant_permissions(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_grant_permissions_finish ( ++ GXdpDocuments *proxy, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_grant_permissions_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_doc_id: Argument to pass with the method invocation. ++ * @arg_app_id: Argument to pass with the method invocation. ++ * @arg_permissions: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the GrantPermissions() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_grant_permissions() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_grant_permissions_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "GrantPermissions", ++ g_variant_new ("(ss^as)", ++ arg_doc_id, ++ arg_app_id, ++ arg_permissions), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_revoke_permissions: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_doc_id: Argument to pass with the method invocation. ++ * @arg_app_id: Argument to pass with the method invocation. ++ * @arg_permissions: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the RevokePermissions() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_revoke_permissions_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_revoke_permissions_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_revoke_permissions ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "RevokePermissions", ++ g_variant_new ("(ss^as)", ++ arg_doc_id, ++ arg_app_id, ++ arg_permissions), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_revoke_permissions_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_revoke_permissions(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_revoke_permissions(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_revoke_permissions_finish ( ++ GXdpDocuments *proxy, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_revoke_permissions_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_doc_id: Argument to pass with the method invocation. ++ * @arg_app_id: Argument to pass with the method invocation. ++ * @arg_permissions: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the RevokePermissions() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_revoke_permissions() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_revoke_permissions_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "RevokePermissions", ++ g_variant_new ("(ss^as)", ++ arg_doc_id, ++ arg_app_id, ++ arg_permissions), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_delete: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_doc_id: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the Delete() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_delete_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_delete_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_delete ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "Delete", ++ g_variant_new ("(s)", ++ arg_doc_id), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_delete_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_delete(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_delete(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_delete_finish ( ++ GXdpDocuments *proxy, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_delete_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_doc_id: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the Delete() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_delete() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_delete_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "Delete", ++ g_variant_new ("(s)", ++ arg_doc_id), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "()"); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_lookup: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_filename: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the Lookup() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_lookup_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_lookup_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_lookup ( ++ GXdpDocuments *proxy, ++ const gchar *arg_filename, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "Lookup", ++ g_variant_new ("(^ay)", ++ arg_filename), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_lookup_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_lookup(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_lookup(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_lookup_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_doc_id, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_doc_id); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_lookup_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_filename: Argument to pass with the method invocation. ++ * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the Lookup() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_lookup() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_lookup_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_filename, ++ gchar **out_doc_id, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "Lookup", ++ g_variant_new ("(^ay)", ++ arg_filename), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(s)", ++ out_doc_id); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_info: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_doc_id: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the Info() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_info_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_info_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_info ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "Info", ++ g_variant_new ("(s)", ++ arg_doc_id), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_info_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @out_path: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_apps: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_info(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_info(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_info_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_path, ++ GVariant **out_apps, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^ay@a{sas})", ++ out_path, ++ out_apps); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_info_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_doc_id: Argument to pass with the method invocation. ++ * @out_path: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_apps: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the Info() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_info() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_info_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ gchar **out_path, ++ GVariant **out_apps, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "Info", ++ g_variant_new ("(s)", ++ arg_doc_id), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^ay@a{sas})", ++ out_path, ++ out_apps); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_list: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_app_id: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the List() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_call_list_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_call_list_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_documents_call_list ( ++ GXdpDocuments *proxy, ++ const gchar *arg_app_id, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "List", ++ g_variant_new ("(s)", ++ arg_app_id), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_documents_call_list_finish: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @out_docs: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_list(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_documents_call_list(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_list_finish ( ++ GXdpDocuments *proxy, ++ GVariant **out_docs, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(@a{say})", ++ out_docs); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_call_list_sync: ++ * @proxy: A #GXdpDocumentsProxy. ++ * @arg_app_id: Argument to pass with the method invocation. ++ * @out_docs: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the List() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_call_list() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_documents_call_list_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_app_id, ++ GVariant **out_docs, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "List", ++ g_variant_new ("(s)", ++ arg_app_id), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(@a{say})", ++ out_docs); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_documents_complete_get_mount_point: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @path: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the GetMountPoint() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_get_mount_point ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *path) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(^ay)", ++ path)); ++} ++ ++/** ++ * gxdp_documents_complete_add: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @doc_id: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the Add() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_add ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *doc_id) ++{ ++ g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, ++ g_variant_new ("(s)", ++ doc_id), ++ fd_list); ++} ++ ++/** ++ * gxdp_documents_complete_add_named: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @doc_id: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the AddNamed() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_add_named ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *doc_id) ++{ ++ g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, ++ g_variant_new ("(s)", ++ doc_id), ++ fd_list); ++} ++ ++/** ++ * gxdp_documents_complete_add_full: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @doc_ids: Parameter to return. ++ * @extra_out: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the AddFull() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_add_full ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *const *doc_ids, ++ GVariant *extra_out) ++{ ++ g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, ++ g_variant_new ("(^as@a{sv})", ++ doc_ids, ++ extra_out), ++ fd_list); ++} ++ ++/** ++ * gxdp_documents_complete_add_named_full: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @doc_id: Parameter to return. ++ * @extra_out: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the AddNamedFull() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_add_named_full ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *doc_id, ++ GVariant *extra_out) ++{ ++ g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, ++ g_variant_new ("(s@a{sv})", ++ doc_id, ++ extra_out), ++ fd_list); ++} ++ ++/** ++ * gxdp_documents_complete_grant_permissions: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * ++ * Helper function used in service implementations to finish handling invocations of the GrantPermissions() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_grant_permissions ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("()")); ++} ++ ++/** ++ * gxdp_documents_complete_revoke_permissions: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * ++ * Helper function used in service implementations to finish handling invocations of the RevokePermissions() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_revoke_permissions ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("()")); ++} ++ ++/** ++ * gxdp_documents_complete_delete: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * ++ * Helper function used in service implementations to finish handling invocations of the Delete() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_delete ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("()")); ++} ++ ++/** ++ * gxdp_documents_complete_lookup: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @doc_id: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the Lookup() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_lookup ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *doc_id) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(s)", ++ doc_id)); ++} ++ ++/** ++ * gxdp_documents_complete_info: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @path: Parameter to return. ++ * @apps: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the Info() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_info ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *path, ++ GVariant *apps) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(^ay@a{sas})", ++ path, ++ apps)); ++} ++ ++/** ++ * gxdp_documents_complete_list: ++ * @object: A #GXdpDocuments. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @docs: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the List() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_documents_complete_list ( ++ GXdpDocuments *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ GVariant *docs) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(@a{say})", ++ docs)); ++} ++ ++/* ------------------------------------------------------------------------ */ ++ ++/** ++ * GXdpDocumentsProxy: ++ * ++ * The #GXdpDocumentsProxy structure contains only private data and should only be accessed using the provided API. ++ */ ++ ++/** ++ * GXdpDocumentsProxyClass: ++ * @parent_class: The parent class. ++ * ++ * Class structure for #GXdpDocumentsProxy. ++ */ ++ ++struct _GXdpDocumentsProxyPrivate ++{ ++ GData *qdata; ++}; ++ ++static void gxdp_documents_proxy_iface_init (GXdpDocumentsIface *iface); ++ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsProxy, gxdp_documents_proxy, G_TYPE_DBUS_PROXY, ++ G_ADD_PRIVATE (GXdpDocumentsProxy) ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_proxy_iface_init)) ++ ++#else ++G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsProxy, gxdp_documents_proxy, G_TYPE_DBUS_PROXY, ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_proxy_iface_init)) ++ ++#endif ++static void ++gxdp_documents_proxy_finalize (GObject *object) ++{ ++ GXdpDocumentsProxy *proxy = GXDP_DOCUMENTS_PROXY (object); ++ g_datalist_clear (&proxy->priv->qdata); ++ G_OBJECT_CLASS (gxdp_documents_proxy_parent_class)->finalize (object); ++} ++ ++static void ++gxdp_documents_proxy_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GVariant *variant; ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_documents_property_info_pointers[prop_id - 1]; ++ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); ++ if (info->use_gvariant) ++ { ++ g_value_set_variant (value, variant); ++ } ++ else ++ { ++ if (variant != NULL) ++ g_dbus_gvariant_to_gvalue (variant, value); ++ } ++ if (variant != NULL) ++ g_variant_unref (variant); ++} ++ ++static void ++gxdp_documents_proxy_set_property_cb (GDBusProxy *proxy, ++ GAsyncResult *res, ++ gpointer user_data) ++{ ++ const _ExtendedGDBusPropertyInfo *info = user_data; ++ GError *error; ++ GVariant *_ret; ++ error = NULL; ++ _ret = g_dbus_proxy_call_finish (proxy, res, &error); ++ if (!_ret) ++ { ++ g_warning ("Error setting property '%s' on interface org.freedesktop.portal.Documents: %s (%s, %d)", ++ info->parent_struct.name, ++ error->message, g_quark_to_string (error->domain), error->code); ++ g_error_free (error); ++ } ++ else ++ { ++ g_variant_unref (_ret); ++ } ++} ++ ++static void ++gxdp_documents_proxy_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GVariant *variant; ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_documents_property_info_pointers[prop_id - 1]; ++ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); ++ g_dbus_proxy_call (G_DBUS_PROXY (object), ++ "org.freedesktop.DBus.Properties.Set", ++ g_variant_new ("(ssv)", "org.freedesktop.portal.Documents", info->parent_struct.name, variant), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, (GAsyncReadyCallback) gxdp_documents_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); ++ g_variant_unref (variant); ++} ++ ++static void ++gxdp_documents_proxy_g_signal (GDBusProxy *proxy, ++ const gchar *sender_name G_GNUC_UNUSED, ++ const gchar *signal_name, ++ GVariant *parameters) ++{ ++ _ExtendedGDBusSignalInfo *info; ++ GVariantIter iter; ++ GVariant *child; ++ GValue *paramv; ++ gsize num_params; ++ gsize n; ++ guint signal_id; ++ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct, signal_name); ++ if (info == NULL) ++ return; ++ num_params = g_variant_n_children (parameters); ++ paramv = g_new0 (GValue, num_params + 1); ++ g_value_init (¶mv[0], GXDP_TYPE_DOCUMENTS); ++ g_value_set_object (¶mv[0], proxy); ++ g_variant_iter_init (&iter, parameters); ++ n = 1; ++ while ((child = g_variant_iter_next_value (&iter)) != NULL) ++ { ++ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; ++ if (arg_info->use_gvariant) ++ { ++ g_value_init (¶mv[n], G_TYPE_VARIANT); ++ g_value_set_variant (¶mv[n], child); ++ n++; ++ } ++ else ++ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); ++ g_variant_unref (child); ++ } ++ signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_DOCUMENTS); ++ g_signal_emitv (paramv, signal_id, 0, NULL); ++ for (n = 0; n < num_params + 1; n++) ++ g_value_unset (¶mv[n]); ++ g_free (paramv); ++} ++ ++static void ++gxdp_documents_proxy_g_properties_changed (GDBusProxy *_proxy, ++ GVariant *changed_properties, ++ const gchar *const *invalidated_properties) ++{ ++ GXdpDocumentsProxy *proxy = GXDP_DOCUMENTS_PROXY (_proxy); ++ guint n; ++ const gchar *key; ++ GVariantIter *iter; ++ _ExtendedGDBusPropertyInfo *info; ++ g_variant_get (changed_properties, "a{sv}", &iter); ++ while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) ++ { ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct, key); ++ g_datalist_remove_data (&proxy->priv->qdata, key); ++ if (info != NULL) ++ g_object_notify (G_OBJECT (proxy), info->hyphen_name); ++ } ++ g_variant_iter_free (iter); ++ for (n = 0; invalidated_properties[n] != NULL; n++) ++ { ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct, invalidated_properties[n]); ++ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); ++ if (info != NULL) ++ g_object_notify (G_OBJECT (proxy), info->hyphen_name); ++ } ++} ++ ++static guint ++gxdp_documents_proxy_get_version (GXdpDocuments *object) ++{ ++ GXdpDocumentsProxy *proxy = GXDP_DOCUMENTS_PROXY (object); ++ GVariant *variant; ++ guint value = 0; ++ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version"); ++ if (variant != NULL) ++ { ++ value = g_variant_get_uint32 (variant); ++ g_variant_unref (variant); ++ } ++ return value; ++} ++ ++static void ++gxdp_documents_proxy_init (GXdpDocumentsProxy *proxy) ++{ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++ proxy->priv = gxdp_documents_proxy_get_instance_private (proxy); ++#else ++ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_DOCUMENTS_PROXY, GXdpDocumentsProxyPrivate); ++#endif ++ ++ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_documents_interface_info ()); ++} ++ ++static void ++gxdp_documents_proxy_class_init (GXdpDocumentsProxyClass *klass) ++{ ++ GObjectClass *gobject_class; ++ GDBusProxyClass *proxy_class; ++ ++ gobject_class = G_OBJECT_CLASS (klass); ++ gobject_class->finalize = gxdp_documents_proxy_finalize; ++ gobject_class->get_property = gxdp_documents_proxy_get_property; ++ gobject_class->set_property = gxdp_documents_proxy_set_property; ++ ++ proxy_class = G_DBUS_PROXY_CLASS (klass); ++ proxy_class->g_signal = gxdp_documents_proxy_g_signal; ++ proxy_class->g_properties_changed = gxdp_documents_proxy_g_properties_changed; ++ ++ gxdp_documents_override_properties (gobject_class, 1); ++ ++#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 ++ g_type_class_add_private (klass, sizeof (GXdpDocumentsProxyPrivate)); ++#endif ++} ++ ++static void ++gxdp_documents_proxy_iface_init (GXdpDocumentsIface *iface) ++{ ++ iface->get_version = gxdp_documents_proxy_get_version; ++} ++ ++/** ++ * gxdp_documents_proxy_new: ++ * @connection: A #GDBusConnection. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously creates a proxy for the D-Bus interface org.freedesktop.portal.Documents. See g_dbus_proxy_new() for more details. ++ * ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_proxy_new_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_proxy_new_sync() for the synchronous, blocking version of this constructor. ++ */ ++void ++gxdp_documents_proxy_new ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_async_initable_new_async (GXDP_TYPE_DOCUMENTS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Documents", NULL); ++} ++ ++/** ++ * gxdp_documents_proxy_new_finish: ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_proxy_new(). ++ * @error: Return location for error or %NULL ++ * ++ * Finishes an operation started with gxdp_documents_proxy_new(). ++ * ++ * Returns: (transfer full) (type GXdpDocumentsProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpDocuments * ++gxdp_documents_proxy_new_finish ( ++ GAsyncResult *res, ++ GError **error) ++{ ++ GObject *ret; ++ GObject *source_object; ++ source_object = g_async_result_get_source_object (res); ++ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); ++ g_object_unref (source_object); ++ if (ret != NULL) ++ return GXDP_DOCUMENTS (ret); ++ else ++ return NULL; ++} ++ ++/** ++ * gxdp_documents_proxy_new_sync: ++ * @connection: A #GDBusConnection. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL ++ * ++ * Synchronously creates a proxy for the D-Bus interface org.freedesktop.portal.Documents. See g_dbus_proxy_new_sync() for more details. ++ * ++ * The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_proxy_new() for the asynchronous version of this constructor. ++ * ++ * Returns: (transfer full) (type GXdpDocumentsProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpDocuments * ++gxdp_documents_proxy_new_sync ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GInitable *ret; ++ ret = g_initable_new (GXDP_TYPE_DOCUMENTS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Documents", NULL); ++ if (ret != NULL) ++ return GXDP_DOCUMENTS (ret); ++ else ++ return NULL; ++} ++ ++ ++/** ++ * gxdp_documents_proxy_new_for_bus: ++ * @bus_type: A #GBusType. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: A bus name (well-known or unique). ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied. ++ * @user_data: User data to pass to @callback. ++ * ++ * Like gxdp_documents_proxy_new() but takes a #GBusType instead of a #GDBusConnection. ++ * ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_documents_proxy_new_for_bus_finish() to get the result of the operation. ++ * ++ * See gxdp_documents_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. ++ */ ++void ++gxdp_documents_proxy_new_for_bus ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_async_initable_new_async (GXDP_TYPE_DOCUMENTS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Documents", NULL); ++} ++ ++/** ++ * gxdp_documents_proxy_new_for_bus_finish: ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_proxy_new_for_bus(). ++ * @error: Return location for error or %NULL ++ * ++ * Finishes an operation started with gxdp_documents_proxy_new_for_bus(). ++ * ++ * Returns: (transfer full) (type GXdpDocumentsProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpDocuments * ++gxdp_documents_proxy_new_for_bus_finish ( ++ GAsyncResult *res, ++ GError **error) ++{ ++ GObject *ret; ++ GObject *source_object; ++ source_object = g_async_result_get_source_object (res); ++ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); ++ g_object_unref (source_object); ++ if (ret != NULL) ++ return GXDP_DOCUMENTS (ret); ++ else ++ return NULL; ++} ++ ++/** ++ * gxdp_documents_proxy_new_for_bus_sync: ++ * @bus_type: A #GBusType. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: A bus name (well-known or unique). ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL ++ * ++ * Like gxdp_documents_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. ++ * ++ * The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_documents_proxy_new_for_bus() for the asynchronous version of this constructor. ++ * ++ * Returns: (transfer full) (type GXdpDocumentsProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpDocuments * ++gxdp_documents_proxy_new_for_bus_sync ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GInitable *ret; ++ ret = g_initable_new (GXDP_TYPE_DOCUMENTS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Documents", NULL); ++ if (ret != NULL) ++ return GXDP_DOCUMENTS (ret); ++ else ++ return NULL; ++} ++ ++ ++/* ------------------------------------------------------------------------ */ ++ ++/** ++ * GXdpDocumentsSkeleton: ++ * ++ * The #GXdpDocumentsSkeleton structure contains only private data and should only be accessed using the provided API. ++ */ ++ ++/** ++ * GXdpDocumentsSkeletonClass: ++ * @parent_class: The parent class. ++ * ++ * Class structure for #GXdpDocumentsSkeleton. ++ */ ++ ++struct _GXdpDocumentsSkeletonPrivate ++{ ++ GValue *properties; ++ GList *changed_properties; ++ GSource *changed_properties_idle_source; ++ GMainContext *context; ++ GMutex lock; ++}; ++ ++static void ++_gxdp_documents_skeleton_handle_method_call ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name, ++ const gchar *method_name, ++ GVariant *parameters, ++ GDBusMethodInvocation *invocation, ++ gpointer user_data) ++{ ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (user_data); ++ _ExtendedGDBusMethodInfo *info; ++ GVariantIter iter; ++ GVariant *child; ++ GValue *paramv; ++ gsize num_params; ++ guint num_extra; ++ gsize n; ++ guint signal_id; ++ GValue return_value = G_VALUE_INIT; ++ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); ++ g_assert (info != NULL); ++ num_params = g_variant_n_children (parameters); ++ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); ++ n = 0; ++ g_value_init (¶mv[n], GXDP_TYPE_DOCUMENTS); ++ g_value_set_object (¶mv[n++], skeleton); ++ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); ++ g_value_set_object (¶mv[n++], invocation); ++ if (info->pass_fdlist) ++ { ++#ifdef G_OS_UNIX ++ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); ++ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); ++#else ++ g_assert_not_reached (); ++#endif ++ } ++ g_variant_iter_init (&iter, parameters); ++ while ((child = g_variant_iter_next_value (&iter)) != NULL) ++ { ++ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; ++ if (arg_info->use_gvariant) ++ { ++ g_value_init (¶mv[n], G_TYPE_VARIANT); ++ g_value_set_variant (¶mv[n], child); ++ n++; ++ } ++ else ++ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); ++ g_variant_unref (child); ++ } ++ signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_DOCUMENTS); ++ g_value_init (&return_value, G_TYPE_BOOLEAN); ++ g_signal_emitv (paramv, signal_id, 0, &return_value); ++ if (!g_value_get_boolean (&return_value)) ++ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); ++ g_value_unset (&return_value); ++ for (n = 0; n < num_params + num_extra; n++) ++ g_value_unset (¶mv[n]); ++ g_free (paramv); ++} ++ ++static GVariant * ++_gxdp_documents_skeleton_handle_get_property ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name G_GNUC_UNUSED, ++ const gchar *property_name, ++ GError **error, ++ gpointer user_data) ++{ ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (user_data); ++ GValue value = G_VALUE_INIT; ++ GParamSpec *pspec; ++ _ExtendedGDBusPropertyInfo *info; ++ GVariant *ret; ++ ret = NULL; ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct, property_name); ++ g_assert (info != NULL); ++ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); ++ if (pspec == NULL) ++ { ++ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); ++ } ++ else ++ { ++ g_value_init (&value, pspec->value_type); ++ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); ++ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); ++ g_value_unset (&value); ++ } ++ return ret; ++} ++ ++static gboolean ++_gxdp_documents_skeleton_handle_set_property ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name G_GNUC_UNUSED, ++ const gchar *property_name, ++ GVariant *variant, ++ GError **error, ++ gpointer user_data) ++{ ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (user_data); ++ GValue value = G_VALUE_INIT; ++ GParamSpec *pspec; ++ _ExtendedGDBusPropertyInfo *info; ++ gboolean ret; ++ ret = FALSE; ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct, property_name); ++ g_assert (info != NULL); ++ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); ++ if (pspec == NULL) ++ { ++ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); ++ } ++ else ++ { ++ if (info->use_gvariant) ++ g_value_set_variant (&value, variant); ++ else ++ g_dbus_gvariant_to_gvalue (variant, &value); ++ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); ++ g_value_unset (&value); ++ ret = TRUE; ++ } ++ return ret; ++} ++ ++static const GDBusInterfaceVTable _gxdp_documents_skeleton_vtable = ++{ ++ _gxdp_documents_skeleton_handle_method_call, ++ _gxdp_documents_skeleton_handle_get_property, ++ _gxdp_documents_skeleton_handle_set_property, ++ {NULL} ++}; ++ ++static GDBusInterfaceInfo * ++gxdp_documents_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) ++{ ++ return gxdp_documents_interface_info (); ++} ++ ++static GDBusInterfaceVTable * ++gxdp_documents_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) ++{ ++ return (GDBusInterfaceVTable *) &_gxdp_documents_skeleton_vtable; ++} ++ ++static GVariant * ++gxdp_documents_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) ++{ ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (_skeleton); ++ ++ GVariantBuilder builder; ++ guint n; ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); ++ if (_gxdp_documents_interface_info.parent_struct.properties == NULL) ++ goto out; ++ for (n = 0; _gxdp_documents_interface_info.parent_struct.properties[n] != NULL; n++) ++ { ++ GDBusPropertyInfo *info = _gxdp_documents_interface_info.parent_struct.properties[n]; ++ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) ++ { ++ GVariant *value; ++ value = _gxdp_documents_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.portal.Documents", info->name, NULL, skeleton); ++ if (value != NULL) ++ { ++ g_variant_take_ref (value); ++ g_variant_builder_add (&builder, "{sv}", info->name, value); ++ g_variant_unref (value); ++ } ++ } ++ } ++out: ++ return g_variant_builder_end (&builder); ++} ++ ++static gboolean _gxdp_documents_emit_changed (gpointer user_data); ++ ++static void ++gxdp_documents_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) ++{ ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (_skeleton); ++ gboolean emit_changed = FALSE; ++ ++ g_mutex_lock (&skeleton->priv->lock); ++ if (skeleton->priv->changed_properties_idle_source != NULL) ++ { ++ g_source_destroy (skeleton->priv->changed_properties_idle_source); ++ skeleton->priv->changed_properties_idle_source = NULL; ++ emit_changed = TRUE; ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++ ++ if (emit_changed) ++ _gxdp_documents_emit_changed (skeleton); ++} ++ ++static void gxdp_documents_skeleton_iface_init (GXdpDocumentsIface *iface); ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsSkeleton, gxdp_documents_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, ++ G_ADD_PRIVATE (GXdpDocumentsSkeleton) ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_skeleton_iface_init)) ++ ++#else ++G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsSkeleton, gxdp_documents_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_skeleton_iface_init)) ++ ++#endif ++static void ++gxdp_documents_skeleton_finalize (GObject *object) ++{ ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object); ++ guint n; ++ for (n = 0; n < 1; n++) ++ g_value_unset (&skeleton->priv->properties[n]); ++ g_free (skeleton->priv->properties); ++ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); ++ if (skeleton->priv->changed_properties_idle_source != NULL) ++ g_source_destroy (skeleton->priv->changed_properties_idle_source); ++ g_main_context_unref (skeleton->priv->context); ++ g_mutex_clear (&skeleton->priv->lock); ++ G_OBJECT_CLASS (gxdp_documents_skeleton_parent_class)->finalize (object); ++} ++ ++static void ++gxdp_documents_skeleton_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object); ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ g_mutex_lock (&skeleton->priv->lock); ++ g_value_copy (&skeleton->priv->properties[prop_id - 1], value); ++ g_mutex_unlock (&skeleton->priv->lock); ++} ++ ++static gboolean ++_gxdp_documents_emit_changed (gpointer user_data) ++{ ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (user_data); ++ GList *l; ++ GVariantBuilder builder; ++ GVariantBuilder invalidated_builder; ++ guint num_changes; ++ ++ g_mutex_lock (&skeleton->priv->lock); ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); ++ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); ++ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) ++ { ++ ChangedProperty *cp = l->data; ++ GVariant *variant; ++ const GValue *cur_value; ++ ++ cur_value = &skeleton->priv->properties[cp->prop_id - 1]; ++ if (!_g_value_equal (cur_value, &cp->orig_value)) ++ { ++ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); ++ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); ++ g_variant_unref (variant); ++ num_changes++; ++ } ++ } ++ if (num_changes > 0) ++ { ++ GList *connections, *ll; ++ GVariant *signal_variant; ++ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.Documents", ++ &builder, &invalidated_builder)); ++ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); ++ for (ll = connections; ll != NULL; ll = ll->next) ++ { ++ GDBusConnection *connection = ll->data; ++ ++ g_dbus_connection_emit_signal (connection, ++ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), ++ "org.freedesktop.DBus.Properties", ++ "PropertiesChanged", ++ signal_variant, ++ NULL); ++ } ++ g_variant_unref (signal_variant); ++ g_list_free_full (connections, g_object_unref); ++ } ++ else ++ { ++ g_variant_builder_clear (&builder); ++ g_variant_builder_clear (&invalidated_builder); ++ } ++ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); ++ skeleton->priv->changed_properties = NULL; ++ skeleton->priv->changed_properties_idle_source = NULL; ++ g_mutex_unlock (&skeleton->priv->lock); ++ return FALSE; ++} ++ ++static void ++_gxdp_documents_schedule_emit_changed (GXdpDocumentsSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) ++{ ++ ChangedProperty *cp; ++ GList *l; ++ cp = NULL; ++ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) ++ { ++ ChangedProperty *i_cp = l->data; ++ if (i_cp->info == info) ++ { ++ cp = i_cp; ++ break; ++ } ++ } ++ if (cp == NULL) ++ { ++ cp = g_new0 (ChangedProperty, 1); ++ cp->prop_id = prop_id; ++ cp->info = info; ++ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); ++ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); ++ g_value_copy (orig_value, &cp->orig_value); ++ } ++} ++ ++static void ++gxdp_documents_skeleton_notify (GObject *object, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object); ++ g_mutex_lock (&skeleton->priv->lock); ++ if (skeleton->priv->changed_properties != NULL && ++ skeleton->priv->changed_properties_idle_source == NULL) ++ { ++ skeleton->priv->changed_properties_idle_source = g_idle_source_new (); ++ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); ++ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_documents_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); ++ g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_documents_emit_changed"); ++ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); ++ g_source_unref (skeleton->priv->changed_properties_idle_source); ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++} ++ ++static void ++gxdp_documents_skeleton_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object); ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_documents_property_info_pointers[prop_id - 1]; ++ g_mutex_lock (&skeleton->priv->lock); ++ g_object_freeze_notify (object); ++ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) ++ { ++ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL && ++ info->emits_changed_signal) ++ _gxdp_documents_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]); ++ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); ++ g_object_notify_by_pspec (object, pspec); ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++ g_object_thaw_notify (object); ++} ++ ++static void ++gxdp_documents_skeleton_init (GXdpDocumentsSkeleton *skeleton) ++{ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++ skeleton->priv = gxdp_documents_skeleton_get_instance_private (skeleton); ++#else ++ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_DOCUMENTS_SKELETON, GXdpDocumentsSkeletonPrivate); ++#endif ++ ++ g_mutex_init (&skeleton->priv->lock); ++ skeleton->priv->context = g_main_context_ref_thread_default (); ++ skeleton->priv->properties = g_new0 (GValue, 1); ++ g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT); ++} ++ ++static guint ++gxdp_documents_skeleton_get_version (GXdpDocuments *object) ++{ ++ GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object); ++ guint value; ++ g_mutex_lock (&skeleton->priv->lock); ++ value = g_value_get_uint (&(skeleton->priv->properties[0])); ++ g_mutex_unlock (&skeleton->priv->lock); ++ return value; ++} ++ ++static void ++gxdp_documents_skeleton_class_init (GXdpDocumentsSkeletonClass *klass) ++{ ++ GObjectClass *gobject_class; ++ GDBusInterfaceSkeletonClass *skeleton_class; ++ ++ gobject_class = G_OBJECT_CLASS (klass); ++ gobject_class->finalize = gxdp_documents_skeleton_finalize; ++ gobject_class->get_property = gxdp_documents_skeleton_get_property; ++ gobject_class->set_property = gxdp_documents_skeleton_set_property; ++ gobject_class->notify = gxdp_documents_skeleton_notify; ++ ++ ++ gxdp_documents_override_properties (gobject_class, 1); ++ ++ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); ++ skeleton_class->get_info = gxdp_documents_skeleton_dbus_interface_get_info; ++ skeleton_class->get_properties = gxdp_documents_skeleton_dbus_interface_get_properties; ++ skeleton_class->flush = gxdp_documents_skeleton_dbus_interface_flush; ++ skeleton_class->get_vtable = gxdp_documents_skeleton_dbus_interface_get_vtable; ++ ++#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 ++ g_type_class_add_private (klass, sizeof (GXdpDocumentsSkeletonPrivate)); ++#endif ++} ++ ++static void ++gxdp_documents_skeleton_iface_init (GXdpDocumentsIface *iface) ++{ ++ iface->get_version = gxdp_documents_skeleton_get_version; ++} ++ ++/** ++ * gxdp_documents_skeleton_new: ++ * ++ * Creates a skeleton object for the D-Bus interface org.freedesktop.portal.Documents. ++ * ++ * Returns: (transfer full) (type GXdpDocumentsSkeleton): The skeleton object. ++ */ ++GXdpDocuments * ++gxdp_documents_skeleton_new (void) ++{ ++ return GXDP_DOCUMENTS (g_object_new (GXDP_TYPE_DOCUMENTS_SKELETON, NULL)); ++} ++ ++/* ------------------------------------------------------------------------ ++ * Code for interface org.freedesktop.portal.OpenURI ++ * ------------------------------------------------------------------------ ++ */ ++ ++/** ++ * SECTION:GXdpOpenURI ++ * @title: GXdpOpenURI ++ * @short_description: Generated C code for the org.freedesktop.portal.OpenURI D-Bus interface ++ * ++ * This section contains code for working with the org.freedesktop.portal.OpenURI D-Bus interface in C. ++ */ ++ ++/* ---- Introspection data for org.freedesktop.portal.OpenURI ---- */ ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_IN_ARG_parent_window = ++{ ++ { ++ -1, ++ (gchar *) "parent_window", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_IN_ARG_uri = ++{ ++ { ++ -1, ++ (gchar *) "uri", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_IN_ARG_options = ++{ ++ { ++ -1, ++ (gchar *) "options", ++ (gchar *) "a{sv}", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_uri_IN_ARG_pointers[] = ++{ ++ &_gxdp_open_uri_method_info_open_uri_IN_ARG_parent_window.parent_struct, ++ &_gxdp_open_uri_method_info_open_uri_IN_ARG_uri.parent_struct, ++ &_gxdp_open_uri_method_info_open_uri_IN_ARG_options.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_OUT_ARG_handle = ++{ ++ { ++ -1, ++ (gchar *) "handle", ++ (gchar *) "o", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_uri_OUT_ARG_pointers[] = ++{ ++ &_gxdp_open_uri_method_info_open_uri_OUT_ARG_handle.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_open_uri_method_info_open_uri = ++{ ++ { ++ -1, ++ (gchar *) "OpenURI", ++ (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_uri_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_uri_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-open-uri", ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_IN_ARG_parent_window = ++{ ++ { ++ -1, ++ (gchar *) "parent_window", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_IN_ARG_fd = ++{ ++ { ++ -1, ++ (gchar *) "fd", ++ (gchar *) "h", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_IN_ARG_options = ++{ ++ { ++ -1, ++ (gchar *) "options", ++ (gchar *) "a{sv}", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_file_IN_ARG_pointers[] = ++{ ++ &_gxdp_open_uri_method_info_open_file_IN_ARG_parent_window.parent_struct, ++ &_gxdp_open_uri_method_info_open_file_IN_ARG_fd.parent_struct, ++ &_gxdp_open_uri_method_info_open_file_IN_ARG_options.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_OUT_ARG_handle = ++{ ++ { ++ -1, ++ (gchar *) "handle", ++ (gchar *) "o", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_file_OUT_ARG_pointers[] = ++{ ++ &_gxdp_open_uri_method_info_open_file_OUT_ARG_handle.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_open_uri_method_info_open_file = ++{ ++ { ++ -1, ++ (gchar *) "OpenFile", ++ (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_file_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_file_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-open-file", ++ TRUE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_IN_ARG_parent_window = ++{ ++ { ++ -1, ++ (gchar *) "parent_window", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_IN_ARG_fd = ++{ ++ { ++ -1, ++ (gchar *) "fd", ++ (gchar *) "h", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_IN_ARG_options = ++{ ++ { ++ -1, ++ (gchar *) "options", ++ (gchar *) "a{sv}", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_directory_IN_ARG_pointers[] = ++{ ++ &_gxdp_open_uri_method_info_open_directory_IN_ARG_parent_window.parent_struct, ++ &_gxdp_open_uri_method_info_open_directory_IN_ARG_fd.parent_struct, ++ &_gxdp_open_uri_method_info_open_directory_IN_ARG_options.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_OUT_ARG_handle = ++{ ++ { ++ -1, ++ (gchar *) "handle", ++ (gchar *) "o", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_directory_OUT_ARG_pointers[] = ++{ ++ &_gxdp_open_uri_method_info_open_directory_OUT_ARG_handle.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_open_uri_method_info_open_directory = ++{ ++ { ++ -1, ++ (gchar *) "OpenDirectory", ++ (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_directory_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_directory_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-open-directory", ++ TRUE ++}; ++ ++static const GDBusMethodInfo * const _gxdp_open_uri_method_info_pointers[] = ++{ ++ &_gxdp_open_uri_method_info_open_uri.parent_struct, ++ &_gxdp_open_uri_method_info_open_file.parent_struct, ++ &_gxdp_open_uri_method_info_open_directory.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusPropertyInfo _gxdp_open_uri_property_info_version = ++{ ++ { ++ -1, ++ (gchar *) "version", ++ (gchar *) "u", ++ G_DBUS_PROPERTY_INFO_FLAGS_READABLE, ++ NULL ++ }, ++ "version", ++ FALSE, ++ TRUE ++}; ++ ++static const GDBusPropertyInfo * const _gxdp_open_uri_property_info_pointers[] = ++{ ++ &_gxdp_open_uri_property_info_version.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusInterfaceInfo _gxdp_open_uri_interface_info = ++{ ++ { ++ -1, ++ (gchar *) "org.freedesktop.portal.OpenURI", ++ (GDBusMethodInfo **) &_gxdp_open_uri_method_info_pointers, ++ NULL, ++ (GDBusPropertyInfo **) &_gxdp_open_uri_property_info_pointers, ++ NULL ++ }, ++ "open-uri", ++}; ++ ++ ++/** ++ * gxdp_open_uri_interface_info: ++ * ++ * Gets a machine-readable description of the org.freedesktop.portal.OpenURI D-Bus interface. ++ * ++ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. ++ */ ++GDBusInterfaceInfo * ++gxdp_open_uri_interface_info (void) ++{ ++ return (GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct; ++} ++ ++/** ++ * gxdp_open_uri_override_properties: ++ * @klass: The class structure for a #GObject derived class. ++ * @property_id_begin: The property id to assign to the first overridden property. ++ * ++ * Overrides all #GObject properties in the #GXdpOpenURI interface for a concrete class. ++ * The properties are overridden in the order they are defined. ++ * ++ * Returns: The last property id. ++ */ ++guint ++gxdp_open_uri_override_properties (GObjectClass *klass, guint property_id_begin) ++{ ++ g_object_class_override_property (klass, property_id_begin++, "version"); ++ return property_id_begin - 1; ++} ++ ++ ++ ++/** ++ * GXdpOpenURI: ++ * ++ * Abstract interface type for the D-Bus interface org.freedesktop.portal.OpenURI. ++ */ ++ ++/** ++ * GXdpOpenURIIface: ++ * @parent_iface: The parent interface. ++ * @handle_open_directory: Handler for the #GXdpOpenURI::handle-open-directory signal. ++ * @handle_open_file: Handler for the #GXdpOpenURI::handle-open-file signal. ++ * @handle_open_uri: Handler for the #GXdpOpenURI::handle-open-uri signal. ++ * @get_version: Getter for the #GXdpOpenURI:version property. ++ * ++ * Virtual table for the D-Bus interface org.freedesktop.portal.OpenURI. ++ */ ++ ++typedef GXdpOpenURIIface GXdpOpenURIInterface; ++G_DEFINE_INTERFACE (GXdpOpenURI, gxdp_open_uri, G_TYPE_OBJECT) ++ ++static void ++gxdp_open_uri_default_init (GXdpOpenURIIface *iface) ++{ ++ /* GObject signals for incoming D-Bus method calls: */ ++ /** ++ * GXdpOpenURI::handle-open-uri: ++ * @object: A #GXdpOpenURI. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_parent_window: Argument passed by remote caller. ++ * @arg_uri: Argument passed by remote caller. ++ * @arg_options: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the OpenURI() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_open_uri_complete_open_uri() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-open-uri", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpOpenURIIface, handle_open_uri), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 4, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT); ++ ++ /** ++ * GXdpOpenURI::handle-open-file: ++ * @object: A #GXdpOpenURI. ++ * @invocation: A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @arg_parent_window: Argument passed by remote caller. ++ * @arg_fd: Argument passed by remote caller. ++ * @arg_options: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the OpenFile() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_open_uri_complete_open_file() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-open-file", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpOpenURIIface, handle_open_file), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 5, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_VARIANT); ++ ++ /** ++ * GXdpOpenURI::handle-open-directory: ++ * @object: A #GXdpOpenURI. ++ * @invocation: A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @arg_parent_window: Argument passed by remote caller. ++ * @arg_fd: Argument passed by remote caller. ++ * @arg_options: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the OpenDirectory() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_open_uri_complete_open_directory() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-open-directory", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpOpenURIIface, handle_open_directory), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 5, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_VARIANT); ++ ++ /* GObject properties for D-Bus properties: */ ++ /** ++ * GXdpOpenURI:version: ++ * ++ * Represents the D-Bus property "version". ++ * ++ * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. ++ */ ++ g_object_interface_install_property (iface, ++ g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++} ++ ++/** ++ * gxdp_open_uri_get_version: (skip) ++ * @object: A #GXdpOpenURI. ++ * ++ * Gets the value of the "version" D-Bus property. ++ * ++ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. ++ * ++ * Returns: The property value. ++ */ ++guint ++gxdp_open_uri_get_version (GXdpOpenURI *object) ++{ ++ return GXDP_OPEN_URI_GET_IFACE (object)->get_version (object); ++} ++ ++/** ++ * gxdp_open_uri_set_version: (skip) ++ * @object: A #GXdpOpenURI. ++ * @value: The value to set. ++ * ++ * Sets the "version" D-Bus property to @value. ++ * ++ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. ++ */ ++void ++gxdp_open_uri_set_version (GXdpOpenURI *object, guint value) ++{ ++ g_object_set (G_OBJECT (object), "version", value, NULL); ++} ++ ++/** ++ * gxdp_open_uri_call_open_uri: ++ * @proxy: A #GXdpOpenURIProxy. ++ * @arg_parent_window: Argument to pass with the method invocation. ++ * @arg_uri: Argument to pass with the method invocation. ++ * @arg_options: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the OpenURI() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_open_uri_call_open_uri_finish() to get the result of the operation. ++ * ++ * See gxdp_open_uri_call_open_uri_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_open_uri_call_open_uri ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ const gchar *arg_uri, ++ GVariant *arg_options, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "OpenURI", ++ g_variant_new ("(ss@a{sv})", ++ arg_parent_window, ++ arg_uri, ++ arg_options), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_open_uri_call_open_uri_finish: ++ * @proxy: A #GXdpOpenURIProxy. ++ * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_uri(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_open_uri_call_open_uri(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_open_uri_call_open_uri_finish ( ++ GXdpOpenURI *proxy, ++ gchar **out_handle, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(o)", ++ out_handle); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_open_uri_call_open_uri_sync: ++ * @proxy: A #GXdpOpenURIProxy. ++ * @arg_parent_window: Argument to pass with the method invocation. ++ * @arg_uri: Argument to pass with the method invocation. ++ * @arg_options: Argument to pass with the method invocation. ++ * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the OpenURI() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_open_uri_call_open_uri() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_open_uri_call_open_uri_sync ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ const gchar *arg_uri, ++ GVariant *arg_options, ++ gchar **out_handle, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "OpenURI", ++ g_variant_new ("(ss@a{sv})", ++ arg_parent_window, ++ arg_uri, ++ arg_options), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(o)", ++ out_handle); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_open_uri_call_open_file: ++ * @proxy: A #GXdpOpenURIProxy. ++ * @arg_parent_window: Argument to pass with the method invocation. ++ * @arg_fd: Argument to pass with the method invocation. ++ * @arg_options: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the OpenFile() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_open_uri_call_open_file_finish() to get the result of the operation. ++ * ++ * See gxdp_open_uri_call_open_file_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_open_uri_call_open_file ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ GVariant *arg_fd, ++ GVariant *arg_options, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy), ++ "OpenFile", ++ g_variant_new ("(s@h@a{sv})", ++ arg_parent_window, ++ arg_fd, ++ arg_options), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_open_uri_call_open_file_finish: ++ * @proxy: A #GXdpOpenURIProxy. ++ * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_file(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_open_uri_call_open_file(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_open_uri_call_open_file_finish ( ++ GXdpOpenURI *proxy, ++ gchar **out_handle, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(o)", ++ out_handle); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_open_uri_call_open_file_sync: ++ * @proxy: A #GXdpOpenURIProxy. ++ * @arg_parent_window: Argument to pass with the method invocation. ++ * @arg_fd: Argument to pass with the method invocation. ++ * @arg_options: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the OpenFile() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_open_uri_call_open_file() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_open_uri_call_open_file_sync ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ GVariant *arg_fd, ++ GVariant *arg_options, ++ GUnixFDList *fd_list, ++ gchar **out_handle, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy), ++ "OpenFile", ++ g_variant_new ("(s@h@a{sv})", ++ arg_parent_window, ++ arg_fd, ++ arg_options), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ out_fd_list, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(o)", ++ out_handle); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_open_uri_call_open_directory: ++ * @proxy: A #GXdpOpenURIProxy. ++ * @arg_parent_window: Argument to pass with the method invocation. ++ * @arg_fd: Argument to pass with the method invocation. ++ * @arg_options: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the OpenDirectory() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_open_uri_call_open_directory_finish() to get the result of the operation. ++ * ++ * See gxdp_open_uri_call_open_directory_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_open_uri_call_open_directory ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ GVariant *arg_fd, ++ GVariant *arg_options, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy), ++ "OpenDirectory", ++ g_variant_new ("(s@h@a{sv})", ++ arg_parent_window, ++ arg_fd, ++ arg_options), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_open_uri_call_open_directory_finish: ++ * @proxy: A #GXdpOpenURIProxy. ++ * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_directory(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_open_uri_call_open_directory(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_open_uri_call_open_directory_finish ( ++ GXdpOpenURI *proxy, ++ gchar **out_handle, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(o)", ++ out_handle); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_open_uri_call_open_directory_sync: ++ * @proxy: A #GXdpOpenURIProxy. ++ * @arg_parent_window: Argument to pass with the method invocation. ++ * @arg_fd: Argument to pass with the method invocation. ++ * @arg_options: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the OpenDirectory() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_open_uri_call_open_directory() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_open_uri_call_open_directory_sync ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ GVariant *arg_fd, ++ GVariant *arg_options, ++ GUnixFDList *fd_list, ++ gchar **out_handle, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy), ++ "OpenDirectory", ++ g_variant_new ("(s@h@a{sv})", ++ arg_parent_window, ++ arg_fd, ++ arg_options), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ out_fd_list, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(o)", ++ out_handle); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_open_uri_complete_open_uri: ++ * @object: A #GXdpOpenURI. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @handle: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the OpenURI() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_open_uri_complete_open_uri ( ++ GXdpOpenURI *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *handle) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(o)", ++ handle)); ++} ++ ++/** ++ * gxdp_open_uri_complete_open_file: ++ * @object: A #GXdpOpenURI. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @handle: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the OpenFile() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_open_uri_complete_open_file ( ++ GXdpOpenURI *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *handle) ++{ ++ g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, ++ g_variant_new ("(o)", ++ handle), ++ fd_list); ++} ++ ++/** ++ * gxdp_open_uri_complete_open_directory: ++ * @object: A #GXdpOpenURI. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @handle: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the OpenDirectory() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_open_uri_complete_open_directory ( ++ GXdpOpenURI *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *handle) ++{ ++ g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, ++ g_variant_new ("(o)", ++ handle), ++ fd_list); ++} ++ ++/* ------------------------------------------------------------------------ */ ++ ++/** ++ * GXdpOpenURIProxy: ++ * ++ * The #GXdpOpenURIProxy structure contains only private data and should only be accessed using the provided API. ++ */ ++ ++/** ++ * GXdpOpenURIProxyClass: ++ * @parent_class: The parent class. ++ * ++ * Class structure for #GXdpOpenURIProxy. ++ */ ++ ++struct _GXdpOpenURIProxyPrivate ++{ ++ GData *qdata; ++}; ++ ++static void gxdp_open_uri_proxy_iface_init (GXdpOpenURIIface *iface); ++ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++G_DEFINE_TYPE_WITH_CODE (GXdpOpenURIProxy, gxdp_open_uri_proxy, G_TYPE_DBUS_PROXY, ++ G_ADD_PRIVATE (GXdpOpenURIProxy) ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_proxy_iface_init)) ++ ++#else ++G_DEFINE_TYPE_WITH_CODE (GXdpOpenURIProxy, gxdp_open_uri_proxy, G_TYPE_DBUS_PROXY, ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_proxy_iface_init)) ++ ++#endif ++static void ++gxdp_open_uri_proxy_finalize (GObject *object) ++{ ++ GXdpOpenURIProxy *proxy = GXDP_OPEN_URI_PROXY (object); ++ g_datalist_clear (&proxy->priv->qdata); ++ G_OBJECT_CLASS (gxdp_open_uri_proxy_parent_class)->finalize (object); ++} ++ ++static void ++gxdp_open_uri_proxy_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GVariant *variant; ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_open_uri_property_info_pointers[prop_id - 1]; ++ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); ++ if (info->use_gvariant) ++ { ++ g_value_set_variant (value, variant); ++ } ++ else ++ { ++ if (variant != NULL) ++ g_dbus_gvariant_to_gvalue (variant, value); ++ } ++ if (variant != NULL) ++ g_variant_unref (variant); ++} ++ ++static void ++gxdp_open_uri_proxy_set_property_cb (GDBusProxy *proxy, ++ GAsyncResult *res, ++ gpointer user_data) ++{ ++ const _ExtendedGDBusPropertyInfo *info = user_data; ++ GError *error; ++ GVariant *_ret; ++ error = NULL; ++ _ret = g_dbus_proxy_call_finish (proxy, res, &error); ++ if (!_ret) ++ { ++ g_warning ("Error setting property '%s' on interface org.freedesktop.portal.OpenURI: %s (%s, %d)", ++ info->parent_struct.name, ++ error->message, g_quark_to_string (error->domain), error->code); ++ g_error_free (error); ++ } ++ else ++ { ++ g_variant_unref (_ret); ++ } ++} ++ ++static void ++gxdp_open_uri_proxy_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GVariant *variant; ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_open_uri_property_info_pointers[prop_id - 1]; ++ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); ++ g_dbus_proxy_call (G_DBUS_PROXY (object), ++ "org.freedesktop.DBus.Properties.Set", ++ g_variant_new ("(ssv)", "org.freedesktop.portal.OpenURI", info->parent_struct.name, variant), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, (GAsyncReadyCallback) gxdp_open_uri_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); ++ g_variant_unref (variant); ++} ++ ++static void ++gxdp_open_uri_proxy_g_signal (GDBusProxy *proxy, ++ const gchar *sender_name G_GNUC_UNUSED, ++ const gchar *signal_name, ++ GVariant *parameters) ++{ ++ _ExtendedGDBusSignalInfo *info; ++ GVariantIter iter; ++ GVariant *child; ++ GValue *paramv; ++ gsize num_params; ++ gsize n; ++ guint signal_id; ++ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, signal_name); ++ if (info == NULL) ++ return; ++ num_params = g_variant_n_children (parameters); ++ paramv = g_new0 (GValue, num_params + 1); ++ g_value_init (¶mv[0], GXDP_TYPE_OPEN_URI); ++ g_value_set_object (¶mv[0], proxy); ++ g_variant_iter_init (&iter, parameters); ++ n = 1; ++ while ((child = g_variant_iter_next_value (&iter)) != NULL) ++ { ++ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; ++ if (arg_info->use_gvariant) ++ { ++ g_value_init (¶mv[n], G_TYPE_VARIANT); ++ g_value_set_variant (¶mv[n], child); ++ n++; ++ } ++ else ++ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); ++ g_variant_unref (child); ++ } ++ signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_OPEN_URI); ++ g_signal_emitv (paramv, signal_id, 0, NULL); ++ for (n = 0; n < num_params + 1; n++) ++ g_value_unset (¶mv[n]); ++ g_free (paramv); ++} ++ ++static void ++gxdp_open_uri_proxy_g_properties_changed (GDBusProxy *_proxy, ++ GVariant *changed_properties, ++ const gchar *const *invalidated_properties) ++{ ++ GXdpOpenURIProxy *proxy = GXDP_OPEN_URI_PROXY (_proxy); ++ guint n; ++ const gchar *key; ++ GVariantIter *iter; ++ _ExtendedGDBusPropertyInfo *info; ++ g_variant_get (changed_properties, "a{sv}", &iter); ++ while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) ++ { ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, key); ++ g_datalist_remove_data (&proxy->priv->qdata, key); ++ if (info != NULL) ++ g_object_notify (G_OBJECT (proxy), info->hyphen_name); ++ } ++ g_variant_iter_free (iter); ++ for (n = 0; invalidated_properties[n] != NULL; n++) ++ { ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, invalidated_properties[n]); ++ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); ++ if (info != NULL) ++ g_object_notify (G_OBJECT (proxy), info->hyphen_name); ++ } ++} ++ ++static guint ++gxdp_open_uri_proxy_get_version (GXdpOpenURI *object) ++{ ++ GXdpOpenURIProxy *proxy = GXDP_OPEN_URI_PROXY (object); ++ GVariant *variant; ++ guint value = 0; ++ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version"); ++ if (variant != NULL) ++ { ++ value = g_variant_get_uint32 (variant); ++ g_variant_unref (variant); ++ } ++ return value; ++} ++ ++static void ++gxdp_open_uri_proxy_init (GXdpOpenURIProxy *proxy) ++{ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++ proxy->priv = gxdp_open_uri_proxy_get_instance_private (proxy); ++#else ++ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_OPEN_URI_PROXY, GXdpOpenURIProxyPrivate); ++#endif ++ ++ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_open_uri_interface_info ()); ++} ++ ++static void ++gxdp_open_uri_proxy_class_init (GXdpOpenURIProxyClass *klass) ++{ ++ GObjectClass *gobject_class; ++ GDBusProxyClass *proxy_class; ++ ++ gobject_class = G_OBJECT_CLASS (klass); ++ gobject_class->finalize = gxdp_open_uri_proxy_finalize; ++ gobject_class->get_property = gxdp_open_uri_proxy_get_property; ++ gobject_class->set_property = gxdp_open_uri_proxy_set_property; ++ ++ proxy_class = G_DBUS_PROXY_CLASS (klass); ++ proxy_class->g_signal = gxdp_open_uri_proxy_g_signal; ++ proxy_class->g_properties_changed = gxdp_open_uri_proxy_g_properties_changed; ++ ++ gxdp_open_uri_override_properties (gobject_class, 1); ++ ++#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 ++ g_type_class_add_private (klass, sizeof (GXdpOpenURIProxyPrivate)); ++#endif ++} ++ ++static void ++gxdp_open_uri_proxy_iface_init (GXdpOpenURIIface *iface) ++{ ++ iface->get_version = gxdp_open_uri_proxy_get_version; ++} ++ ++/** ++ * gxdp_open_uri_proxy_new: ++ * @connection: A #GDBusConnection. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously creates a proxy for the D-Bus interface org.freedesktop.portal.OpenURI. See g_dbus_proxy_new() for more details. ++ * ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_open_uri_proxy_new_finish() to get the result of the operation. ++ * ++ * See gxdp_open_uri_proxy_new_sync() for the synchronous, blocking version of this constructor. ++ */ ++void ++gxdp_open_uri_proxy_new ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_async_initable_new_async (GXDP_TYPE_OPEN_URI_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.OpenURI", NULL); ++} ++ ++/** ++ * gxdp_open_uri_proxy_new_finish: ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_proxy_new(). ++ * @error: Return location for error or %NULL ++ * ++ * Finishes an operation started with gxdp_open_uri_proxy_new(). ++ * ++ * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpOpenURI * ++gxdp_open_uri_proxy_new_finish ( ++ GAsyncResult *res, ++ GError **error) ++{ ++ GObject *ret; ++ GObject *source_object; ++ source_object = g_async_result_get_source_object (res); ++ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); ++ g_object_unref (source_object); ++ if (ret != NULL) ++ return GXDP_OPEN_URI (ret); ++ else ++ return NULL; ++} ++ ++/** ++ * gxdp_open_uri_proxy_new_sync: ++ * @connection: A #GDBusConnection. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL ++ * ++ * Synchronously creates a proxy for the D-Bus interface org.freedesktop.portal.OpenURI. See g_dbus_proxy_new_sync() for more details. ++ * ++ * The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_open_uri_proxy_new() for the asynchronous version of this constructor. ++ * ++ * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpOpenURI * ++gxdp_open_uri_proxy_new_sync ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GInitable *ret; ++ ret = g_initable_new (GXDP_TYPE_OPEN_URI_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.OpenURI", NULL); ++ if (ret != NULL) ++ return GXDP_OPEN_URI (ret); ++ else ++ return NULL; ++} ++ ++ ++/** ++ * gxdp_open_uri_proxy_new_for_bus: ++ * @bus_type: A #GBusType. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: A bus name (well-known or unique). ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied. ++ * @user_data: User data to pass to @callback. ++ * ++ * Like gxdp_open_uri_proxy_new() but takes a #GBusType instead of a #GDBusConnection. ++ * ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_open_uri_proxy_new_for_bus_finish() to get the result of the operation. ++ * ++ * See gxdp_open_uri_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. ++ */ ++void ++gxdp_open_uri_proxy_new_for_bus ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_async_initable_new_async (GXDP_TYPE_OPEN_URI_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.OpenURI", NULL); ++} ++ ++/** ++ * gxdp_open_uri_proxy_new_for_bus_finish: ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_proxy_new_for_bus(). ++ * @error: Return location for error or %NULL ++ * ++ * Finishes an operation started with gxdp_open_uri_proxy_new_for_bus(). ++ * ++ * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpOpenURI * ++gxdp_open_uri_proxy_new_for_bus_finish ( ++ GAsyncResult *res, ++ GError **error) ++{ ++ GObject *ret; ++ GObject *source_object; ++ source_object = g_async_result_get_source_object (res); ++ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); ++ g_object_unref (source_object); ++ if (ret != NULL) ++ return GXDP_OPEN_URI (ret); ++ else ++ return NULL; ++} ++ ++/** ++ * gxdp_open_uri_proxy_new_for_bus_sync: ++ * @bus_type: A #GBusType. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: A bus name (well-known or unique). ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL ++ * ++ * Like gxdp_open_uri_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. ++ * ++ * The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_open_uri_proxy_new_for_bus() for the asynchronous version of this constructor. ++ * ++ * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpOpenURI * ++gxdp_open_uri_proxy_new_for_bus_sync ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GInitable *ret; ++ ret = g_initable_new (GXDP_TYPE_OPEN_URI_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.OpenURI", NULL); ++ if (ret != NULL) ++ return GXDP_OPEN_URI (ret); ++ else ++ return NULL; ++} ++ ++ ++/* ------------------------------------------------------------------------ */ ++ ++/** ++ * GXdpOpenURISkeleton: ++ * ++ * The #GXdpOpenURISkeleton structure contains only private data and should only be accessed using the provided API. ++ */ ++ ++/** ++ * GXdpOpenURISkeletonClass: ++ * @parent_class: The parent class. ++ * ++ * Class structure for #GXdpOpenURISkeleton. ++ */ ++ ++struct _GXdpOpenURISkeletonPrivate ++{ ++ GValue *properties; ++ GList *changed_properties; ++ GSource *changed_properties_idle_source; ++ GMainContext *context; ++ GMutex lock; ++}; ++ ++static void ++_gxdp_open_uri_skeleton_handle_method_call ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name, ++ const gchar *method_name, ++ GVariant *parameters, ++ GDBusMethodInvocation *invocation, ++ gpointer user_data) ++{ ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data); ++ _ExtendedGDBusMethodInfo *info; ++ GVariantIter iter; ++ GVariant *child; ++ GValue *paramv; ++ gsize num_params; ++ guint num_extra; ++ gsize n; ++ guint signal_id; ++ GValue return_value = G_VALUE_INIT; ++ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); ++ g_assert (info != NULL); ++ num_params = g_variant_n_children (parameters); ++ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); ++ n = 0; ++ g_value_init (¶mv[n], GXDP_TYPE_OPEN_URI); ++ g_value_set_object (¶mv[n++], skeleton); ++ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); ++ g_value_set_object (¶mv[n++], invocation); ++ if (info->pass_fdlist) ++ { ++#ifdef G_OS_UNIX ++ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); ++ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); ++#else ++ g_assert_not_reached (); ++#endif ++ } ++ g_variant_iter_init (&iter, parameters); ++ while ((child = g_variant_iter_next_value (&iter)) != NULL) ++ { ++ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; ++ if (arg_info->use_gvariant) ++ { ++ g_value_init (¶mv[n], G_TYPE_VARIANT); ++ g_value_set_variant (¶mv[n], child); ++ n++; ++ } ++ else ++ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); ++ g_variant_unref (child); ++ } ++ signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_OPEN_URI); ++ g_value_init (&return_value, G_TYPE_BOOLEAN); ++ g_signal_emitv (paramv, signal_id, 0, &return_value); ++ if (!g_value_get_boolean (&return_value)) ++ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); ++ g_value_unset (&return_value); ++ for (n = 0; n < num_params + num_extra; n++) ++ g_value_unset (¶mv[n]); ++ g_free (paramv); ++} ++ ++static GVariant * ++_gxdp_open_uri_skeleton_handle_get_property ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name G_GNUC_UNUSED, ++ const gchar *property_name, ++ GError **error, ++ gpointer user_data) ++{ ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data); ++ GValue value = G_VALUE_INIT; ++ GParamSpec *pspec; ++ _ExtendedGDBusPropertyInfo *info; ++ GVariant *ret; ++ ret = NULL; ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, property_name); ++ g_assert (info != NULL); ++ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); ++ if (pspec == NULL) ++ { ++ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); ++ } ++ else ++ { ++ g_value_init (&value, pspec->value_type); ++ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); ++ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); ++ g_value_unset (&value); ++ } ++ return ret; ++} ++ ++static gboolean ++_gxdp_open_uri_skeleton_handle_set_property ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name G_GNUC_UNUSED, ++ const gchar *property_name, ++ GVariant *variant, ++ GError **error, ++ gpointer user_data) ++{ ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data); ++ GValue value = G_VALUE_INIT; ++ GParamSpec *pspec; ++ _ExtendedGDBusPropertyInfo *info; ++ gboolean ret; ++ ret = FALSE; ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, property_name); ++ g_assert (info != NULL); ++ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); ++ if (pspec == NULL) ++ { ++ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); ++ } ++ else ++ { ++ if (info->use_gvariant) ++ g_value_set_variant (&value, variant); ++ else ++ g_dbus_gvariant_to_gvalue (variant, &value); ++ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); ++ g_value_unset (&value); ++ ret = TRUE; ++ } ++ return ret; ++} ++ ++static const GDBusInterfaceVTable _gxdp_open_uri_skeleton_vtable = ++{ ++ _gxdp_open_uri_skeleton_handle_method_call, ++ _gxdp_open_uri_skeleton_handle_get_property, ++ _gxdp_open_uri_skeleton_handle_set_property, ++ {NULL} ++}; ++ ++static GDBusInterfaceInfo * ++gxdp_open_uri_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) ++{ ++ return gxdp_open_uri_interface_info (); ++} ++ ++static GDBusInterfaceVTable * ++gxdp_open_uri_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) ++{ ++ return (GDBusInterfaceVTable *) &_gxdp_open_uri_skeleton_vtable; ++} ++ ++static GVariant * ++gxdp_open_uri_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) ++{ ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (_skeleton); ++ ++ GVariantBuilder builder; ++ guint n; ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); ++ if (_gxdp_open_uri_interface_info.parent_struct.properties == NULL) ++ goto out; ++ for (n = 0; _gxdp_open_uri_interface_info.parent_struct.properties[n] != NULL; n++) ++ { ++ GDBusPropertyInfo *info = _gxdp_open_uri_interface_info.parent_struct.properties[n]; ++ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) ++ { ++ GVariant *value; ++ value = _gxdp_open_uri_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.portal.OpenURI", info->name, NULL, skeleton); ++ if (value != NULL) ++ { ++ g_variant_take_ref (value); ++ g_variant_builder_add (&builder, "{sv}", info->name, value); ++ g_variant_unref (value); ++ } ++ } ++ } ++out: ++ return g_variant_builder_end (&builder); ++} ++ ++static gboolean _gxdp_open_uri_emit_changed (gpointer user_data); ++ ++static void ++gxdp_open_uri_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) ++{ ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (_skeleton); ++ gboolean emit_changed = FALSE; ++ ++ g_mutex_lock (&skeleton->priv->lock); ++ if (skeleton->priv->changed_properties_idle_source != NULL) ++ { ++ g_source_destroy (skeleton->priv->changed_properties_idle_source); ++ skeleton->priv->changed_properties_idle_source = NULL; ++ emit_changed = TRUE; ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++ ++ if (emit_changed) ++ _gxdp_open_uri_emit_changed (skeleton); ++} ++ ++static void gxdp_open_uri_skeleton_iface_init (GXdpOpenURIIface *iface); ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++G_DEFINE_TYPE_WITH_CODE (GXdpOpenURISkeleton, gxdp_open_uri_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, ++ G_ADD_PRIVATE (GXdpOpenURISkeleton) ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_skeleton_iface_init)) ++ ++#else ++G_DEFINE_TYPE_WITH_CODE (GXdpOpenURISkeleton, gxdp_open_uri_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_skeleton_iface_init)) ++ ++#endif ++static void ++gxdp_open_uri_skeleton_finalize (GObject *object) ++{ ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object); ++ guint n; ++ for (n = 0; n < 1; n++) ++ g_value_unset (&skeleton->priv->properties[n]); ++ g_free (skeleton->priv->properties); ++ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); ++ if (skeleton->priv->changed_properties_idle_source != NULL) ++ g_source_destroy (skeleton->priv->changed_properties_idle_source); ++ g_main_context_unref (skeleton->priv->context); ++ g_mutex_clear (&skeleton->priv->lock); ++ G_OBJECT_CLASS (gxdp_open_uri_skeleton_parent_class)->finalize (object); ++} ++ ++static void ++gxdp_open_uri_skeleton_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object); ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ g_mutex_lock (&skeleton->priv->lock); ++ g_value_copy (&skeleton->priv->properties[prop_id - 1], value); ++ g_mutex_unlock (&skeleton->priv->lock); ++} ++ ++static gboolean ++_gxdp_open_uri_emit_changed (gpointer user_data) ++{ ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data); ++ GList *l; ++ GVariantBuilder builder; ++ GVariantBuilder invalidated_builder; ++ guint num_changes; ++ ++ g_mutex_lock (&skeleton->priv->lock); ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); ++ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); ++ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) ++ { ++ ChangedProperty *cp = l->data; ++ GVariant *variant; ++ const GValue *cur_value; ++ ++ cur_value = &skeleton->priv->properties[cp->prop_id - 1]; ++ if (!_g_value_equal (cur_value, &cp->orig_value)) ++ { ++ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); ++ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); ++ g_variant_unref (variant); ++ num_changes++; ++ } ++ } ++ if (num_changes > 0) ++ { ++ GList *connections, *ll; ++ GVariant *signal_variant; ++ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.OpenURI", ++ &builder, &invalidated_builder)); ++ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); ++ for (ll = connections; ll != NULL; ll = ll->next) ++ { ++ GDBusConnection *connection = ll->data; ++ ++ g_dbus_connection_emit_signal (connection, ++ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), ++ "org.freedesktop.DBus.Properties", ++ "PropertiesChanged", ++ signal_variant, ++ NULL); ++ } ++ g_variant_unref (signal_variant); ++ g_list_free_full (connections, g_object_unref); ++ } ++ else ++ { ++ g_variant_builder_clear (&builder); ++ g_variant_builder_clear (&invalidated_builder); ++ } ++ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); ++ skeleton->priv->changed_properties = NULL; ++ skeleton->priv->changed_properties_idle_source = NULL; ++ g_mutex_unlock (&skeleton->priv->lock); ++ return FALSE; ++} ++ ++static void ++_gxdp_open_uri_schedule_emit_changed (GXdpOpenURISkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) ++{ ++ ChangedProperty *cp; ++ GList *l; ++ cp = NULL; ++ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) ++ { ++ ChangedProperty *i_cp = l->data; ++ if (i_cp->info == info) ++ { ++ cp = i_cp; ++ break; ++ } ++ } ++ if (cp == NULL) ++ { ++ cp = g_new0 (ChangedProperty, 1); ++ cp->prop_id = prop_id; ++ cp->info = info; ++ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); ++ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); ++ g_value_copy (orig_value, &cp->orig_value); ++ } ++} ++ ++static void ++gxdp_open_uri_skeleton_notify (GObject *object, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object); ++ g_mutex_lock (&skeleton->priv->lock); ++ if (skeleton->priv->changed_properties != NULL && ++ skeleton->priv->changed_properties_idle_source == NULL) ++ { ++ skeleton->priv->changed_properties_idle_source = g_idle_source_new (); ++ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); ++ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_open_uri_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); ++ g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_open_uri_emit_changed"); ++ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); ++ g_source_unref (skeleton->priv->changed_properties_idle_source); ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++} ++ ++static void ++gxdp_open_uri_skeleton_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object); ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_open_uri_property_info_pointers[prop_id - 1]; ++ g_mutex_lock (&skeleton->priv->lock); ++ g_object_freeze_notify (object); ++ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) ++ { ++ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL && ++ info->emits_changed_signal) ++ _gxdp_open_uri_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]); ++ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); ++ g_object_notify_by_pspec (object, pspec); ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++ g_object_thaw_notify (object); ++} ++ ++static void ++gxdp_open_uri_skeleton_init (GXdpOpenURISkeleton *skeleton) ++{ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++ skeleton->priv = gxdp_open_uri_skeleton_get_instance_private (skeleton); ++#else ++ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_OPEN_URI_SKELETON, GXdpOpenURISkeletonPrivate); ++#endif ++ ++ g_mutex_init (&skeleton->priv->lock); ++ skeleton->priv->context = g_main_context_ref_thread_default (); ++ skeleton->priv->properties = g_new0 (GValue, 1); ++ g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT); ++} ++ ++static guint ++gxdp_open_uri_skeleton_get_version (GXdpOpenURI *object) ++{ ++ GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object); ++ guint value; ++ g_mutex_lock (&skeleton->priv->lock); ++ value = g_value_get_uint (&(skeleton->priv->properties[0])); ++ g_mutex_unlock (&skeleton->priv->lock); ++ return value; ++} ++ ++static void ++gxdp_open_uri_skeleton_class_init (GXdpOpenURISkeletonClass *klass) ++{ ++ GObjectClass *gobject_class; ++ GDBusInterfaceSkeletonClass *skeleton_class; ++ ++ gobject_class = G_OBJECT_CLASS (klass); ++ gobject_class->finalize = gxdp_open_uri_skeleton_finalize; ++ gobject_class->get_property = gxdp_open_uri_skeleton_get_property; ++ gobject_class->set_property = gxdp_open_uri_skeleton_set_property; ++ gobject_class->notify = gxdp_open_uri_skeleton_notify; ++ ++ ++ gxdp_open_uri_override_properties (gobject_class, 1); ++ ++ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); ++ skeleton_class->get_info = gxdp_open_uri_skeleton_dbus_interface_get_info; ++ skeleton_class->get_properties = gxdp_open_uri_skeleton_dbus_interface_get_properties; ++ skeleton_class->flush = gxdp_open_uri_skeleton_dbus_interface_flush; ++ skeleton_class->get_vtable = gxdp_open_uri_skeleton_dbus_interface_get_vtable; ++ ++#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 ++ g_type_class_add_private (klass, sizeof (GXdpOpenURISkeletonPrivate)); ++#endif ++} ++ ++static void ++gxdp_open_uri_skeleton_iface_init (GXdpOpenURIIface *iface) ++{ ++ iface->get_version = gxdp_open_uri_skeleton_get_version; ++} ++ ++/** ++ * gxdp_open_uri_skeleton_new: ++ * ++ * Creates a skeleton object for the D-Bus interface org.freedesktop.portal.OpenURI. ++ * ++ * Returns: (transfer full) (type GXdpOpenURISkeleton): The skeleton object. ++ */ ++GXdpOpenURI * ++gxdp_open_uri_skeleton_new (void) ++{ ++ return GXDP_OPEN_URI (g_object_new (GXDP_TYPE_OPEN_URI_SKELETON, NULL)); ++} ++ ++/* ------------------------------------------------------------------------ ++ * Code for interface org.freedesktop.portal.ProxyResolver ++ * ------------------------------------------------------------------------ ++ */ ++ ++/** ++ * SECTION:GXdpProxyResolver ++ * @title: GXdpProxyResolver ++ * @short_description: Generated C code for the org.freedesktop.portal.ProxyResolver D-Bus interface ++ * ++ * This section contains code for working with the org.freedesktop.portal.ProxyResolver D-Bus interface in C. ++ */ ++ ++/* ---- Introspection data for org.freedesktop.portal.ProxyResolver ---- */ ++ ++static const _ExtendedGDBusArgInfo _gxdp_proxy_resolver_method_info_lookup_IN_ARG_uri = ++{ ++ { ++ -1, ++ (gchar *) "uri", ++ (gchar *) "s", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_proxy_resolver_method_info_lookup_IN_ARG_pointers[] = ++{ ++ &_gxdp_proxy_resolver_method_info_lookup_IN_ARG_uri.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_proxy_resolver_method_info_lookup_OUT_ARG_proxies = ++{ ++ { ++ -1, ++ (gchar *) "proxies", ++ (gchar *) "as", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_proxy_resolver_method_info_lookup_OUT_ARG_pointers[] = ++{ ++ &_gxdp_proxy_resolver_method_info_lookup_OUT_ARG_proxies.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_proxy_resolver_method_info_lookup = ++{ ++ { ++ -1, ++ (gchar *) "Lookup", ++ (GDBusArgInfo **) &_gxdp_proxy_resolver_method_info_lookup_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_proxy_resolver_method_info_lookup_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-lookup", ++ FALSE ++}; ++ ++static const GDBusMethodInfo * const _gxdp_proxy_resolver_method_info_pointers[] = ++{ ++ &_gxdp_proxy_resolver_method_info_lookup.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusPropertyInfo _gxdp_proxy_resolver_property_info_version = ++{ ++ { ++ -1, ++ (gchar *) "version", ++ (gchar *) "u", ++ G_DBUS_PROPERTY_INFO_FLAGS_READABLE, ++ NULL ++ }, ++ "version", ++ FALSE, ++ TRUE ++}; ++ ++static const GDBusPropertyInfo * const _gxdp_proxy_resolver_property_info_pointers[] = ++{ ++ &_gxdp_proxy_resolver_property_info_version.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusInterfaceInfo _gxdp_proxy_resolver_interface_info = ++{ ++ { ++ -1, ++ (gchar *) "org.freedesktop.portal.ProxyResolver", ++ (GDBusMethodInfo **) &_gxdp_proxy_resolver_method_info_pointers, ++ NULL, ++ (GDBusPropertyInfo **) &_gxdp_proxy_resolver_property_info_pointers, ++ NULL ++ }, ++ "proxy-resolver", ++}; ++ ++ ++/** ++ * gxdp_proxy_resolver_interface_info: ++ * ++ * Gets a machine-readable description of the org.freedesktop.portal.ProxyResolver D-Bus interface. ++ * ++ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. ++ */ ++GDBusInterfaceInfo * ++gxdp_proxy_resolver_interface_info (void) ++{ ++ return (GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct; ++} ++ ++/** ++ * gxdp_proxy_resolver_override_properties: ++ * @klass: The class structure for a #GObject derived class. ++ * @property_id_begin: The property id to assign to the first overridden property. ++ * ++ * Overrides all #GObject properties in the #GXdpProxyResolver interface for a concrete class. ++ * The properties are overridden in the order they are defined. ++ * ++ * Returns: The last property id. ++ */ ++guint ++gxdp_proxy_resolver_override_properties (GObjectClass *klass, guint property_id_begin) ++{ ++ g_object_class_override_property (klass, property_id_begin++, "version"); ++ return property_id_begin - 1; ++} ++ ++ ++ ++/** ++ * GXdpProxyResolver: ++ * ++ * Abstract interface type for the D-Bus interface org.freedesktop.portal.ProxyResolver. ++ */ ++ ++/** ++ * GXdpProxyResolverIface: ++ * @parent_iface: The parent interface. ++ * @handle_lookup: Handler for the #GXdpProxyResolver::handle-lookup signal. ++ * @get_version: Getter for the #GXdpProxyResolver:version property. ++ * ++ * Virtual table for the D-Bus interface org.freedesktop.portal.ProxyResolver. ++ */ ++ ++typedef GXdpProxyResolverIface GXdpProxyResolverInterface; ++G_DEFINE_INTERFACE (GXdpProxyResolver, gxdp_proxy_resolver, G_TYPE_OBJECT) ++ ++static void ++gxdp_proxy_resolver_default_init (GXdpProxyResolverIface *iface) ++{ ++ /* GObject signals for incoming D-Bus method calls: */ ++ /** ++ * GXdpProxyResolver::handle-lookup: ++ * @object: A #GXdpProxyResolver. ++ * @invocation: A #GDBusMethodInvocation. ++ * @arg_uri: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the Lookup() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_proxy_resolver_complete_lookup() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-lookup", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpProxyResolverIface, handle_lookup), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 2, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); ++ ++ /* GObject properties for D-Bus properties: */ ++ /** ++ * GXdpProxyResolver:version: ++ * ++ * Represents the D-Bus property "version". ++ * ++ * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. ++ */ ++ g_object_interface_install_property (iface, ++ g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++} ++ ++/** ++ * gxdp_proxy_resolver_get_version: (skip) ++ * @object: A #GXdpProxyResolver. ++ * ++ * Gets the value of the "version" D-Bus property. ++ * ++ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. ++ * ++ * Returns: The property value. ++ */ ++guint ++gxdp_proxy_resolver_get_version (GXdpProxyResolver *object) ++{ ++ return GXDP_PROXY_RESOLVER_GET_IFACE (object)->get_version (object); ++} ++ ++/** ++ * gxdp_proxy_resolver_set_version: (skip) ++ * @object: A #GXdpProxyResolver. ++ * @value: The value to set. ++ * ++ * Sets the "version" D-Bus property to @value. ++ * ++ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. ++ */ ++void ++gxdp_proxy_resolver_set_version (GXdpProxyResolver *object, guint value) ++{ ++ g_object_set (G_OBJECT (object), "version", value, NULL); ++} ++ ++/** ++ * gxdp_proxy_resolver_call_lookup: ++ * @proxy: A #GXdpProxyResolverProxy. ++ * @arg_uri: Argument to pass with the method invocation. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the Lookup() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_proxy_resolver_call_lookup_finish() to get the result of the operation. ++ * ++ * See gxdp_proxy_resolver_call_lookup_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_proxy_resolver_call_lookup ( ++ GXdpProxyResolver *proxy, ++ const gchar *arg_uri, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call (G_DBUS_PROXY (proxy), ++ "Lookup", ++ g_variant_new ("(s)", ++ arg_uri), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_proxy_resolver_call_lookup_finish: ++ * @proxy: A #GXdpProxyResolverProxy. ++ * @out_proxies: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_call_lookup(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_proxy_resolver_call_lookup(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_proxy_resolver_call_lookup_finish ( ++ GXdpProxyResolver *proxy, ++ gchar ***out_proxies, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^as)", ++ out_proxies); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_proxy_resolver_call_lookup_sync: ++ * @proxy: A #GXdpProxyResolverProxy. ++ * @arg_uri: Argument to pass with the method invocation. ++ * @out_proxies: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the Lookup() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_proxy_resolver_call_lookup() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_proxy_resolver_call_lookup_sync ( ++ GXdpProxyResolver *proxy, ++ const gchar *arg_uri, ++ gchar ***out_proxies, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), ++ "Lookup", ++ g_variant_new ("(s)", ++ arg_uri), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(^as)", ++ out_proxies); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_proxy_resolver_complete_lookup: ++ * @object: A #GXdpProxyResolver. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @proxies: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the Lookup() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_proxy_resolver_complete_lookup ( ++ GXdpProxyResolver *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ const gchar *const *proxies) ++{ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(^as)", ++ proxies)); ++} ++ ++/* ------------------------------------------------------------------------ */ ++ ++/** ++ * GXdpProxyResolverProxy: ++ * ++ * The #GXdpProxyResolverProxy structure contains only private data and should only be accessed using the provided API. ++ */ ++ ++/** ++ * GXdpProxyResolverProxyClass: ++ * @parent_class: The parent class. ++ * ++ * Class structure for #GXdpProxyResolverProxy. ++ */ ++ ++struct _GXdpProxyResolverProxyPrivate ++{ ++ GData *qdata; ++}; ++ ++static void gxdp_proxy_resolver_proxy_iface_init (GXdpProxyResolverIface *iface); ++ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverProxy, gxdp_proxy_resolver_proxy, G_TYPE_DBUS_PROXY, ++ G_ADD_PRIVATE (GXdpProxyResolverProxy) ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_proxy_iface_init)) ++ ++#else ++G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverProxy, gxdp_proxy_resolver_proxy, G_TYPE_DBUS_PROXY, ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_proxy_iface_init)) ++ ++#endif ++static void ++gxdp_proxy_resolver_proxy_finalize (GObject *object) ++{ ++ GXdpProxyResolverProxy *proxy = GXDP_PROXY_RESOLVER_PROXY (object); ++ g_datalist_clear (&proxy->priv->qdata); ++ G_OBJECT_CLASS (gxdp_proxy_resolver_proxy_parent_class)->finalize (object); ++} ++ ++static void ++gxdp_proxy_resolver_proxy_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GVariant *variant; ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_proxy_resolver_property_info_pointers[prop_id - 1]; ++ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); ++ if (info->use_gvariant) ++ { ++ g_value_set_variant (value, variant); ++ } ++ else ++ { ++ if (variant != NULL) ++ g_dbus_gvariant_to_gvalue (variant, value); ++ } ++ if (variant != NULL) ++ g_variant_unref (variant); ++} ++ ++static void ++gxdp_proxy_resolver_proxy_set_property_cb (GDBusProxy *proxy, ++ GAsyncResult *res, ++ gpointer user_data) ++{ ++ const _ExtendedGDBusPropertyInfo *info = user_data; ++ GError *error; ++ GVariant *_ret; ++ error = NULL; ++ _ret = g_dbus_proxy_call_finish (proxy, res, &error); ++ if (!_ret) ++ { ++ g_warning ("Error setting property '%s' on interface org.freedesktop.portal.ProxyResolver: %s (%s, %d)", ++ info->parent_struct.name, ++ error->message, g_quark_to_string (error->domain), error->code); ++ g_error_free (error); ++ } ++ else ++ { ++ g_variant_unref (_ret); ++ } ++} ++ ++static void ++gxdp_proxy_resolver_proxy_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GVariant *variant; ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_proxy_resolver_property_info_pointers[prop_id - 1]; ++ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); ++ g_dbus_proxy_call (G_DBUS_PROXY (object), ++ "org.freedesktop.DBus.Properties.Set", ++ g_variant_new ("(ssv)", "org.freedesktop.portal.ProxyResolver", info->parent_struct.name, variant), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, (GAsyncReadyCallback) gxdp_proxy_resolver_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); ++ g_variant_unref (variant); ++} ++ ++static void ++gxdp_proxy_resolver_proxy_g_signal (GDBusProxy *proxy, ++ const gchar *sender_name G_GNUC_UNUSED, ++ const gchar *signal_name, ++ GVariant *parameters) ++{ ++ _ExtendedGDBusSignalInfo *info; ++ GVariantIter iter; ++ GVariant *child; ++ GValue *paramv; ++ gsize num_params; ++ gsize n; ++ guint signal_id; ++ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, signal_name); ++ if (info == NULL) ++ return; ++ num_params = g_variant_n_children (parameters); ++ paramv = g_new0 (GValue, num_params + 1); ++ g_value_init (¶mv[0], GXDP_TYPE_PROXY_RESOLVER); ++ g_value_set_object (¶mv[0], proxy); ++ g_variant_iter_init (&iter, parameters); ++ n = 1; ++ while ((child = g_variant_iter_next_value (&iter)) != NULL) ++ { ++ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; ++ if (arg_info->use_gvariant) ++ { ++ g_value_init (¶mv[n], G_TYPE_VARIANT); ++ g_value_set_variant (¶mv[n], child); ++ n++; ++ } ++ else ++ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); ++ g_variant_unref (child); ++ } ++ signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_PROXY_RESOLVER); ++ g_signal_emitv (paramv, signal_id, 0, NULL); ++ for (n = 0; n < num_params + 1; n++) ++ g_value_unset (¶mv[n]); ++ g_free (paramv); ++} ++ ++static void ++gxdp_proxy_resolver_proxy_g_properties_changed (GDBusProxy *_proxy, ++ GVariant *changed_properties, ++ const gchar *const *invalidated_properties) ++{ ++ GXdpProxyResolverProxy *proxy = GXDP_PROXY_RESOLVER_PROXY (_proxy); ++ guint n; ++ const gchar *key; ++ GVariantIter *iter; ++ _ExtendedGDBusPropertyInfo *info; ++ g_variant_get (changed_properties, "a{sv}", &iter); ++ while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) ++ { ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, key); ++ g_datalist_remove_data (&proxy->priv->qdata, key); ++ if (info != NULL) ++ g_object_notify (G_OBJECT (proxy), info->hyphen_name); ++ } ++ g_variant_iter_free (iter); ++ for (n = 0; invalidated_properties[n] != NULL; n++) ++ { ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, invalidated_properties[n]); ++ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); ++ if (info != NULL) ++ g_object_notify (G_OBJECT (proxy), info->hyphen_name); ++ } ++} ++ ++static guint ++gxdp_proxy_resolver_proxy_get_version (GXdpProxyResolver *object) ++{ ++ GXdpProxyResolverProxy *proxy = GXDP_PROXY_RESOLVER_PROXY (object); ++ GVariant *variant; ++ guint value = 0; ++ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version"); ++ if (variant != NULL) ++ { ++ value = g_variant_get_uint32 (variant); ++ g_variant_unref (variant); ++ } ++ return value; ++} ++ ++static void ++gxdp_proxy_resolver_proxy_init (GXdpProxyResolverProxy *proxy) ++{ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++ proxy->priv = gxdp_proxy_resolver_proxy_get_instance_private (proxy); ++#else ++ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_PROXY_RESOLVER_PROXY, GXdpProxyResolverProxyPrivate); ++#endif ++ ++ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_proxy_resolver_interface_info ()); ++} ++ ++static void ++gxdp_proxy_resolver_proxy_class_init (GXdpProxyResolverProxyClass *klass) ++{ ++ GObjectClass *gobject_class; ++ GDBusProxyClass *proxy_class; ++ ++ gobject_class = G_OBJECT_CLASS (klass); ++ gobject_class->finalize = gxdp_proxy_resolver_proxy_finalize; ++ gobject_class->get_property = gxdp_proxy_resolver_proxy_get_property; ++ gobject_class->set_property = gxdp_proxy_resolver_proxy_set_property; ++ ++ proxy_class = G_DBUS_PROXY_CLASS (klass); ++ proxy_class->g_signal = gxdp_proxy_resolver_proxy_g_signal; ++ proxy_class->g_properties_changed = gxdp_proxy_resolver_proxy_g_properties_changed; ++ ++ gxdp_proxy_resolver_override_properties (gobject_class, 1); ++ ++#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 ++ g_type_class_add_private (klass, sizeof (GXdpProxyResolverProxyPrivate)); ++#endif ++} ++ ++static void ++gxdp_proxy_resolver_proxy_iface_init (GXdpProxyResolverIface *iface) ++{ ++ iface->get_version = gxdp_proxy_resolver_proxy_get_version; ++} ++ ++/** ++ * gxdp_proxy_resolver_proxy_new: ++ * @connection: A #GDBusConnection. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously creates a proxy for the D-Bus interface org.freedesktop.portal.ProxyResolver. See g_dbus_proxy_new() for more details. ++ * ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_proxy_resolver_proxy_new_finish() to get the result of the operation. ++ * ++ * See gxdp_proxy_resolver_proxy_new_sync() for the synchronous, blocking version of this constructor. ++ */ ++void ++gxdp_proxy_resolver_proxy_new ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_async_initable_new_async (GXDP_TYPE_PROXY_RESOLVER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.ProxyResolver", NULL); ++} ++ ++/** ++ * gxdp_proxy_resolver_proxy_new_finish: ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_proxy_new(). ++ * @error: Return location for error or %NULL ++ * ++ * Finishes an operation started with gxdp_proxy_resolver_proxy_new(). ++ * ++ * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpProxyResolver * ++gxdp_proxy_resolver_proxy_new_finish ( ++ GAsyncResult *res, ++ GError **error) ++{ ++ GObject *ret; ++ GObject *source_object; ++ source_object = g_async_result_get_source_object (res); ++ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); ++ g_object_unref (source_object); ++ if (ret != NULL) ++ return GXDP_PROXY_RESOLVER (ret); ++ else ++ return NULL; ++} ++ ++/** ++ * gxdp_proxy_resolver_proxy_new_sync: ++ * @connection: A #GDBusConnection. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL ++ * ++ * Synchronously creates a proxy for the D-Bus interface org.freedesktop.portal.ProxyResolver. See g_dbus_proxy_new_sync() for more details. ++ * ++ * The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_proxy_resolver_proxy_new() for the asynchronous version of this constructor. ++ * ++ * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpProxyResolver * ++gxdp_proxy_resolver_proxy_new_sync ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GInitable *ret; ++ ret = g_initable_new (GXDP_TYPE_PROXY_RESOLVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.ProxyResolver", NULL); ++ if (ret != NULL) ++ return GXDP_PROXY_RESOLVER (ret); ++ else ++ return NULL; ++} ++ ++ ++/** ++ * gxdp_proxy_resolver_proxy_new_for_bus: ++ * @bus_type: A #GBusType. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: A bus name (well-known or unique). ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied. ++ * @user_data: User data to pass to @callback. ++ * ++ * Like gxdp_proxy_resolver_proxy_new() but takes a #GBusType instead of a #GDBusConnection. ++ * ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_proxy_resolver_proxy_new_for_bus_finish() to get the result of the operation. ++ * ++ * See gxdp_proxy_resolver_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. ++ */ ++void ++gxdp_proxy_resolver_proxy_new_for_bus ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_async_initable_new_async (GXDP_TYPE_PROXY_RESOLVER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.ProxyResolver", NULL); ++} ++ ++/** ++ * gxdp_proxy_resolver_proxy_new_for_bus_finish: ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_proxy_new_for_bus(). ++ * @error: Return location for error or %NULL ++ * ++ * Finishes an operation started with gxdp_proxy_resolver_proxy_new_for_bus(). ++ * ++ * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpProxyResolver * ++gxdp_proxy_resolver_proxy_new_for_bus_finish ( ++ GAsyncResult *res, ++ GError **error) ++{ ++ GObject *ret; ++ GObject *source_object; ++ source_object = g_async_result_get_source_object (res); ++ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); ++ g_object_unref (source_object); ++ if (ret != NULL) ++ return GXDP_PROXY_RESOLVER (ret); ++ else ++ return NULL; ++} ++ ++/** ++ * gxdp_proxy_resolver_proxy_new_for_bus_sync: ++ * @bus_type: A #GBusType. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: A bus name (well-known or unique). ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL ++ * ++ * Like gxdp_proxy_resolver_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. ++ * ++ * The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_proxy_resolver_proxy_new_for_bus() for the asynchronous version of this constructor. ++ * ++ * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpProxyResolver * ++gxdp_proxy_resolver_proxy_new_for_bus_sync ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GInitable *ret; ++ ret = g_initable_new (GXDP_TYPE_PROXY_RESOLVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.ProxyResolver", NULL); ++ if (ret != NULL) ++ return GXDP_PROXY_RESOLVER (ret); ++ else ++ return NULL; ++} ++ ++ ++/* ------------------------------------------------------------------------ */ ++ ++/** ++ * GXdpProxyResolverSkeleton: ++ * ++ * The #GXdpProxyResolverSkeleton structure contains only private data and should only be accessed using the provided API. ++ */ ++ ++/** ++ * GXdpProxyResolverSkeletonClass: ++ * @parent_class: The parent class. ++ * ++ * Class structure for #GXdpProxyResolverSkeleton. ++ */ ++ ++struct _GXdpProxyResolverSkeletonPrivate ++{ ++ GValue *properties; ++ GList *changed_properties; ++ GSource *changed_properties_idle_source; ++ GMainContext *context; ++ GMutex lock; ++}; ++ ++static void ++_gxdp_proxy_resolver_skeleton_handle_method_call ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name, ++ const gchar *method_name, ++ GVariant *parameters, ++ GDBusMethodInvocation *invocation, ++ gpointer user_data) ++{ ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data); ++ _ExtendedGDBusMethodInfo *info; ++ GVariantIter iter; ++ GVariant *child; ++ GValue *paramv; ++ gsize num_params; ++ guint num_extra; ++ gsize n; ++ guint signal_id; ++ GValue return_value = G_VALUE_INIT; ++ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); ++ g_assert (info != NULL); ++ num_params = g_variant_n_children (parameters); ++ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); ++ n = 0; ++ g_value_init (¶mv[n], GXDP_TYPE_PROXY_RESOLVER); ++ g_value_set_object (¶mv[n++], skeleton); ++ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); ++ g_value_set_object (¶mv[n++], invocation); ++ if (info->pass_fdlist) ++ { ++#ifdef G_OS_UNIX ++ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); ++ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); ++#else ++ g_assert_not_reached (); ++#endif ++ } ++ g_variant_iter_init (&iter, parameters); ++ while ((child = g_variant_iter_next_value (&iter)) != NULL) ++ { ++ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; ++ if (arg_info->use_gvariant) ++ { ++ g_value_init (¶mv[n], G_TYPE_VARIANT); ++ g_value_set_variant (¶mv[n], child); ++ n++; ++ } ++ else ++ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); ++ g_variant_unref (child); ++ } ++ signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_PROXY_RESOLVER); ++ g_value_init (&return_value, G_TYPE_BOOLEAN); ++ g_signal_emitv (paramv, signal_id, 0, &return_value); ++ if (!g_value_get_boolean (&return_value)) ++ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); ++ g_value_unset (&return_value); ++ for (n = 0; n < num_params + num_extra; n++) ++ g_value_unset (¶mv[n]); ++ g_free (paramv); ++} ++ ++static GVariant * ++_gxdp_proxy_resolver_skeleton_handle_get_property ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name G_GNUC_UNUSED, ++ const gchar *property_name, ++ GError **error, ++ gpointer user_data) ++{ ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data); ++ GValue value = G_VALUE_INIT; ++ GParamSpec *pspec; ++ _ExtendedGDBusPropertyInfo *info; ++ GVariant *ret; ++ ret = NULL; ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, property_name); ++ g_assert (info != NULL); ++ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); ++ if (pspec == NULL) ++ { ++ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); ++ } ++ else ++ { ++ g_value_init (&value, pspec->value_type); ++ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); ++ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); ++ g_value_unset (&value); ++ } ++ return ret; ++} ++ ++static gboolean ++_gxdp_proxy_resolver_skeleton_handle_set_property ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name G_GNUC_UNUSED, ++ const gchar *property_name, ++ GVariant *variant, ++ GError **error, ++ gpointer user_data) ++{ ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data); ++ GValue value = G_VALUE_INIT; ++ GParamSpec *pspec; ++ _ExtendedGDBusPropertyInfo *info; ++ gboolean ret; ++ ret = FALSE; ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, property_name); ++ g_assert (info != NULL); ++ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); ++ if (pspec == NULL) ++ { ++ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); ++ } ++ else ++ { ++ if (info->use_gvariant) ++ g_value_set_variant (&value, variant); ++ else ++ g_dbus_gvariant_to_gvalue (variant, &value); ++ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); ++ g_value_unset (&value); ++ ret = TRUE; ++ } ++ return ret; ++} ++ ++static const GDBusInterfaceVTable _gxdp_proxy_resolver_skeleton_vtable = ++{ ++ _gxdp_proxy_resolver_skeleton_handle_method_call, ++ _gxdp_proxy_resolver_skeleton_handle_get_property, ++ _gxdp_proxy_resolver_skeleton_handle_set_property, ++ {NULL} ++}; ++ ++static GDBusInterfaceInfo * ++gxdp_proxy_resolver_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) ++{ ++ return gxdp_proxy_resolver_interface_info (); ++} ++ ++static GDBusInterfaceVTable * ++gxdp_proxy_resolver_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) ++{ ++ return (GDBusInterfaceVTable *) &_gxdp_proxy_resolver_skeleton_vtable; ++} ++ ++static GVariant * ++gxdp_proxy_resolver_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) ++{ ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (_skeleton); ++ ++ GVariantBuilder builder; ++ guint n; ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); ++ if (_gxdp_proxy_resolver_interface_info.parent_struct.properties == NULL) ++ goto out; ++ for (n = 0; _gxdp_proxy_resolver_interface_info.parent_struct.properties[n] != NULL; n++) ++ { ++ GDBusPropertyInfo *info = _gxdp_proxy_resolver_interface_info.parent_struct.properties[n]; ++ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) ++ { ++ GVariant *value; ++ value = _gxdp_proxy_resolver_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.portal.ProxyResolver", info->name, NULL, skeleton); ++ if (value != NULL) ++ { ++ g_variant_take_ref (value); ++ g_variant_builder_add (&builder, "{sv}", info->name, value); ++ g_variant_unref (value); ++ } ++ } ++ } ++out: ++ return g_variant_builder_end (&builder); ++} ++ ++static gboolean _gxdp_proxy_resolver_emit_changed (gpointer user_data); ++ ++static void ++gxdp_proxy_resolver_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) ++{ ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (_skeleton); ++ gboolean emit_changed = FALSE; ++ ++ g_mutex_lock (&skeleton->priv->lock); ++ if (skeleton->priv->changed_properties_idle_source != NULL) ++ { ++ g_source_destroy (skeleton->priv->changed_properties_idle_source); ++ skeleton->priv->changed_properties_idle_source = NULL; ++ emit_changed = TRUE; ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++ ++ if (emit_changed) ++ _gxdp_proxy_resolver_emit_changed (skeleton); ++} ++ ++static void gxdp_proxy_resolver_skeleton_iface_init (GXdpProxyResolverIface *iface); ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverSkeleton, gxdp_proxy_resolver_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, ++ G_ADD_PRIVATE (GXdpProxyResolverSkeleton) ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_skeleton_iface_init)) ++ ++#else ++G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverSkeleton, gxdp_proxy_resolver_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_skeleton_iface_init)) ++ ++#endif ++static void ++gxdp_proxy_resolver_skeleton_finalize (GObject *object) ++{ ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object); ++ guint n; ++ for (n = 0; n < 1; n++) ++ g_value_unset (&skeleton->priv->properties[n]); ++ g_free (skeleton->priv->properties); ++ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); ++ if (skeleton->priv->changed_properties_idle_source != NULL) ++ g_source_destroy (skeleton->priv->changed_properties_idle_source); ++ g_main_context_unref (skeleton->priv->context); ++ g_mutex_clear (&skeleton->priv->lock); ++ G_OBJECT_CLASS (gxdp_proxy_resolver_skeleton_parent_class)->finalize (object); ++} ++ ++static void ++gxdp_proxy_resolver_skeleton_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object); ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ g_mutex_lock (&skeleton->priv->lock); ++ g_value_copy (&skeleton->priv->properties[prop_id - 1], value); ++ g_mutex_unlock (&skeleton->priv->lock); ++} ++ ++static gboolean ++_gxdp_proxy_resolver_emit_changed (gpointer user_data) ++{ ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data); ++ GList *l; ++ GVariantBuilder builder; ++ GVariantBuilder invalidated_builder; ++ guint num_changes; ++ ++ g_mutex_lock (&skeleton->priv->lock); ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); ++ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); ++ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) ++ { ++ ChangedProperty *cp = l->data; ++ GVariant *variant; ++ const GValue *cur_value; ++ ++ cur_value = &skeleton->priv->properties[cp->prop_id - 1]; ++ if (!_g_value_equal (cur_value, &cp->orig_value)) ++ { ++ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); ++ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); ++ g_variant_unref (variant); ++ num_changes++; ++ } ++ } ++ if (num_changes > 0) ++ { ++ GList *connections, *ll; ++ GVariant *signal_variant; ++ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.ProxyResolver", ++ &builder, &invalidated_builder)); ++ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); ++ for (ll = connections; ll != NULL; ll = ll->next) ++ { ++ GDBusConnection *connection = ll->data; ++ ++ g_dbus_connection_emit_signal (connection, ++ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), ++ "org.freedesktop.DBus.Properties", ++ "PropertiesChanged", ++ signal_variant, ++ NULL); ++ } ++ g_variant_unref (signal_variant); ++ g_list_free_full (connections, g_object_unref); ++ } ++ else ++ { ++ g_variant_builder_clear (&builder); ++ g_variant_builder_clear (&invalidated_builder); ++ } ++ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); ++ skeleton->priv->changed_properties = NULL; ++ skeleton->priv->changed_properties_idle_source = NULL; ++ g_mutex_unlock (&skeleton->priv->lock); ++ return FALSE; ++} ++ ++static void ++_gxdp_proxy_resolver_schedule_emit_changed (GXdpProxyResolverSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) ++{ ++ ChangedProperty *cp; ++ GList *l; ++ cp = NULL; ++ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) ++ { ++ ChangedProperty *i_cp = l->data; ++ if (i_cp->info == info) ++ { ++ cp = i_cp; ++ break; ++ } ++ } ++ if (cp == NULL) ++ { ++ cp = g_new0 (ChangedProperty, 1); ++ cp->prop_id = prop_id; ++ cp->info = info; ++ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); ++ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); ++ g_value_copy (orig_value, &cp->orig_value); ++ } ++} ++ ++static void ++gxdp_proxy_resolver_skeleton_notify (GObject *object, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object); ++ g_mutex_lock (&skeleton->priv->lock); ++ if (skeleton->priv->changed_properties != NULL && ++ skeleton->priv->changed_properties_idle_source == NULL) ++ { ++ skeleton->priv->changed_properties_idle_source = g_idle_source_new (); ++ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); ++ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_proxy_resolver_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); ++ g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_proxy_resolver_emit_changed"); ++ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); ++ g_source_unref (skeleton->priv->changed_properties_idle_source); ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++} ++ ++static void ++gxdp_proxy_resolver_skeleton_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object); ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_proxy_resolver_property_info_pointers[prop_id - 1]; ++ g_mutex_lock (&skeleton->priv->lock); ++ g_object_freeze_notify (object); ++ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) ++ { ++ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL && ++ info->emits_changed_signal) ++ _gxdp_proxy_resolver_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]); ++ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); ++ g_object_notify_by_pspec (object, pspec); ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++ g_object_thaw_notify (object); ++} ++ ++static void ++gxdp_proxy_resolver_skeleton_init (GXdpProxyResolverSkeleton *skeleton) ++{ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++ skeleton->priv = gxdp_proxy_resolver_skeleton_get_instance_private (skeleton); ++#else ++ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_PROXY_RESOLVER_SKELETON, GXdpProxyResolverSkeletonPrivate); ++#endif ++ ++ g_mutex_init (&skeleton->priv->lock); ++ skeleton->priv->context = g_main_context_ref_thread_default (); ++ skeleton->priv->properties = g_new0 (GValue, 1); ++ g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT); ++} ++ ++static guint ++gxdp_proxy_resolver_skeleton_get_version (GXdpProxyResolver *object) ++{ ++ GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object); ++ guint value; ++ g_mutex_lock (&skeleton->priv->lock); ++ value = g_value_get_uint (&(skeleton->priv->properties[0])); ++ g_mutex_unlock (&skeleton->priv->lock); ++ return value; ++} ++ ++static void ++gxdp_proxy_resolver_skeleton_class_init (GXdpProxyResolverSkeletonClass *klass) ++{ ++ GObjectClass *gobject_class; ++ GDBusInterfaceSkeletonClass *skeleton_class; ++ ++ gobject_class = G_OBJECT_CLASS (klass); ++ gobject_class->finalize = gxdp_proxy_resolver_skeleton_finalize; ++ gobject_class->get_property = gxdp_proxy_resolver_skeleton_get_property; ++ gobject_class->set_property = gxdp_proxy_resolver_skeleton_set_property; ++ gobject_class->notify = gxdp_proxy_resolver_skeleton_notify; ++ ++ ++ gxdp_proxy_resolver_override_properties (gobject_class, 1); ++ ++ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); ++ skeleton_class->get_info = gxdp_proxy_resolver_skeleton_dbus_interface_get_info; ++ skeleton_class->get_properties = gxdp_proxy_resolver_skeleton_dbus_interface_get_properties; ++ skeleton_class->flush = gxdp_proxy_resolver_skeleton_dbus_interface_flush; ++ skeleton_class->get_vtable = gxdp_proxy_resolver_skeleton_dbus_interface_get_vtable; ++ ++#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 ++ g_type_class_add_private (klass, sizeof (GXdpProxyResolverSkeletonPrivate)); ++#endif ++} ++ ++static void ++gxdp_proxy_resolver_skeleton_iface_init (GXdpProxyResolverIface *iface) ++{ ++ iface->get_version = gxdp_proxy_resolver_skeleton_get_version; ++} ++ ++/** ++ * gxdp_proxy_resolver_skeleton_new: ++ * ++ * Creates a skeleton object for the D-Bus interface org.freedesktop.portal.ProxyResolver. ++ * ++ * Returns: (transfer full) (type GXdpProxyResolverSkeleton): The skeleton object. ++ */ ++GXdpProxyResolver * ++gxdp_proxy_resolver_skeleton_new (void) ++{ ++ return GXDP_PROXY_RESOLVER (g_object_new (GXDP_TYPE_PROXY_RESOLVER_SKELETON, NULL)); ++} ++ ++/* ------------------------------------------------------------------------ ++ * Code for interface org.freedesktop.portal.Trash ++ * ------------------------------------------------------------------------ ++ */ ++ ++/** ++ * SECTION:GXdpTrash ++ * @title: GXdpTrash ++ * @short_description: Generated C code for the org.freedesktop.portal.Trash D-Bus interface ++ * ++ * This section contains code for working with the org.freedesktop.portal.Trash D-Bus interface in C. ++ */ ++ ++/* ---- Introspection data for org.freedesktop.portal.Trash ---- */ ++ ++static const _ExtendedGDBusArgInfo _gxdp_trash_method_info_trash_file_IN_ARG_fd = ++{ ++ { ++ -1, ++ (gchar *) "fd", ++ (gchar *) "h", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_trash_method_info_trash_file_IN_ARG_pointers[] = ++{ ++ &_gxdp_trash_method_info_trash_file_IN_ARG_fd.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusArgInfo _gxdp_trash_method_info_trash_file_OUT_ARG_result = ++{ ++ { ++ -1, ++ (gchar *) "result", ++ (gchar *) "u", ++ NULL ++ }, ++ FALSE ++}; ++ ++static const GDBusArgInfo * const _gxdp_trash_method_info_trash_file_OUT_ARG_pointers[] = ++{ ++ &_gxdp_trash_method_info_trash_file_OUT_ARG_result.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusMethodInfo _gxdp_trash_method_info_trash_file = ++{ ++ { ++ -1, ++ (gchar *) "TrashFile", ++ (GDBusArgInfo **) &_gxdp_trash_method_info_trash_file_IN_ARG_pointers, ++ (GDBusArgInfo **) &_gxdp_trash_method_info_trash_file_OUT_ARG_pointers, ++ NULL ++ }, ++ "handle-trash-file", ++ TRUE ++}; ++ ++static const GDBusMethodInfo * const _gxdp_trash_method_info_pointers[] = ++{ ++ &_gxdp_trash_method_info_trash_file.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusPropertyInfo _gxdp_trash_property_info_version = ++{ ++ { ++ -1, ++ (gchar *) "version", ++ (gchar *) "u", ++ G_DBUS_PROPERTY_INFO_FLAGS_READABLE, ++ NULL ++ }, ++ "version", ++ FALSE, ++ TRUE ++}; ++ ++static const GDBusPropertyInfo * const _gxdp_trash_property_info_pointers[] = ++{ ++ &_gxdp_trash_property_info_version.parent_struct, ++ NULL ++}; ++ ++static const _ExtendedGDBusInterfaceInfo _gxdp_trash_interface_info = ++{ ++ { ++ -1, ++ (gchar *) "org.freedesktop.portal.Trash", ++ (GDBusMethodInfo **) &_gxdp_trash_method_info_pointers, ++ NULL, ++ (GDBusPropertyInfo **) &_gxdp_trash_property_info_pointers, ++ NULL ++ }, ++ "trash", ++}; ++ ++ ++/** ++ * gxdp_trash_interface_info: ++ * ++ * Gets a machine-readable description of the org.freedesktop.portal.Trash D-Bus interface. ++ * ++ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. ++ */ ++GDBusInterfaceInfo * ++gxdp_trash_interface_info (void) ++{ ++ return (GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct; ++} ++ ++/** ++ * gxdp_trash_override_properties: ++ * @klass: The class structure for a #GObject derived class. ++ * @property_id_begin: The property id to assign to the first overridden property. ++ * ++ * Overrides all #GObject properties in the #GXdpTrash interface for a concrete class. ++ * The properties are overridden in the order they are defined. ++ * ++ * Returns: The last property id. ++ */ ++guint ++gxdp_trash_override_properties (GObjectClass *klass, guint property_id_begin) ++{ ++ g_object_class_override_property (klass, property_id_begin++, "version"); ++ return property_id_begin - 1; ++} ++ ++ ++ ++/** ++ * GXdpTrash: ++ * ++ * Abstract interface type for the D-Bus interface org.freedesktop.portal.Trash. ++ */ ++ ++/** ++ * GXdpTrashIface: ++ * @parent_iface: The parent interface. ++ * @handle_trash_file: Handler for the #GXdpTrash::handle-trash-file signal. ++ * @get_version: Getter for the #GXdpTrash:version property. ++ * ++ * Virtual table for the D-Bus interface org.freedesktop.portal.Trash. ++ */ ++ ++typedef GXdpTrashIface GXdpTrashInterface; ++G_DEFINE_INTERFACE (GXdpTrash, gxdp_trash, G_TYPE_OBJECT) ++ ++static void ++gxdp_trash_default_init (GXdpTrashIface *iface) ++{ ++ /* GObject signals for incoming D-Bus method calls: */ ++ /** ++ * GXdpTrash::handle-trash-file: ++ * @object: A #GXdpTrash. ++ * @invocation: A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @arg_fd: Argument passed by remote caller. ++ * ++ * Signal emitted when a remote caller is invoking the TrashFile() D-Bus method. ++ * ++ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_trash_complete_trash_file() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. ++ * ++ * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. ++ */ ++ g_signal_new ("handle-trash-file", ++ G_TYPE_FROM_INTERFACE (iface), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GXdpTrashIface, handle_trash_file), ++ g_signal_accumulator_true_handled, ++ NULL, ++ g_cclosure_marshal_generic, ++ G_TYPE_BOOLEAN, ++ 3, ++ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT); ++ ++ /* GObject properties for D-Bus properties: */ ++ /** ++ * GXdpTrash:version: ++ * ++ * Represents the D-Bus property "version". ++ * ++ * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. ++ */ ++ g_object_interface_install_property (iface, ++ g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++} ++ ++/** ++ * gxdp_trash_get_version: (skip) ++ * @object: A #GXdpTrash. ++ * ++ * Gets the value of the "version" D-Bus property. ++ * ++ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. ++ * ++ * Returns: The property value. ++ */ ++guint ++gxdp_trash_get_version (GXdpTrash *object) ++{ ++ return GXDP_TRASH_GET_IFACE (object)->get_version (object); ++} ++ ++/** ++ * gxdp_trash_set_version: (skip) ++ * @object: A #GXdpTrash. ++ * @value: The value to set. ++ * ++ * Sets the "version" D-Bus property to @value. ++ * ++ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. ++ */ ++void ++gxdp_trash_set_version (GXdpTrash *object, guint value) ++{ ++ g_object_set (G_OBJECT (object), "version", value, NULL); ++} ++ ++/** ++ * gxdp_trash_call_trash_file: ++ * @proxy: A #GXdpTrashProxy. ++ * @arg_fd: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously invokes the TrashFile() D-Bus method on @proxy. ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_trash_call_trash_file_finish() to get the result of the operation. ++ * ++ * See gxdp_trash_call_trash_file_sync() for the synchronous, blocking version of this method. ++ */ ++void ++gxdp_trash_call_trash_file ( ++ GXdpTrash *proxy, ++ GVariant *arg_fd, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy), ++ "TrashFile", ++ g_variant_new ("(@h)", ++ arg_fd), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ cancellable, ++ callback, ++ user_data); ++} ++ ++/** ++ * gxdp_trash_call_trash_file_finish: ++ * @proxy: A #GXdpTrashProxy. ++ * @out_result: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore. ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_trash_call_trash_file(). ++ * @error: Return location for error or %NULL. ++ * ++ * Finishes an operation started with gxdp_trash_call_trash_file(). ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_trash_call_trash_file_finish ( ++ GXdpTrash *proxy, ++ guint *out_result, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_result); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_trash_call_trash_file_sync: ++ * @proxy: A #GXdpTrashProxy. ++ * @arg_fd: Argument to pass with the method invocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @out_result: (out) (optional): Return location for return parameter or %NULL to ignore. ++ * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL. ++ * ++ * Synchronously invokes the TrashFile() D-Bus method on @proxy. The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_trash_call_trash_file() for the asynchronous version of this method. ++ * ++ * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. ++ */ ++gboolean ++gxdp_trash_call_trash_file_sync ( ++ GXdpTrash *proxy, ++ GVariant *arg_fd, ++ GUnixFDList *fd_list, ++ guint *out_result, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GVariant *_ret; ++ _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy), ++ "TrashFile", ++ g_variant_new ("(@h)", ++ arg_fd), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ fd_list, ++ out_fd_list, ++ cancellable, ++ error); ++ if (_ret == NULL) ++ goto _out; ++ g_variant_get (_ret, ++ "(u)", ++ out_result); ++ g_variant_unref (_ret); ++_out: ++ return _ret != NULL; ++} ++ ++/** ++ * gxdp_trash_complete_trash_file: ++ * @object: A #GXdpTrash. ++ * @invocation: (transfer full): A #GDBusMethodInvocation. ++ * @fd_list: (nullable): A #GUnixFDList or %NULL. ++ * @result: Parameter to return. ++ * ++ * Helper function used in service implementations to finish handling invocations of the TrashFile() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. ++ * ++ * This method will free @invocation, you cannot use it afterwards. ++ */ ++void ++gxdp_trash_complete_trash_file ( ++ GXdpTrash *object G_GNUC_UNUSED, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ guint result) ++{ ++ g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, ++ g_variant_new ("(u)", ++ result), ++ fd_list); ++} ++ ++/* ------------------------------------------------------------------------ */ ++ ++/** ++ * GXdpTrashProxy: ++ * ++ * The #GXdpTrashProxy structure contains only private data and should only be accessed using the provided API. ++ */ ++ ++/** ++ * GXdpTrashProxyClass: ++ * @parent_class: The parent class. ++ * ++ * Class structure for #GXdpTrashProxy. ++ */ ++ ++struct _GXdpTrashProxyPrivate ++{ ++ GData *qdata; ++}; ++ ++static void gxdp_trash_proxy_iface_init (GXdpTrashIface *iface); ++ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++G_DEFINE_TYPE_WITH_CODE (GXdpTrashProxy, gxdp_trash_proxy, G_TYPE_DBUS_PROXY, ++ G_ADD_PRIVATE (GXdpTrashProxy) ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_proxy_iface_init)) ++ ++#else ++G_DEFINE_TYPE_WITH_CODE (GXdpTrashProxy, gxdp_trash_proxy, G_TYPE_DBUS_PROXY, ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_proxy_iface_init)) ++ ++#endif ++static void ++gxdp_trash_proxy_finalize (GObject *object) ++{ ++ GXdpTrashProxy *proxy = GXDP_TRASH_PROXY (object); ++ g_datalist_clear (&proxy->priv->qdata); ++ G_OBJECT_CLASS (gxdp_trash_proxy_parent_class)->finalize (object); ++} ++ ++static void ++gxdp_trash_proxy_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GVariant *variant; ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_trash_property_info_pointers[prop_id - 1]; ++ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); ++ if (info->use_gvariant) ++ { ++ g_value_set_variant (value, variant); ++ } ++ else ++ { ++ if (variant != NULL) ++ g_dbus_gvariant_to_gvalue (variant, value); ++ } ++ if (variant != NULL) ++ g_variant_unref (variant); ++} ++ ++static void ++gxdp_trash_proxy_set_property_cb (GDBusProxy *proxy, ++ GAsyncResult *res, ++ gpointer user_data) ++{ ++ const _ExtendedGDBusPropertyInfo *info = user_data; ++ GError *error; ++ GVariant *_ret; ++ error = NULL; ++ _ret = g_dbus_proxy_call_finish (proxy, res, &error); ++ if (!_ret) ++ { ++ g_warning ("Error setting property '%s' on interface org.freedesktop.portal.Trash: %s (%s, %d)", ++ info->parent_struct.name, ++ error->message, g_quark_to_string (error->domain), error->code); ++ g_error_free (error); ++ } ++ else ++ { ++ g_variant_unref (_ret); ++ } ++} ++ ++static void ++gxdp_trash_proxy_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GVariant *variant; ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_trash_property_info_pointers[prop_id - 1]; ++ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); ++ g_dbus_proxy_call (G_DBUS_PROXY (object), ++ "org.freedesktop.DBus.Properties.Set", ++ g_variant_new ("(ssv)", "org.freedesktop.portal.Trash", info->parent_struct.name, variant), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, (GAsyncReadyCallback) gxdp_trash_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); ++ g_variant_unref (variant); ++} ++ ++static void ++gxdp_trash_proxy_g_signal (GDBusProxy *proxy, ++ const gchar *sender_name G_GNUC_UNUSED, ++ const gchar *signal_name, ++ GVariant *parameters) ++{ ++ _ExtendedGDBusSignalInfo *info; ++ GVariantIter iter; ++ GVariant *child; ++ GValue *paramv; ++ gsize num_params; ++ gsize n; ++ guint signal_id; ++ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, signal_name); ++ if (info == NULL) ++ return; ++ num_params = g_variant_n_children (parameters); ++ paramv = g_new0 (GValue, num_params + 1); ++ g_value_init (¶mv[0], GXDP_TYPE_TRASH); ++ g_value_set_object (¶mv[0], proxy); ++ g_variant_iter_init (&iter, parameters); ++ n = 1; ++ while ((child = g_variant_iter_next_value (&iter)) != NULL) ++ { ++ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; ++ if (arg_info->use_gvariant) ++ { ++ g_value_init (¶mv[n], G_TYPE_VARIANT); ++ g_value_set_variant (¶mv[n], child); ++ n++; ++ } ++ else ++ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); ++ g_variant_unref (child); ++ } ++ signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_TRASH); ++ g_signal_emitv (paramv, signal_id, 0, NULL); ++ for (n = 0; n < num_params + 1; n++) ++ g_value_unset (¶mv[n]); ++ g_free (paramv); ++} ++ ++static void ++gxdp_trash_proxy_g_properties_changed (GDBusProxy *_proxy, ++ GVariant *changed_properties, ++ const gchar *const *invalidated_properties) ++{ ++ GXdpTrashProxy *proxy = GXDP_TRASH_PROXY (_proxy); ++ guint n; ++ const gchar *key; ++ GVariantIter *iter; ++ _ExtendedGDBusPropertyInfo *info; ++ g_variant_get (changed_properties, "a{sv}", &iter); ++ while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) ++ { ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, key); ++ g_datalist_remove_data (&proxy->priv->qdata, key); ++ if (info != NULL) ++ g_object_notify (G_OBJECT (proxy), info->hyphen_name); ++ } ++ g_variant_iter_free (iter); ++ for (n = 0; invalidated_properties[n] != NULL; n++) ++ { ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, invalidated_properties[n]); ++ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); ++ if (info != NULL) ++ g_object_notify (G_OBJECT (proxy), info->hyphen_name); ++ } ++} ++ ++static guint ++gxdp_trash_proxy_get_version (GXdpTrash *object) ++{ ++ GXdpTrashProxy *proxy = GXDP_TRASH_PROXY (object); ++ GVariant *variant; ++ guint value = 0; ++ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version"); ++ if (variant != NULL) ++ { ++ value = g_variant_get_uint32 (variant); ++ g_variant_unref (variant); ++ } ++ return value; ++} ++ ++static void ++gxdp_trash_proxy_init (GXdpTrashProxy *proxy) ++{ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++ proxy->priv = gxdp_trash_proxy_get_instance_private (proxy); ++#else ++ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_TRASH_PROXY, GXdpTrashProxyPrivate); ++#endif ++ ++ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_trash_interface_info ()); ++} ++ ++static void ++gxdp_trash_proxy_class_init (GXdpTrashProxyClass *klass) ++{ ++ GObjectClass *gobject_class; ++ GDBusProxyClass *proxy_class; ++ ++ gobject_class = G_OBJECT_CLASS (klass); ++ gobject_class->finalize = gxdp_trash_proxy_finalize; ++ gobject_class->get_property = gxdp_trash_proxy_get_property; ++ gobject_class->set_property = gxdp_trash_proxy_set_property; ++ ++ proxy_class = G_DBUS_PROXY_CLASS (klass); ++ proxy_class->g_signal = gxdp_trash_proxy_g_signal; ++ proxy_class->g_properties_changed = gxdp_trash_proxy_g_properties_changed; ++ ++ gxdp_trash_override_properties (gobject_class, 1); ++ ++#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 ++ g_type_class_add_private (klass, sizeof (GXdpTrashProxyPrivate)); ++#endif ++} ++ ++static void ++gxdp_trash_proxy_iface_init (GXdpTrashIface *iface) ++{ ++ iface->get_version = gxdp_trash_proxy_get_version; ++} ++ ++/** ++ * gxdp_trash_proxy_new: ++ * @connection: A #GDBusConnection. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied. ++ * @user_data: User data to pass to @callback. ++ * ++ * Asynchronously creates a proxy for the D-Bus interface org.freedesktop.portal.Trash. See g_dbus_proxy_new() for more details. ++ * ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_trash_proxy_new_finish() to get the result of the operation. ++ * ++ * See gxdp_trash_proxy_new_sync() for the synchronous, blocking version of this constructor. ++ */ ++void ++gxdp_trash_proxy_new ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_async_initable_new_async (GXDP_TYPE_TRASH_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Trash", NULL); ++} ++ ++/** ++ * gxdp_trash_proxy_new_finish: ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_trash_proxy_new(). ++ * @error: Return location for error or %NULL ++ * ++ * Finishes an operation started with gxdp_trash_proxy_new(). ++ * ++ * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpTrash * ++gxdp_trash_proxy_new_finish ( ++ GAsyncResult *res, ++ GError **error) ++{ ++ GObject *ret; ++ GObject *source_object; ++ source_object = g_async_result_get_source_object (res); ++ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); ++ g_object_unref (source_object); ++ if (ret != NULL) ++ return GXDP_TRASH (ret); ++ else ++ return NULL; ++} ++ ++/** ++ * gxdp_trash_proxy_new_sync: ++ * @connection: A #GDBusConnection. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL ++ * ++ * Synchronously creates a proxy for the D-Bus interface org.freedesktop.portal.Trash. See g_dbus_proxy_new_sync() for more details. ++ * ++ * The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_trash_proxy_new() for the asynchronous version of this constructor. ++ * ++ * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpTrash * ++gxdp_trash_proxy_new_sync ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GInitable *ret; ++ ret = g_initable_new (GXDP_TYPE_TRASH_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Trash", NULL); ++ if (ret != NULL) ++ return GXDP_TRASH (ret); ++ else ++ return NULL; ++} ++ ++ ++/** ++ * gxdp_trash_proxy_new_for_bus: ++ * @bus_type: A #GBusType. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: A bus name (well-known or unique). ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @callback: A #GAsyncReadyCallback to call when the request is satisfied. ++ * @user_data: User data to pass to @callback. ++ * ++ * Like gxdp_trash_proxy_new() but takes a #GBusType instead of a #GDBusConnection. ++ * ++ * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). ++ * You can then call gxdp_trash_proxy_new_for_bus_finish() to get the result of the operation. ++ * ++ * See gxdp_trash_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. ++ */ ++void ++gxdp_trash_proxy_new_for_bus ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data) ++{ ++ g_async_initable_new_async (GXDP_TYPE_TRASH_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Trash", NULL); ++} ++ ++/** ++ * gxdp_trash_proxy_new_for_bus_finish: ++ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_trash_proxy_new_for_bus(). ++ * @error: Return location for error or %NULL ++ * ++ * Finishes an operation started with gxdp_trash_proxy_new_for_bus(). ++ * ++ * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpTrash * ++gxdp_trash_proxy_new_for_bus_finish ( ++ GAsyncResult *res, ++ GError **error) ++{ ++ GObject *ret; ++ GObject *source_object; ++ source_object = g_async_result_get_source_object (res); ++ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); ++ g_object_unref (source_object); ++ if (ret != NULL) ++ return GXDP_TRASH (ret); ++ else ++ return NULL; ++} ++ ++/** ++ * gxdp_trash_proxy_new_for_bus_sync: ++ * @bus_type: A #GBusType. ++ * @flags: Flags from the #GDBusProxyFlags enumeration. ++ * @name: A bus name (well-known or unique). ++ * @object_path: An object path. ++ * @cancellable: (nullable): A #GCancellable or %NULL. ++ * @error: Return location for error or %NULL ++ * ++ * Like gxdp_trash_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. ++ * ++ * The calling thread is blocked until a reply is received. ++ * ++ * See gxdp_trash_proxy_new_for_bus() for the asynchronous version of this constructor. ++ * ++ * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set. ++ */ ++GXdpTrash * ++gxdp_trash_proxy_new_for_bus_sync ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GInitable *ret; ++ ret = g_initable_new (GXDP_TYPE_TRASH_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Trash", NULL); ++ if (ret != NULL) ++ return GXDP_TRASH (ret); ++ else ++ return NULL; ++} ++ ++ ++/* ------------------------------------------------------------------------ */ ++ ++/** ++ * GXdpTrashSkeleton: ++ * ++ * The #GXdpTrashSkeleton structure contains only private data and should only be accessed using the provided API. ++ */ ++ ++/** ++ * GXdpTrashSkeletonClass: ++ * @parent_class: The parent class. ++ * ++ * Class structure for #GXdpTrashSkeleton. ++ */ ++ ++struct _GXdpTrashSkeletonPrivate ++{ ++ GValue *properties; ++ GList *changed_properties; ++ GSource *changed_properties_idle_source; ++ GMainContext *context; ++ GMutex lock; ++}; ++ ++static void ++_gxdp_trash_skeleton_handle_method_call ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name, ++ const gchar *method_name, ++ GVariant *parameters, ++ GDBusMethodInvocation *invocation, ++ gpointer user_data) ++{ ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data); ++ _ExtendedGDBusMethodInfo *info; ++ GVariantIter iter; ++ GVariant *child; ++ GValue *paramv; ++ gsize num_params; ++ guint num_extra; ++ gsize n; ++ guint signal_id; ++ GValue return_value = G_VALUE_INIT; ++ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); ++ g_assert (info != NULL); ++ num_params = g_variant_n_children (parameters); ++ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); ++ n = 0; ++ g_value_init (¶mv[n], GXDP_TYPE_TRASH); ++ g_value_set_object (¶mv[n++], skeleton); ++ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); ++ g_value_set_object (¶mv[n++], invocation); ++ if (info->pass_fdlist) ++ { ++#ifdef G_OS_UNIX ++ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); ++ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); ++#else ++ g_assert_not_reached (); ++#endif ++ } ++ g_variant_iter_init (&iter, parameters); ++ while ((child = g_variant_iter_next_value (&iter)) != NULL) ++ { ++ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; ++ if (arg_info->use_gvariant) ++ { ++ g_value_init (¶mv[n], G_TYPE_VARIANT); ++ g_value_set_variant (¶mv[n], child); ++ n++; ++ } ++ else ++ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); ++ g_variant_unref (child); ++ } ++ signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_TRASH); ++ g_value_init (&return_value, G_TYPE_BOOLEAN); ++ g_signal_emitv (paramv, signal_id, 0, &return_value); ++ if (!g_value_get_boolean (&return_value)) ++ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); ++ g_value_unset (&return_value); ++ for (n = 0; n < num_params + num_extra; n++) ++ g_value_unset (¶mv[n]); ++ g_free (paramv); ++} ++ ++static GVariant * ++_gxdp_trash_skeleton_handle_get_property ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name G_GNUC_UNUSED, ++ const gchar *property_name, ++ GError **error, ++ gpointer user_data) ++{ ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data); ++ GValue value = G_VALUE_INIT; ++ GParamSpec *pspec; ++ _ExtendedGDBusPropertyInfo *info; ++ GVariant *ret; ++ ret = NULL; ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, property_name); ++ g_assert (info != NULL); ++ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); ++ if (pspec == NULL) ++ { ++ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); ++ } ++ else ++ { ++ g_value_init (&value, pspec->value_type); ++ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); ++ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); ++ g_value_unset (&value); ++ } ++ return ret; ++} ++ ++static gboolean ++_gxdp_trash_skeleton_handle_set_property ( ++ GDBusConnection *connection G_GNUC_UNUSED, ++ const gchar *sender G_GNUC_UNUSED, ++ const gchar *object_path G_GNUC_UNUSED, ++ const gchar *interface_name G_GNUC_UNUSED, ++ const gchar *property_name, ++ GVariant *variant, ++ GError **error, ++ gpointer user_data) ++{ ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data); ++ GValue value = G_VALUE_INIT; ++ GParamSpec *pspec; ++ _ExtendedGDBusPropertyInfo *info; ++ gboolean ret; ++ ret = FALSE; ++ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, property_name); ++ g_assert (info != NULL); ++ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); ++ if (pspec == NULL) ++ { ++ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); ++ } ++ else ++ { ++ if (info->use_gvariant) ++ g_value_set_variant (&value, variant); ++ else ++ g_dbus_gvariant_to_gvalue (variant, &value); ++ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); ++ g_value_unset (&value); ++ ret = TRUE; ++ } ++ return ret; ++} ++ ++static const GDBusInterfaceVTable _gxdp_trash_skeleton_vtable = ++{ ++ _gxdp_trash_skeleton_handle_method_call, ++ _gxdp_trash_skeleton_handle_get_property, ++ _gxdp_trash_skeleton_handle_set_property, ++ {NULL} ++}; ++ ++static GDBusInterfaceInfo * ++gxdp_trash_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) ++{ ++ return gxdp_trash_interface_info (); ++} ++ ++static GDBusInterfaceVTable * ++gxdp_trash_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) ++{ ++ return (GDBusInterfaceVTable *) &_gxdp_trash_skeleton_vtable; ++} ++ ++static GVariant * ++gxdp_trash_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) ++{ ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (_skeleton); ++ ++ GVariantBuilder builder; ++ guint n; ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); ++ if (_gxdp_trash_interface_info.parent_struct.properties == NULL) ++ goto out; ++ for (n = 0; _gxdp_trash_interface_info.parent_struct.properties[n] != NULL; n++) ++ { ++ GDBusPropertyInfo *info = _gxdp_trash_interface_info.parent_struct.properties[n]; ++ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) ++ { ++ GVariant *value; ++ value = _gxdp_trash_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.portal.Trash", info->name, NULL, skeleton); ++ if (value != NULL) ++ { ++ g_variant_take_ref (value); ++ g_variant_builder_add (&builder, "{sv}", info->name, value); ++ g_variant_unref (value); ++ } ++ } ++ } ++out: ++ return g_variant_builder_end (&builder); ++} ++ ++static gboolean _gxdp_trash_emit_changed (gpointer user_data); ++ ++static void ++gxdp_trash_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) ++{ ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (_skeleton); ++ gboolean emit_changed = FALSE; ++ ++ g_mutex_lock (&skeleton->priv->lock); ++ if (skeleton->priv->changed_properties_idle_source != NULL) ++ { ++ g_source_destroy (skeleton->priv->changed_properties_idle_source); ++ skeleton->priv->changed_properties_idle_source = NULL; ++ emit_changed = TRUE; ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++ ++ if (emit_changed) ++ _gxdp_trash_emit_changed (skeleton); ++} ++ ++static void gxdp_trash_skeleton_iface_init (GXdpTrashIface *iface); ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++G_DEFINE_TYPE_WITH_CODE (GXdpTrashSkeleton, gxdp_trash_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, ++ G_ADD_PRIVATE (GXdpTrashSkeleton) ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_skeleton_iface_init)) ++ ++#else ++G_DEFINE_TYPE_WITH_CODE (GXdpTrashSkeleton, gxdp_trash_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, ++ G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_skeleton_iface_init)) ++ ++#endif ++static void ++gxdp_trash_skeleton_finalize (GObject *object) ++{ ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object); ++ guint n; ++ for (n = 0; n < 1; n++) ++ g_value_unset (&skeleton->priv->properties[n]); ++ g_free (skeleton->priv->properties); ++ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); ++ if (skeleton->priv->changed_properties_idle_source != NULL) ++ g_source_destroy (skeleton->priv->changed_properties_idle_source); ++ g_main_context_unref (skeleton->priv->context); ++ g_mutex_clear (&skeleton->priv->lock); ++ G_OBJECT_CLASS (gxdp_trash_skeleton_parent_class)->finalize (object); ++} ++ ++static void ++gxdp_trash_skeleton_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object); ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ g_mutex_lock (&skeleton->priv->lock); ++ g_value_copy (&skeleton->priv->properties[prop_id - 1], value); ++ g_mutex_unlock (&skeleton->priv->lock); ++} ++ ++static gboolean ++_gxdp_trash_emit_changed (gpointer user_data) ++{ ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data); ++ GList *l; ++ GVariantBuilder builder; ++ GVariantBuilder invalidated_builder; ++ guint num_changes; ++ ++ g_mutex_lock (&skeleton->priv->lock); ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); ++ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); ++ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) ++ { ++ ChangedProperty *cp = l->data; ++ GVariant *variant; ++ const GValue *cur_value; ++ ++ cur_value = &skeleton->priv->properties[cp->prop_id - 1]; ++ if (!_g_value_equal (cur_value, &cp->orig_value)) ++ { ++ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); ++ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); ++ g_variant_unref (variant); ++ num_changes++; ++ } ++ } ++ if (num_changes > 0) ++ { ++ GList *connections, *ll; ++ GVariant *signal_variant; ++ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.Trash", ++ &builder, &invalidated_builder)); ++ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); ++ for (ll = connections; ll != NULL; ll = ll->next) ++ { ++ GDBusConnection *connection = ll->data; ++ ++ g_dbus_connection_emit_signal (connection, ++ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), ++ "org.freedesktop.DBus.Properties", ++ "PropertiesChanged", ++ signal_variant, ++ NULL); ++ } ++ g_variant_unref (signal_variant); ++ g_list_free_full (connections, g_object_unref); ++ } ++ else ++ { ++ g_variant_builder_clear (&builder); ++ g_variant_builder_clear (&invalidated_builder); ++ } ++ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); ++ skeleton->priv->changed_properties = NULL; ++ skeleton->priv->changed_properties_idle_source = NULL; ++ g_mutex_unlock (&skeleton->priv->lock); ++ return FALSE; ++} ++ ++static void ++_gxdp_trash_schedule_emit_changed (GXdpTrashSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) ++{ ++ ChangedProperty *cp; ++ GList *l; ++ cp = NULL; ++ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) ++ { ++ ChangedProperty *i_cp = l->data; ++ if (i_cp->info == info) ++ { ++ cp = i_cp; ++ break; ++ } ++ } ++ if (cp == NULL) ++ { ++ cp = g_new0 (ChangedProperty, 1); ++ cp->prop_id = prop_id; ++ cp->info = info; ++ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); ++ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); ++ g_value_copy (orig_value, &cp->orig_value); ++ } ++} ++ ++static void ++gxdp_trash_skeleton_notify (GObject *object, ++ GParamSpec *pspec G_GNUC_UNUSED) ++{ ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object); ++ g_mutex_lock (&skeleton->priv->lock); ++ if (skeleton->priv->changed_properties != NULL && ++ skeleton->priv->changed_properties_idle_source == NULL) ++ { ++ skeleton->priv->changed_properties_idle_source = g_idle_source_new (); ++ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); ++ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_trash_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); ++ g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_trash_emit_changed"); ++ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); ++ g_source_unref (skeleton->priv->changed_properties_idle_source); ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++} ++ ++static void ++gxdp_trash_skeleton_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec) ++{ ++ const _ExtendedGDBusPropertyInfo *info; ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object); ++ g_assert (prop_id != 0 && prop_id - 1 < 1); ++ info = (const _ExtendedGDBusPropertyInfo *) _gxdp_trash_property_info_pointers[prop_id - 1]; ++ g_mutex_lock (&skeleton->priv->lock); ++ g_object_freeze_notify (object); ++ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) ++ { ++ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL && ++ info->emits_changed_signal) ++ _gxdp_trash_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]); ++ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); ++ g_object_notify_by_pspec (object, pspec); ++ } ++ g_mutex_unlock (&skeleton->priv->lock); ++ g_object_thaw_notify (object); ++} ++ ++static void ++gxdp_trash_skeleton_init (GXdpTrashSkeleton *skeleton) ++{ ++#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 ++ skeleton->priv = gxdp_trash_skeleton_get_instance_private (skeleton); ++#else ++ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_TRASH_SKELETON, GXdpTrashSkeletonPrivate); ++#endif ++ ++ g_mutex_init (&skeleton->priv->lock); ++ skeleton->priv->context = g_main_context_ref_thread_default (); ++ skeleton->priv->properties = g_new0 (GValue, 1); ++ g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT); ++} ++ ++static guint ++gxdp_trash_skeleton_get_version (GXdpTrash *object) ++{ ++ GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object); ++ guint value; ++ g_mutex_lock (&skeleton->priv->lock); ++ value = g_value_get_uint (&(skeleton->priv->properties[0])); ++ g_mutex_unlock (&skeleton->priv->lock); ++ return value; ++} ++ ++static void ++gxdp_trash_skeleton_class_init (GXdpTrashSkeletonClass *klass) ++{ ++ GObjectClass *gobject_class; ++ GDBusInterfaceSkeletonClass *skeleton_class; ++ ++ gobject_class = G_OBJECT_CLASS (klass); ++ gobject_class->finalize = gxdp_trash_skeleton_finalize; ++ gobject_class->get_property = gxdp_trash_skeleton_get_property; ++ gobject_class->set_property = gxdp_trash_skeleton_set_property; ++ gobject_class->notify = gxdp_trash_skeleton_notify; ++ ++ ++ gxdp_trash_override_properties (gobject_class, 1); ++ ++ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); ++ skeleton_class->get_info = gxdp_trash_skeleton_dbus_interface_get_info; ++ skeleton_class->get_properties = gxdp_trash_skeleton_dbus_interface_get_properties; ++ skeleton_class->flush = gxdp_trash_skeleton_dbus_interface_flush; ++ skeleton_class->get_vtable = gxdp_trash_skeleton_dbus_interface_get_vtable; ++ ++#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 ++ g_type_class_add_private (klass, sizeof (GXdpTrashSkeletonPrivate)); ++#endif ++} ++ ++static void ++gxdp_trash_skeleton_iface_init (GXdpTrashIface *iface) ++{ ++ iface->get_version = gxdp_trash_skeleton_get_version; ++} ++ ++/** ++ * gxdp_trash_skeleton_new: ++ * ++ * Creates a skeleton object for the D-Bus interface org.freedesktop.portal.Trash. ++ * ++ * Returns: (transfer full) (type GXdpTrashSkeleton): The skeleton object. ++ */ ++GXdpTrash * ++gxdp_trash_skeleton_new (void) ++{ ++ return GXDP_TRASH (g_object_new (GXDP_TYPE_TRASH_SKELETON, NULL)); ++} ++ +diff --git a/gio/xdp-dbus.h b/gio/xdp-dbus.h +new file mode 100644 +index 0000000..6c06210 +--- /dev/null ++++ b/gio/xdp-dbus.h +@@ -0,0 +1,1172 @@ ++/* ++ * This file is generated by gdbus-codegen, do not modify it. ++ * ++ * The license of this code is the same as for the D-Bus interface description ++ * it was derived from. Note that it links to GLib, so must comply with the ++ * LGPL linking clauses. ++ */ ++ ++#ifndef __XDP_DBUS_H__ ++#define __XDP_DBUS_H__ ++ ++#include ++ ++G_BEGIN_DECLS ++ ++ ++/* ------------------------------------------------------------------------ */ ++/* Declarations for org.freedesktop.portal.Documents */ ++ ++#define GXDP_TYPE_DOCUMENTS (gxdp_documents_get_type ()) ++#define GXDP_DOCUMENTS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_DOCUMENTS, GXdpDocuments)) ++#define GXDP_IS_DOCUMENTS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_DOCUMENTS)) ++#define GXDP_DOCUMENTS_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GXDP_TYPE_DOCUMENTS, GXdpDocumentsIface)) ++ ++struct _GXdpDocuments; ++typedef struct _GXdpDocuments GXdpDocuments; ++typedef struct _GXdpDocumentsIface GXdpDocumentsIface; ++ ++struct _GXdpDocumentsIface ++{ ++ GTypeInterface parent_iface; ++ ++ ++ gboolean (*handle_add) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ GVariant *arg_o_path_fd, ++ gboolean arg_reuse_existing, ++ gboolean arg_persistent); ++ ++ gboolean (*handle_add_full) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ GVariant *arg_o_path_fds, ++ guint arg_flags, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions); ++ ++ gboolean (*handle_add_named) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ GVariant *arg_o_path_parent_fd, ++ const gchar *arg_filename, ++ gboolean arg_reuse_existing, ++ gboolean arg_persistent); ++ ++ gboolean (*handle_add_named_full) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ GVariant *arg_o_path_fd, ++ const gchar *arg_filename, ++ guint arg_flags, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions); ++ ++ gboolean (*handle_delete) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_doc_id); ++ ++ gboolean (*handle_get_mount_point) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation); ++ ++ gboolean (*handle_grant_permissions) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_doc_id, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions); ++ ++ gboolean (*handle_info) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_doc_id); ++ ++ gboolean (*handle_list) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_app_id); ++ ++ gboolean (*handle_lookup) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_filename); ++ ++ gboolean (*handle_revoke_permissions) ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_doc_id, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions); ++ ++ guint (*get_version) (GXdpDocuments *object); ++ ++}; ++ ++GType gxdp_documents_get_type (void) G_GNUC_CONST; ++ ++GDBusInterfaceInfo *gxdp_documents_interface_info (void); ++guint gxdp_documents_override_properties (GObjectClass *klass, guint property_id_begin); ++ ++ ++/* D-Bus method call completion functions: */ ++void gxdp_documents_complete_get_mount_point ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *path); ++ ++void gxdp_documents_complete_add ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *doc_id); ++ ++void gxdp_documents_complete_add_named ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *doc_id); ++ ++void gxdp_documents_complete_add_full ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *const *doc_ids, ++ GVariant *extra_out); ++ ++void gxdp_documents_complete_add_named_full ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *doc_id, ++ GVariant *extra_out); ++ ++void gxdp_documents_complete_grant_permissions ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation); ++ ++void gxdp_documents_complete_revoke_permissions ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation); ++ ++void gxdp_documents_complete_delete ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation); ++ ++void gxdp_documents_complete_lookup ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *doc_id); ++ ++void gxdp_documents_complete_info ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *path, ++ GVariant *apps); ++ ++void gxdp_documents_complete_list ( ++ GXdpDocuments *object, ++ GDBusMethodInvocation *invocation, ++ GVariant *docs); ++ ++ ++ ++/* D-Bus method calls: */ ++void gxdp_documents_call_get_mount_point ( ++ GXdpDocuments *proxy, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_get_mount_point_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_path, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_get_mount_point_sync ( ++ GXdpDocuments *proxy, ++ gchar **out_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_call_add ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fd, ++ gboolean arg_reuse_existing, ++ gboolean arg_persistent, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_add_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_doc_id, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_add_sync ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fd, ++ gboolean arg_reuse_existing, ++ gboolean arg_persistent, ++ GUnixFDList *fd_list, ++ gchar **out_doc_id, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_call_add_named ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_parent_fd, ++ const gchar *arg_filename, ++ gboolean arg_reuse_existing, ++ gboolean arg_persistent, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_add_named_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_doc_id, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_add_named_sync ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_parent_fd, ++ const gchar *arg_filename, ++ gboolean arg_reuse_existing, ++ gboolean arg_persistent, ++ GUnixFDList *fd_list, ++ gchar **out_doc_id, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_call_add_full ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fds, ++ guint arg_flags, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_add_full_finish ( ++ GXdpDocuments *proxy, ++ gchar ***out_doc_ids, ++ GVariant **out_extra_out, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_add_full_sync ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fds, ++ guint arg_flags, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GUnixFDList *fd_list, ++ gchar ***out_doc_ids, ++ GVariant **out_extra_out, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_call_add_named_full ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fd, ++ const gchar *arg_filename, ++ guint arg_flags, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_add_named_full_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_doc_id, ++ GVariant **out_extra_out, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_add_named_full_sync ( ++ GXdpDocuments *proxy, ++ GVariant *arg_o_path_fd, ++ const gchar *arg_filename, ++ guint arg_flags, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GUnixFDList *fd_list, ++ gchar **out_doc_id, ++ GVariant **out_extra_out, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_call_grant_permissions ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_grant_permissions_finish ( ++ GXdpDocuments *proxy, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_grant_permissions_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_call_revoke_permissions ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_revoke_permissions_finish ( ++ GXdpDocuments *proxy, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_revoke_permissions_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ const gchar *arg_app_id, ++ const gchar *const *arg_permissions, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_call_delete ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_delete_finish ( ++ GXdpDocuments *proxy, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_delete_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_call_lookup ( ++ GXdpDocuments *proxy, ++ const gchar *arg_filename, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_lookup_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_doc_id, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_lookup_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_filename, ++ gchar **out_doc_id, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_call_info ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_info_finish ( ++ GXdpDocuments *proxy, ++ gchar **out_path, ++ GVariant **out_apps, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_info_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_doc_id, ++ gchar **out_path, ++ GVariant **out_apps, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_call_list ( ++ GXdpDocuments *proxy, ++ const gchar *arg_app_id, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_documents_call_list_finish ( ++ GXdpDocuments *proxy, ++ GVariant **out_docs, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_documents_call_list_sync ( ++ GXdpDocuments *proxy, ++ const gchar *arg_app_id, ++ GVariant **out_docs, ++ GCancellable *cancellable, ++ GError **error); ++ ++ ++ ++/* D-Bus property accessors: */ ++guint gxdp_documents_get_version (GXdpDocuments *object); ++void gxdp_documents_set_version (GXdpDocuments *object, guint value); ++ ++ ++/* ---- */ ++ ++#define GXDP_TYPE_DOCUMENTS_PROXY (gxdp_documents_proxy_get_type ()) ++#define GXDP_DOCUMENTS_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_DOCUMENTS_PROXY, GXdpDocumentsProxy)) ++#define GXDP_DOCUMENTS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GXDP_TYPE_DOCUMENTS_PROXY, GXdpDocumentsProxyClass)) ++#define GXDP_DOCUMENTS_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GXDP_TYPE_DOCUMENTS_PROXY, GXdpDocumentsProxyClass)) ++#define GXDP_IS_DOCUMENTS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_DOCUMENTS_PROXY)) ++#define GXDP_IS_DOCUMENTS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GXDP_TYPE_DOCUMENTS_PROXY)) ++ ++typedef struct _GXdpDocumentsProxy GXdpDocumentsProxy; ++typedef struct _GXdpDocumentsProxyClass GXdpDocumentsProxyClass; ++typedef struct _GXdpDocumentsProxyPrivate GXdpDocumentsProxyPrivate; ++ ++struct _GXdpDocumentsProxy ++{ ++ /*< private >*/ ++ GDBusProxy parent_instance; ++ GXdpDocumentsProxyPrivate *priv; ++}; ++ ++struct _GXdpDocumentsProxyClass ++{ ++ GDBusProxyClass parent_class; ++}; ++ ++GType gxdp_documents_proxy_get_type (void) G_GNUC_CONST; ++ ++#if GLIB_CHECK_VERSION(2, 44, 0) ++G_DEFINE_AUTOPTR_CLEANUP_FUNC (GXdpDocumentsProxy, g_object_unref) ++#endif ++ ++void gxdp_documents_proxy_new ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++GXdpDocuments *gxdp_documents_proxy_new_finish ( ++ GAsyncResult *res, ++ GError **error); ++GXdpDocuments *gxdp_documents_proxy_new_sync ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_documents_proxy_new_for_bus ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++GXdpDocuments *gxdp_documents_proxy_new_for_bus_finish ( ++ GAsyncResult *res, ++ GError **error); ++GXdpDocuments *gxdp_documents_proxy_new_for_bus_sync ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++ ++/* ---- */ ++ ++#define GXDP_TYPE_DOCUMENTS_SKELETON (gxdp_documents_skeleton_get_type ()) ++#define GXDP_DOCUMENTS_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_DOCUMENTS_SKELETON, GXdpDocumentsSkeleton)) ++#define GXDP_DOCUMENTS_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GXDP_TYPE_DOCUMENTS_SKELETON, GXdpDocumentsSkeletonClass)) ++#define GXDP_DOCUMENTS_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GXDP_TYPE_DOCUMENTS_SKELETON, GXdpDocumentsSkeletonClass)) ++#define GXDP_IS_DOCUMENTS_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_DOCUMENTS_SKELETON)) ++#define GXDP_IS_DOCUMENTS_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GXDP_TYPE_DOCUMENTS_SKELETON)) ++ ++typedef struct _GXdpDocumentsSkeleton GXdpDocumentsSkeleton; ++typedef struct _GXdpDocumentsSkeletonClass GXdpDocumentsSkeletonClass; ++typedef struct _GXdpDocumentsSkeletonPrivate GXdpDocumentsSkeletonPrivate; ++ ++struct _GXdpDocumentsSkeleton ++{ ++ /*< private >*/ ++ GDBusInterfaceSkeleton parent_instance; ++ GXdpDocumentsSkeletonPrivate *priv; ++}; ++ ++struct _GXdpDocumentsSkeletonClass ++{ ++ GDBusInterfaceSkeletonClass parent_class; ++}; ++ ++GType gxdp_documents_skeleton_get_type (void) G_GNUC_CONST; ++ ++#if GLIB_CHECK_VERSION(2, 44, 0) ++G_DEFINE_AUTOPTR_CLEANUP_FUNC (GXdpDocumentsSkeleton, g_object_unref) ++#endif ++ ++GXdpDocuments *gxdp_documents_skeleton_new (void); ++ ++ ++/* ------------------------------------------------------------------------ */ ++/* Declarations for org.freedesktop.portal.OpenURI */ ++ ++#define GXDP_TYPE_OPEN_URI (gxdp_open_uri_get_type ()) ++#define GXDP_OPEN_URI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_OPEN_URI, GXdpOpenURI)) ++#define GXDP_IS_OPEN_URI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_OPEN_URI)) ++#define GXDP_OPEN_URI_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GXDP_TYPE_OPEN_URI, GXdpOpenURIIface)) ++ ++struct _GXdpOpenURI; ++typedef struct _GXdpOpenURI GXdpOpenURI; ++typedef struct _GXdpOpenURIIface GXdpOpenURIIface; ++ ++struct _GXdpOpenURIIface ++{ ++ GTypeInterface parent_iface; ++ ++ ++ gboolean (*handle_open_directory) ( ++ GXdpOpenURI *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *arg_parent_window, ++ GVariant *arg_fd, ++ GVariant *arg_options); ++ ++ gboolean (*handle_open_file) ( ++ GXdpOpenURI *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *arg_parent_window, ++ GVariant *arg_fd, ++ GVariant *arg_options); ++ ++ gboolean (*handle_open_uri) ( ++ GXdpOpenURI *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_parent_window, ++ const gchar *arg_uri, ++ GVariant *arg_options); ++ ++ guint (*get_version) (GXdpOpenURI *object); ++ ++}; ++ ++GType gxdp_open_uri_get_type (void) G_GNUC_CONST; ++ ++GDBusInterfaceInfo *gxdp_open_uri_interface_info (void); ++guint gxdp_open_uri_override_properties (GObjectClass *klass, guint property_id_begin); ++ ++ ++/* D-Bus method call completion functions: */ ++void gxdp_open_uri_complete_open_uri ( ++ GXdpOpenURI *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *handle); ++ ++void gxdp_open_uri_complete_open_file ( ++ GXdpOpenURI *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *handle); ++ ++void gxdp_open_uri_complete_open_directory ( ++ GXdpOpenURI *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ const gchar *handle); ++ ++ ++ ++/* D-Bus method calls: */ ++void gxdp_open_uri_call_open_uri ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ const gchar *arg_uri, ++ GVariant *arg_options, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_open_uri_call_open_uri_finish ( ++ GXdpOpenURI *proxy, ++ gchar **out_handle, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_open_uri_call_open_uri_sync ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ const gchar *arg_uri, ++ GVariant *arg_options, ++ gchar **out_handle, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_open_uri_call_open_file ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ GVariant *arg_fd, ++ GVariant *arg_options, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_open_uri_call_open_file_finish ( ++ GXdpOpenURI *proxy, ++ gchar **out_handle, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_open_uri_call_open_file_sync ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ GVariant *arg_fd, ++ GVariant *arg_options, ++ GUnixFDList *fd_list, ++ gchar **out_handle, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_open_uri_call_open_directory ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ GVariant *arg_fd, ++ GVariant *arg_options, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_open_uri_call_open_directory_finish ( ++ GXdpOpenURI *proxy, ++ gchar **out_handle, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_open_uri_call_open_directory_sync ( ++ GXdpOpenURI *proxy, ++ const gchar *arg_parent_window, ++ GVariant *arg_fd, ++ GVariant *arg_options, ++ GUnixFDList *fd_list, ++ gchar **out_handle, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error); ++ ++ ++ ++/* D-Bus property accessors: */ ++guint gxdp_open_uri_get_version (GXdpOpenURI *object); ++void gxdp_open_uri_set_version (GXdpOpenURI *object, guint value); ++ ++ ++/* ---- */ ++ ++#define GXDP_TYPE_OPEN_URI_PROXY (gxdp_open_uri_proxy_get_type ()) ++#define GXDP_OPEN_URI_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_OPEN_URI_PROXY, GXdpOpenURIProxy)) ++#define GXDP_OPEN_URI_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GXDP_TYPE_OPEN_URI_PROXY, GXdpOpenURIProxyClass)) ++#define GXDP_OPEN_URI_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GXDP_TYPE_OPEN_URI_PROXY, GXdpOpenURIProxyClass)) ++#define GXDP_IS_OPEN_URI_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_OPEN_URI_PROXY)) ++#define GXDP_IS_OPEN_URI_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GXDP_TYPE_OPEN_URI_PROXY)) ++ ++typedef struct _GXdpOpenURIProxy GXdpOpenURIProxy; ++typedef struct _GXdpOpenURIProxyClass GXdpOpenURIProxyClass; ++typedef struct _GXdpOpenURIProxyPrivate GXdpOpenURIProxyPrivate; ++ ++struct _GXdpOpenURIProxy ++{ ++ /*< private >*/ ++ GDBusProxy parent_instance; ++ GXdpOpenURIProxyPrivate *priv; ++}; ++ ++struct _GXdpOpenURIProxyClass ++{ ++ GDBusProxyClass parent_class; ++}; ++ ++GType gxdp_open_uri_proxy_get_type (void) G_GNUC_CONST; ++ ++#if GLIB_CHECK_VERSION(2, 44, 0) ++G_DEFINE_AUTOPTR_CLEANUP_FUNC (GXdpOpenURIProxy, g_object_unref) ++#endif ++ ++void gxdp_open_uri_proxy_new ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++GXdpOpenURI *gxdp_open_uri_proxy_new_finish ( ++ GAsyncResult *res, ++ GError **error); ++GXdpOpenURI *gxdp_open_uri_proxy_new_sync ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_open_uri_proxy_new_for_bus ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++GXdpOpenURI *gxdp_open_uri_proxy_new_for_bus_finish ( ++ GAsyncResult *res, ++ GError **error); ++GXdpOpenURI *gxdp_open_uri_proxy_new_for_bus_sync ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++ ++/* ---- */ ++ ++#define GXDP_TYPE_OPEN_URI_SKELETON (gxdp_open_uri_skeleton_get_type ()) ++#define GXDP_OPEN_URI_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_OPEN_URI_SKELETON, GXdpOpenURISkeleton)) ++#define GXDP_OPEN_URI_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GXDP_TYPE_OPEN_URI_SKELETON, GXdpOpenURISkeletonClass)) ++#define GXDP_OPEN_URI_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GXDP_TYPE_OPEN_URI_SKELETON, GXdpOpenURISkeletonClass)) ++#define GXDP_IS_OPEN_URI_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_OPEN_URI_SKELETON)) ++#define GXDP_IS_OPEN_URI_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GXDP_TYPE_OPEN_URI_SKELETON)) ++ ++typedef struct _GXdpOpenURISkeleton GXdpOpenURISkeleton; ++typedef struct _GXdpOpenURISkeletonClass GXdpOpenURISkeletonClass; ++typedef struct _GXdpOpenURISkeletonPrivate GXdpOpenURISkeletonPrivate; ++ ++struct _GXdpOpenURISkeleton ++{ ++ /*< private >*/ ++ GDBusInterfaceSkeleton parent_instance; ++ GXdpOpenURISkeletonPrivate *priv; ++}; ++ ++struct _GXdpOpenURISkeletonClass ++{ ++ GDBusInterfaceSkeletonClass parent_class; ++}; ++ ++GType gxdp_open_uri_skeleton_get_type (void) G_GNUC_CONST; ++ ++#if GLIB_CHECK_VERSION(2, 44, 0) ++G_DEFINE_AUTOPTR_CLEANUP_FUNC (GXdpOpenURISkeleton, g_object_unref) ++#endif ++ ++GXdpOpenURI *gxdp_open_uri_skeleton_new (void); ++ ++ ++/* ------------------------------------------------------------------------ */ ++/* Declarations for org.freedesktop.portal.ProxyResolver */ ++ ++#define GXDP_TYPE_PROXY_RESOLVER (gxdp_proxy_resolver_get_type ()) ++#define GXDP_PROXY_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_PROXY_RESOLVER, GXdpProxyResolver)) ++#define GXDP_IS_PROXY_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_PROXY_RESOLVER)) ++#define GXDP_PROXY_RESOLVER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GXDP_TYPE_PROXY_RESOLVER, GXdpProxyResolverIface)) ++ ++struct _GXdpProxyResolver; ++typedef struct _GXdpProxyResolver GXdpProxyResolver; ++typedef struct _GXdpProxyResolverIface GXdpProxyResolverIface; ++ ++struct _GXdpProxyResolverIface ++{ ++ GTypeInterface parent_iface; ++ ++ ++ gboolean (*handle_lookup) ( ++ GXdpProxyResolver *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *arg_uri); ++ ++ guint (*get_version) (GXdpProxyResolver *object); ++ ++}; ++ ++GType gxdp_proxy_resolver_get_type (void) G_GNUC_CONST; ++ ++GDBusInterfaceInfo *gxdp_proxy_resolver_interface_info (void); ++guint gxdp_proxy_resolver_override_properties (GObjectClass *klass, guint property_id_begin); ++ ++ ++/* D-Bus method call completion functions: */ ++void gxdp_proxy_resolver_complete_lookup ( ++ GXdpProxyResolver *object, ++ GDBusMethodInvocation *invocation, ++ const gchar *const *proxies); ++ ++ ++ ++/* D-Bus method calls: */ ++void gxdp_proxy_resolver_call_lookup ( ++ GXdpProxyResolver *proxy, ++ const gchar *arg_uri, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_proxy_resolver_call_lookup_finish ( ++ GXdpProxyResolver *proxy, ++ gchar ***out_proxies, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_proxy_resolver_call_lookup_sync ( ++ GXdpProxyResolver *proxy, ++ const gchar *arg_uri, ++ gchar ***out_proxies, ++ GCancellable *cancellable, ++ GError **error); ++ ++ ++ ++/* D-Bus property accessors: */ ++guint gxdp_proxy_resolver_get_version (GXdpProxyResolver *object); ++void gxdp_proxy_resolver_set_version (GXdpProxyResolver *object, guint value); ++ ++ ++/* ---- */ ++ ++#define GXDP_TYPE_PROXY_RESOLVER_PROXY (gxdp_proxy_resolver_proxy_get_type ()) ++#define GXDP_PROXY_RESOLVER_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_PROXY_RESOLVER_PROXY, GXdpProxyResolverProxy)) ++#define GXDP_PROXY_RESOLVER_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GXDP_TYPE_PROXY_RESOLVER_PROXY, GXdpProxyResolverProxyClass)) ++#define GXDP_PROXY_RESOLVER_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GXDP_TYPE_PROXY_RESOLVER_PROXY, GXdpProxyResolverProxyClass)) ++#define GXDP_IS_PROXY_RESOLVER_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_PROXY_RESOLVER_PROXY)) ++#define GXDP_IS_PROXY_RESOLVER_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GXDP_TYPE_PROXY_RESOLVER_PROXY)) ++ ++typedef struct _GXdpProxyResolverProxy GXdpProxyResolverProxy; ++typedef struct _GXdpProxyResolverProxyClass GXdpProxyResolverProxyClass; ++typedef struct _GXdpProxyResolverProxyPrivate GXdpProxyResolverProxyPrivate; ++ ++struct _GXdpProxyResolverProxy ++{ ++ /*< private >*/ ++ GDBusProxy parent_instance; ++ GXdpProxyResolverProxyPrivate *priv; ++}; ++ ++struct _GXdpProxyResolverProxyClass ++{ ++ GDBusProxyClass parent_class; ++}; ++ ++GType gxdp_proxy_resolver_proxy_get_type (void) G_GNUC_CONST; ++ ++#if GLIB_CHECK_VERSION(2, 44, 0) ++G_DEFINE_AUTOPTR_CLEANUP_FUNC (GXdpProxyResolverProxy, g_object_unref) ++#endif ++ ++void gxdp_proxy_resolver_proxy_new ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++GXdpProxyResolver *gxdp_proxy_resolver_proxy_new_finish ( ++ GAsyncResult *res, ++ GError **error); ++GXdpProxyResolver *gxdp_proxy_resolver_proxy_new_sync ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_proxy_resolver_proxy_new_for_bus ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++GXdpProxyResolver *gxdp_proxy_resolver_proxy_new_for_bus_finish ( ++ GAsyncResult *res, ++ GError **error); ++GXdpProxyResolver *gxdp_proxy_resolver_proxy_new_for_bus_sync ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++ ++/* ---- */ ++ ++#define GXDP_TYPE_PROXY_RESOLVER_SKELETON (gxdp_proxy_resolver_skeleton_get_type ()) ++#define GXDP_PROXY_RESOLVER_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_PROXY_RESOLVER_SKELETON, GXdpProxyResolverSkeleton)) ++#define GXDP_PROXY_RESOLVER_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GXDP_TYPE_PROXY_RESOLVER_SKELETON, GXdpProxyResolverSkeletonClass)) ++#define GXDP_PROXY_RESOLVER_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GXDP_TYPE_PROXY_RESOLVER_SKELETON, GXdpProxyResolverSkeletonClass)) ++#define GXDP_IS_PROXY_RESOLVER_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_PROXY_RESOLVER_SKELETON)) ++#define GXDP_IS_PROXY_RESOLVER_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GXDP_TYPE_PROXY_RESOLVER_SKELETON)) ++ ++typedef struct _GXdpProxyResolverSkeleton GXdpProxyResolverSkeleton; ++typedef struct _GXdpProxyResolverSkeletonClass GXdpProxyResolverSkeletonClass; ++typedef struct _GXdpProxyResolverSkeletonPrivate GXdpProxyResolverSkeletonPrivate; ++ ++struct _GXdpProxyResolverSkeleton ++{ ++ /*< private >*/ ++ GDBusInterfaceSkeleton parent_instance; ++ GXdpProxyResolverSkeletonPrivate *priv; ++}; ++ ++struct _GXdpProxyResolverSkeletonClass ++{ ++ GDBusInterfaceSkeletonClass parent_class; ++}; ++ ++GType gxdp_proxy_resolver_skeleton_get_type (void) G_GNUC_CONST; ++ ++#if GLIB_CHECK_VERSION(2, 44, 0) ++G_DEFINE_AUTOPTR_CLEANUP_FUNC (GXdpProxyResolverSkeleton, g_object_unref) ++#endif ++ ++GXdpProxyResolver *gxdp_proxy_resolver_skeleton_new (void); ++ ++ ++/* ------------------------------------------------------------------------ */ ++/* Declarations for org.freedesktop.portal.Trash */ ++ ++#define GXDP_TYPE_TRASH (gxdp_trash_get_type ()) ++#define GXDP_TRASH(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_TRASH, GXdpTrash)) ++#define GXDP_IS_TRASH(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_TRASH)) ++#define GXDP_TRASH_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GXDP_TYPE_TRASH, GXdpTrashIface)) ++ ++struct _GXdpTrash; ++typedef struct _GXdpTrash GXdpTrash; ++typedef struct _GXdpTrashIface GXdpTrashIface; ++ ++struct _GXdpTrashIface ++{ ++ GTypeInterface parent_iface; ++ ++ ++ gboolean (*handle_trash_file) ( ++ GXdpTrash *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ GVariant *arg_fd); ++ ++ guint (*get_version) (GXdpTrash *object); ++ ++}; ++ ++GType gxdp_trash_get_type (void) G_GNUC_CONST; ++ ++GDBusInterfaceInfo *gxdp_trash_interface_info (void); ++guint gxdp_trash_override_properties (GObjectClass *klass, guint property_id_begin); ++ ++ ++/* D-Bus method call completion functions: */ ++void gxdp_trash_complete_trash_file ( ++ GXdpTrash *object, ++ GDBusMethodInvocation *invocation, ++ GUnixFDList *fd_list, ++ guint result); ++ ++ ++ ++/* D-Bus method calls: */ ++void gxdp_trash_call_trash_file ( ++ GXdpTrash *proxy, ++ GVariant *arg_fd, ++ GUnixFDList *fd_list, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++ ++gboolean gxdp_trash_call_trash_file_finish ( ++ GXdpTrash *proxy, ++ guint *out_result, ++ GUnixFDList **out_fd_list, ++ GAsyncResult *res, ++ GError **error); ++ ++gboolean gxdp_trash_call_trash_file_sync ( ++ GXdpTrash *proxy, ++ GVariant *arg_fd, ++ GUnixFDList *fd_list, ++ guint *out_result, ++ GUnixFDList **out_fd_list, ++ GCancellable *cancellable, ++ GError **error); ++ ++ ++ ++/* D-Bus property accessors: */ ++guint gxdp_trash_get_version (GXdpTrash *object); ++void gxdp_trash_set_version (GXdpTrash *object, guint value); ++ ++ ++/* ---- */ ++ ++#define GXDP_TYPE_TRASH_PROXY (gxdp_trash_proxy_get_type ()) ++#define GXDP_TRASH_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_TRASH_PROXY, GXdpTrashProxy)) ++#define GXDP_TRASH_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GXDP_TYPE_TRASH_PROXY, GXdpTrashProxyClass)) ++#define GXDP_TRASH_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GXDP_TYPE_TRASH_PROXY, GXdpTrashProxyClass)) ++#define GXDP_IS_TRASH_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_TRASH_PROXY)) ++#define GXDP_IS_TRASH_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GXDP_TYPE_TRASH_PROXY)) ++ ++typedef struct _GXdpTrashProxy GXdpTrashProxy; ++typedef struct _GXdpTrashProxyClass GXdpTrashProxyClass; ++typedef struct _GXdpTrashProxyPrivate GXdpTrashProxyPrivate; ++ ++struct _GXdpTrashProxy ++{ ++ /*< private >*/ ++ GDBusProxy parent_instance; ++ GXdpTrashProxyPrivate *priv; ++}; ++ ++struct _GXdpTrashProxyClass ++{ ++ GDBusProxyClass parent_class; ++}; ++ ++GType gxdp_trash_proxy_get_type (void) G_GNUC_CONST; ++ ++#if GLIB_CHECK_VERSION(2, 44, 0) ++G_DEFINE_AUTOPTR_CLEANUP_FUNC (GXdpTrashProxy, g_object_unref) ++#endif ++ ++void gxdp_trash_proxy_new ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++GXdpTrash *gxdp_trash_proxy_new_finish ( ++ GAsyncResult *res, ++ GError **error); ++GXdpTrash *gxdp_trash_proxy_new_sync ( ++ GDBusConnection *connection, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++void gxdp_trash_proxy_new_for_bus ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GAsyncReadyCallback callback, ++ gpointer user_data); ++GXdpTrash *gxdp_trash_proxy_new_for_bus_finish ( ++ GAsyncResult *res, ++ GError **error); ++GXdpTrash *gxdp_trash_proxy_new_for_bus_sync ( ++ GBusType bus_type, ++ GDBusProxyFlags flags, ++ const gchar *name, ++ const gchar *object_path, ++ GCancellable *cancellable, ++ GError **error); ++ ++ ++/* ---- */ ++ ++#define GXDP_TYPE_TRASH_SKELETON (gxdp_trash_skeleton_get_type ()) ++#define GXDP_TRASH_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GXDP_TYPE_TRASH_SKELETON, GXdpTrashSkeleton)) ++#define GXDP_TRASH_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GXDP_TYPE_TRASH_SKELETON, GXdpTrashSkeletonClass)) ++#define GXDP_TRASH_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GXDP_TYPE_TRASH_SKELETON, GXdpTrashSkeletonClass)) ++#define GXDP_IS_TRASH_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GXDP_TYPE_TRASH_SKELETON)) ++#define GXDP_IS_TRASH_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GXDP_TYPE_TRASH_SKELETON)) ++ ++typedef struct _GXdpTrashSkeleton GXdpTrashSkeleton; ++typedef struct _GXdpTrashSkeletonClass GXdpTrashSkeletonClass; ++typedef struct _GXdpTrashSkeletonPrivate GXdpTrashSkeletonPrivate; ++ ++struct _GXdpTrashSkeleton ++{ ++ /*< private >*/ ++ GDBusInterfaceSkeleton parent_instance; ++ GXdpTrashSkeletonPrivate *priv; ++}; ++ ++struct _GXdpTrashSkeletonClass ++{ ++ GDBusInterfaceSkeletonClass parent_class; ++}; ++ ++GType gxdp_trash_skeleton_get_type (void) G_GNUC_CONST; ++ ++#if GLIB_CHECK_VERSION(2, 44, 0) ++G_DEFINE_AUTOPTR_CLEANUP_FUNC (GXdpTrashSkeleton, g_object_unref) ++#endif ++ ++GXdpTrash *gxdp_trash_skeleton_new (void); ++ ++ ++G_END_DECLS ++ ++#endif /* __XDP_DBUS_H__ */ +diff --git a/glib/gatomic.h b/glib/gatomic.h +index 2ad648a..c8c00ab 100644 +--- a/glib/gatomic.h ++++ b/glib/gatomic.h +@@ -90,7 +90,13 @@ G_END_DECLS + #if defined(G_ATOMIC_LOCK_FREE) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) + + /* We prefer the new C11-style atomic extension of GCC if available */ +-#if defined(__ATOMIC_SEQ_CST) ++/* OHOS_GLIB_COMPATIBLE ++ * ohos.glib.compatible.001: glib 2.62.5 update 2.68.1 Incompatible with gstreamer 1.16.2 ++ * static volatile gsize _init_once = 0; // Conflicts with volatile, ++ * if (g_once_init_enter (&_init_once)) ++ * add "&& !defined(__clang__)" ++ */ ++#if defined(__ATOMIC_SEQ_CST) && !defined(__clang__) + + #define g_atomic_int_get(atomic) \ + (G_GNUC_EXTENSION ({ \ +diff --git a/glib/ggettext.c b/glib/ggettext.c +index 303b9b9..4d4cb25 100644 +--- a/glib/ggettext.c ++++ b/glib/ggettext.c +@@ -40,7 +40,12 @@ + + #include + #include ++#ifndef OHOS_OPT_COMPAT ++/* ohos.opt.compat.001: ++ * Remove dependency to gettext ++ */ + #include ++#endif + + #ifdef G_OS_WIN32 + +diff --git a/glib/gi18n-lib.h b/glib/gi18n-lib.h +index 74e50a3..b6cc3d8 100644 +--- a/glib/gi18n-lib.h ++++ b/glib/gi18n-lib.h +@@ -20,7 +20,12 @@ + + #include + ++#ifndef OHOS_OPT_COMPAT ++/* ohos.opt.compat.001: ++ * Remove dependency to gettext ++ */ + #include ++#endif + #include + + #ifndef GETTEXT_PACKAGE +diff --git a/glib/gi18n.h b/glib/gi18n.h +index 5f996d2..a3e11c4 100644 +--- a/glib/gi18n.h ++++ b/glib/gi18n.h +@@ -20,7 +20,12 @@ + + #include + ++#ifndef OHOS_OPT_COMPAT ++/* ohos.opt.compat.001: ++ * Remove dependency to gettext ++ */ + #include ++#endif + #include + + #define _(String) gettext (String) +diff --git a/glib/glibconfig.h b/glib/glibconfig.h +new file mode 100644 +index 0000000..54e74bd +--- /dev/null ++++ b/glib/glibconfig.h +@@ -0,0 +1,292 @@ ++/* glibconfig.h ++ * ++ * This is a generated file. Please modify 'glibconfig.h.in' ++ */ ++ ++#ifndef __GLIBCONFIG_H__ ++#define __GLIBCONFIG_H__ ++ ++#include ++ ++#include ++#include ++#define GLIB_HAVE_ALLOCA_H ++ ++/* Specifies that GLib's g_print*() functions wrap the ++ * system printf functions. This is useful to know, for example, ++ * when using glibc's register_printf_function(). ++ */ ++#undef GLIB_USING_SYSTEM_PRINTF ++ ++/* #undef GLIB_STATIC_COMPILATION */ ++/* #undef GOBJECT_STATIC_COMPILATION */ ++ ++G_BEGIN_DECLS ++ ++#define G_MINFLOAT FLT_MIN ++#define G_MAXFLOAT FLT_MAX ++#define G_MINDOUBLE DBL_MIN ++#define G_MAXDOUBLE DBL_MAX ++#define G_MINSHORT SHRT_MIN ++#define G_MAXSHORT SHRT_MAX ++#define G_MAXUSHORT USHRT_MAX ++#define G_MININT INT_MIN ++#define G_MAXINT INT_MAX ++#define G_MAXUINT UINT_MAX ++#define G_MINLONG LONG_MIN ++#define G_MAXLONG LONG_MAX ++#define G_MAXULONG ULONG_MAX ++ ++typedef signed char gint8; ++typedef unsigned char guint8; ++ ++typedef signed short gint16; ++typedef unsigned short guint16; ++ ++#define G_GINT16_MODIFIER "h" ++#define G_GINT16_FORMAT "hi" ++#define G_GUINT16_FORMAT "hu" ++ ++ ++typedef signed int gint32; ++typedef unsigned int guint32; ++ ++#define G_GINT32_MODIFIER "" ++#define G_GINT32_FORMAT "i" ++#define G_GUINT32_FORMAT "u" ++ ++ ++#define G_HAVE_GINT64 1 /* deprecated, always true */ ++ ++#ifdef __LP64__ ++ ++typedef signed long gint64; ++typedef unsigned long guint64; ++ ++#define G_GINT64_CONSTANT(val) (val##L) ++#define G_GUINT64_CONSTANT(val) (val##UL) ++ ++#define G_GINT64_MODIFIER "l" ++#define G_GINT64_FORMAT "li" ++#define G_GUINT64_FORMAT "lu" ++ ++ ++#define GLIB_SIZEOF_VOID_P 8 ++#define GLIB_SIZEOF_LONG 8 ++#define GLIB_SIZEOF_SIZE_T 8 ++#define GLIB_SIZEOF_SSIZE_T 8 ++ ++typedef signed long gssize; ++typedef unsigned long gsize; ++#define G_GSIZE_MODIFIER "l" ++#define G_GSSIZE_MODIFIER "l" ++#define G_GSIZE_FORMAT "lu" ++#define G_GSSIZE_FORMAT "li" ++ ++#define G_MAXSIZE G_MAXULONG ++#define G_MINSSIZE G_MINLONG ++#define G_MAXSSIZE G_MAXLONG ++ ++typedef gint64 goffset; ++#define G_MINOFFSET G_MININT64 ++#define G_MAXOFFSET G_MAXINT64 ++ ++#define G_GOFFSET_MODIFIER G_GINT64_MODIFIER ++#define G_GOFFSET_FORMAT G_GINT64_FORMAT ++#define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val) ++ ++#define G_POLLFD_FORMAT "%d" ++ ++#define GPOINTER_TO_INT(p) ((gint) (glong) (p)) ++#define GPOINTER_TO_UINT(p) ((guint) (gulong) (p)) ++ ++#define GINT_TO_POINTER(i) ((gpointer) (glong) (i)) ++#define GUINT_TO_POINTER(u) ((gpointer) (gulong) (u)) ++ ++typedef signed long gintptr; ++typedef unsigned long guintptr; ++ ++#define G_GINTPTR_MODIFIER "l" ++#define G_GINTPTR_FORMAT "li" ++#define G_GUINTPTR_FORMAT "lu" ++ ++#else ++ ++G_GNUC_EXTENSION typedef signed long long gint64; ++G_GNUC_EXTENSION typedef unsigned long long guint64; ++ ++#define G_GINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##LL)) ++#define G_GUINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##ULL)) ++ ++#define G_GINT64_MODIFIER "ll" ++#define G_GINT64_FORMAT "lli" ++#define G_GUINT64_FORMAT "llu" ++ ++ ++#define GLIB_SIZEOF_VOID_P 4 ++#define GLIB_SIZEOF_LONG 4 ++#define GLIB_SIZEOF_SIZE_T 4 ++#define GLIB_SIZEOF_SSIZE_T 4 ++ ++typedef signed int gssize; ++typedef unsigned int gsize; ++#define G_GSIZE_MODIFIER "" ++#define G_GSSIZE_MODIFIER "" ++#define G_GSIZE_FORMAT "u" ++#define G_GSSIZE_FORMAT "i" ++ ++#define G_MAXSIZE G_MAXUINT ++#define G_MINSSIZE G_MININT ++#define G_MAXSSIZE G_MAXINT ++ ++typedef gint64 goffset; ++#define G_MINOFFSET G_MININT64 ++#define G_MAXOFFSET G_MAXINT64 ++ ++#define G_GOFFSET_MODIFIER G_GINT64_MODIFIER ++#define G_GOFFSET_FORMAT G_GINT64_FORMAT ++#define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val) ++ ++#define G_POLLFD_FORMAT "%d" ++ ++#define GPOINTER_TO_INT(p) ((gint) (gint) (p)) ++#define GPOINTER_TO_UINT(p) ((guint) (guint) (p)) ++ ++#define GINT_TO_POINTER(i) ((gpointer) (gint) (i)) ++#define GUINT_TO_POINTER(u) ((gpointer) (guint) (u)) ++ ++typedef signed int gintptr; ++typedef unsigned int guintptr; ++ ++#define G_GINTPTR_MODIFIER "" ++#define G_GINTPTR_FORMAT "i" ++#define G_GUINTPTR_FORMAT "u" ++#endif ++ ++ ++#define GLIB_MAJOR_VERSION 2 ++#define GLIB_MINOR_VERSION 68 ++#define GLIB_MICRO_VERSION 1 ++ ++#define G_OS_UNIX ++ ++#define G_VA_COPY va_copy ++#define G_VA_COPY_AS_ARRAY 1 ++ ++ ++#ifndef __cplusplus ++# define G_HAVE_ISO_VARARGS 1 ++#endif ++ ++#ifdef __cplusplus ++# define G_HAVE_ISO_VARARGS 1 ++#endif ++ ++/* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi ++ * is passed ISO vararg support is turned off, and there is no work ++ * around to turn it on, so we unconditionally turn it off. ++ */ ++#if __GNUC__ == 2 && __GNUC_MINOR__ == 95 ++# undef G_HAVE_ISO_VARARGS ++#endif ++ ++#define G_HAVE_GROWING_STACK 0 ++#define G_HAVE_GNUC_VISIBILITY 1 ++ ++#ifndef _MSC_VER ++# define G_HAVE_GNUC_VARARGS 1 ++#endif ++ ++#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) ++#define G_GNUC_INTERNAL __attribute__((visibility("hidden"))) ++#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) ++#define G_GNUC_INTERNAL __hidden ++#elif defined (__GNUC__) && defined (G_HAVE_GNUC_VISIBILITY) ++#define G_GNUC_INTERNAL __attribute__((visibility("hidden"))) ++#else ++#define G_GNUC_INTERNAL ++#endif ++ ++#define G_THREADS_ENABLED ++#define G_THREADS_IMPL_POSIX ++ ++#define G_ATOMIC_LOCK_FREE ++ ++#define GINT16_TO_LE(val) ((gint16) (val)) ++#define GUINT16_TO_LE(val) ((guint16) (val)) ++#define GINT16_TO_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val)) ++#define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) ++ ++#define GINT32_TO_LE(val) ((gint32) (val)) ++#define GUINT32_TO_LE(val) ((guint32) (val)) ++#define GINT32_TO_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val)) ++#define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) ++ ++#define GINT64_TO_LE(val) ((gint64) (val)) ++#define GUINT64_TO_LE(val) ((guint64) (val)) ++#define GINT64_TO_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val)) ++#define GUINT64_TO_BE(val) (GUINT64_SWAP_LE_BE (val)) ++ ++#ifdef __LP64__ ++ ++#define GLONG_TO_LE(val) ((glong) GINT64_TO_LE (val)) ++#define GULONG_TO_LE(val) ((gulong) GUINT64_TO_LE (val)) ++#define GLONG_TO_BE(val) ((glong) GINT64_TO_BE (val)) ++#define GULONG_TO_BE(val) ((gulong) GUINT64_TO_BE (val)) ++#define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val)) ++#define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val)) ++#define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val)) ++#define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val)) ++#define GSIZE_TO_LE(val) ((gsize) GUINT64_TO_LE (val)) ++#define GSSIZE_TO_LE(val) ((gssize) GINT64_TO_LE (val)) ++#define GSIZE_TO_BE(val) ((gsize) GUINT64_TO_BE (val)) ++#define GSSIZE_TO_BE(val) ((gssize) GINT64_TO_BE (val)) ++#define G_BYTE_ORDER G_LITTLE_ENDIAN ++ ++#else ++ ++#define GLONG_TO_LE(val) ((glong) GINT32_TO_LE (val)) ++#define GULONG_TO_LE(val) ((gulong) GUINT32_TO_LE (val)) ++#define GLONG_TO_BE(val) ((glong) GINT32_TO_BE (val)) ++#define GULONG_TO_BE(val) ((gulong) GUINT32_TO_BE (val)) ++#define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val)) ++#define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val)) ++#define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val)) ++#define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val)) ++#define GSIZE_TO_LE(val) ((gsize) GUINT32_TO_LE (val)) ++#define GSSIZE_TO_LE(val) ((gssize) GINT32_TO_LE (val)) ++#define GSIZE_TO_BE(val) ((gsize) GUINT32_TO_BE (val)) ++#define GSSIZE_TO_BE(val) ((gssize) GINT32_TO_BE (val)) ++#define G_BYTE_ORDER G_LITTLE_ENDIAN ++ ++#endif ++ ++ ++#define GLIB_SYSDEF_POLLIN =1 ++#define GLIB_SYSDEF_POLLOUT =4 ++#define GLIB_SYSDEF_POLLPRI =2 ++#define GLIB_SYSDEF_POLLHUP =16 ++#define GLIB_SYSDEF_POLLERR =8 ++#define GLIB_SYSDEF_POLLNVAL =32 ++ ++#define G_MODULE_SUFFIX "so" ++ ++typedef int GPid; ++#define G_PID_FORMAT "i" ++ ++#define GLIB_SYSDEF_AF_UNIX 1 ++#define GLIB_SYSDEF_AF_INET 2 ++#define GLIB_SYSDEF_AF_INET6 10 ++ ++#define GLIB_SYSDEF_MSG_OOB 1 ++#define GLIB_SYSDEF_MSG_PEEK 2 ++#define GLIB_SYSDEF_MSG_DONTROUTE 4 ++ ++#define G_DIR_SEPARATOR '/' ++#define G_DIR_SEPARATOR_S "/" ++#define G_SEARCHPATH_SEPARATOR ':' ++#define G_SEARCHPATH_SEPARATOR_S ":" ++ ++G_END_DECLS ++ ++#endif /* __GLIBCONFIG_H__ */ +diff --git a/glib/gregex.c b/glib/gregex.c +index 5e6ddfb..3ab76ca 100644 +--- a/glib/gregex.c ++++ b/glib/gregex.c +@@ -22,11 +22,8 @@ + + #include + +-#ifdef USE_SYSTEM_PCRE +-#include +-#else +-#include "pcre/pcre.h" +-#endif ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + + #include "gtypes.h" + #include "gregex.h" +@@ -110,87 +107,49 @@ + * library written by Philip Hazel. + */ + ++/* signifies that flags have already been converted from pcre1 to pcre2 */ ++#define G_REGEX_FLAGS_CONVERTED 0x04000000u + /* Mask of all the possible values for GRegexCompileFlags. */ +-#define G_REGEX_COMPILE_MASK (G_REGEX_CASELESS | \ +- G_REGEX_MULTILINE | \ +- G_REGEX_DOTALL | \ +- G_REGEX_EXTENDED | \ +- G_REGEX_ANCHORED | \ +- G_REGEX_DOLLAR_ENDONLY | \ +- G_REGEX_UNGREEDY | \ +- G_REGEX_RAW | \ +- G_REGEX_NO_AUTO_CAPTURE | \ +- G_REGEX_OPTIMIZE | \ +- G_REGEX_FIRSTLINE | \ +- G_REGEX_DUPNAMES | \ +- G_REGEX_NEWLINE_CR | \ +- G_REGEX_NEWLINE_LF | \ +- G_REGEX_NEWLINE_CRLF | \ +- G_REGEX_NEWLINE_ANYCRLF | \ +- G_REGEX_BSR_ANYCRLF | \ +- G_REGEX_JAVASCRIPT_COMPAT) ++#define G_REGEX_COMPILE_MASK (PCRE2_CASELESS | \ ++ PCRE2_MULTILINE | \ ++ PCRE2_DOTALL | \ ++ PCRE2_EXTENDED | \ ++ PCRE2_ANCHORED | \ ++ PCRE2_DOLLAR_ENDONLY | \ ++ PCRE2_UNGREEDY | \ ++ PCRE2_UTF | \ ++ PCRE2_NO_AUTO_CAPTURE | \ ++ PCRE2_FIRSTLINE | \ ++ PCRE2_DUPNAMES | \ ++ PCRE2_NEWLINE_CR | \ ++ PCRE2_NEWLINE_LF | \ ++ PCRE2_NEWLINE_CRLF | \ ++ PCRE2_NEWLINE_ANYCRLF | \ ++ PCRE2_BSR_ANYCRLF | \ ++ G_REGEX_FLAGS_CONVERTED) + + /* Mask of all GRegexCompileFlags values that are (not) passed trough to PCRE */ + #define G_REGEX_COMPILE_PCRE_MASK (G_REGEX_COMPILE_MASK & ~G_REGEX_COMPILE_NONPCRE_MASK) +-#define G_REGEX_COMPILE_NONPCRE_MASK (G_REGEX_RAW | \ +- G_REGEX_OPTIMIZE) ++#define G_REGEX_COMPILE_NONPCRE_MASK (PCRE2_UTF | \ ++ G_REGEX_FLAGS_CONVERTED) + + /* Mask of all the possible values for GRegexMatchFlags. */ +-#define G_REGEX_MATCH_MASK (G_REGEX_MATCH_ANCHORED | \ +- G_REGEX_MATCH_NOTBOL | \ +- G_REGEX_MATCH_NOTEOL | \ +- G_REGEX_MATCH_NOTEMPTY | \ +- G_REGEX_MATCH_PARTIAL | \ +- G_REGEX_MATCH_NEWLINE_CR | \ +- G_REGEX_MATCH_NEWLINE_LF | \ +- G_REGEX_MATCH_NEWLINE_CRLF | \ +- G_REGEX_MATCH_NEWLINE_ANY | \ +- G_REGEX_MATCH_NEWLINE_ANYCRLF | \ +- G_REGEX_MATCH_BSR_ANYCRLF | \ +- G_REGEX_MATCH_BSR_ANY | \ +- G_REGEX_MATCH_PARTIAL_SOFT | \ +- G_REGEX_MATCH_PARTIAL_HARD | \ +- G_REGEX_MATCH_NOTEMPTY_ATSTART) +- +-/* we rely on these flags having the same values */ +-G_STATIC_ASSERT (G_REGEX_CASELESS == PCRE_CASELESS); +-G_STATIC_ASSERT (G_REGEX_MULTILINE == PCRE_MULTILINE); +-G_STATIC_ASSERT (G_REGEX_DOTALL == PCRE_DOTALL); +-G_STATIC_ASSERT (G_REGEX_EXTENDED == PCRE_EXTENDED); +-G_STATIC_ASSERT (G_REGEX_ANCHORED == PCRE_ANCHORED); +-G_STATIC_ASSERT (G_REGEX_DOLLAR_ENDONLY == PCRE_DOLLAR_ENDONLY); +-G_STATIC_ASSERT (G_REGEX_UNGREEDY == PCRE_UNGREEDY); +-G_STATIC_ASSERT (G_REGEX_NO_AUTO_CAPTURE == PCRE_NO_AUTO_CAPTURE); +-G_STATIC_ASSERT (G_REGEX_FIRSTLINE == PCRE_FIRSTLINE); +-G_STATIC_ASSERT (G_REGEX_DUPNAMES == PCRE_DUPNAMES); +-G_STATIC_ASSERT (G_REGEX_NEWLINE_CR == PCRE_NEWLINE_CR); +-G_STATIC_ASSERT (G_REGEX_NEWLINE_LF == PCRE_NEWLINE_LF); +-G_STATIC_ASSERT (G_REGEX_NEWLINE_CRLF == PCRE_NEWLINE_CRLF); +-G_STATIC_ASSERT (G_REGEX_NEWLINE_ANYCRLF == PCRE_NEWLINE_ANYCRLF); +-G_STATIC_ASSERT (G_REGEX_BSR_ANYCRLF == PCRE_BSR_ANYCRLF); +-G_STATIC_ASSERT (G_REGEX_JAVASCRIPT_COMPAT == PCRE_JAVASCRIPT_COMPAT); +- +-G_STATIC_ASSERT (G_REGEX_MATCH_ANCHORED == PCRE_ANCHORED); +-G_STATIC_ASSERT (G_REGEX_MATCH_NOTBOL == PCRE_NOTBOL); +-G_STATIC_ASSERT (G_REGEX_MATCH_NOTEOL == PCRE_NOTEOL); +-G_STATIC_ASSERT (G_REGEX_MATCH_NOTEMPTY == PCRE_NOTEMPTY); +-G_STATIC_ASSERT (G_REGEX_MATCH_PARTIAL == PCRE_PARTIAL); +-G_STATIC_ASSERT (G_REGEX_MATCH_NEWLINE_CR == PCRE_NEWLINE_CR); +-G_STATIC_ASSERT (G_REGEX_MATCH_NEWLINE_LF == PCRE_NEWLINE_LF); +-G_STATIC_ASSERT (G_REGEX_MATCH_NEWLINE_CRLF == PCRE_NEWLINE_CRLF); +-G_STATIC_ASSERT (G_REGEX_MATCH_NEWLINE_ANY == PCRE_NEWLINE_ANY); +-G_STATIC_ASSERT (G_REGEX_MATCH_NEWLINE_ANYCRLF == PCRE_NEWLINE_ANYCRLF); +-G_STATIC_ASSERT (G_REGEX_MATCH_BSR_ANYCRLF == PCRE_BSR_ANYCRLF); +-G_STATIC_ASSERT (G_REGEX_MATCH_BSR_ANY == PCRE_BSR_UNICODE); +-G_STATIC_ASSERT (G_REGEX_MATCH_PARTIAL_SOFT == PCRE_PARTIAL_SOFT); +-G_STATIC_ASSERT (G_REGEX_MATCH_PARTIAL_HARD == PCRE_PARTIAL_HARD); +-G_STATIC_ASSERT (G_REGEX_MATCH_NOTEMPTY_ATSTART == PCRE_NOTEMPTY_ATSTART); +- +-/* These PCRE flags are unused or not exposed publicly in GRegexFlags, so +- * it should be ok to reuse them for different things. +- */ +-G_STATIC_ASSERT (G_REGEX_OPTIMIZE == PCRE_NO_UTF8_CHECK); +-G_STATIC_ASSERT (G_REGEX_RAW == PCRE_UTF8); ++#define G_REGEX_MATCH_MASK (PCRE2_ANCHORED | \ ++ PCRE2_NOTBOL | \ ++ PCRE2_NOTEOL | \ ++ PCRE2_NOTEMPTY | \ ++ PCRE2_PARTIAL_SOFT | \ ++ PCRE2_NEWLINE_CR | \ ++ PCRE2_NEWLINE_LF | \ ++ PCRE2_NEWLINE_CRLF | \ ++ PCRE2_NEWLINE_ANY | \ ++ PCRE2_NEWLINE_ANYCRLF | \ ++ PCRE2_BSR_ANYCRLF | \ ++ PCRE2_BSR_UNICODE | \ ++ PCRE2_PARTIAL_SOFT | \ ++ PCRE2_PARTIAL_HARD | \ ++ PCRE2_NOTEMPTY_ATSTART | \ ++ G_REGEX_FLAGS_CONVERTED) + + /* if the string is in UTF-8 use g_utf8_ functions, else use + * use just +/- 1. */ +@@ -214,20 +173,20 @@ struct _GMatchInfo + gint n_workspace; /* number of workspace elements */ + const gchar *string; /* string passed to the match function */ + gssize string_len; /* length of string, in bytes */ ++ pcre2_match_data *match_data; + }; + + struct _GRegex + { + gint ref_count; /* the ref count for the immutable part (atomic) */ + gchar *pattern; /* the pattern */ +- pcre *pcre_re; /* compiled form of the pattern */ ++ pcre2_code *pcre_re; /* compiled form of the pattern */ + GRegexCompileFlags compile_opts; /* options used at compile time on the pattern */ + GRegexMatchFlags match_opts; /* options used at match time on the regex */ +- pcre_extra *extra; /* data stored when G_REGEX_OPTIMIZE is used */ + }; + + /* TRUE if ret is an error code, FALSE otherwise. */ +-#define IS_PCRE_ERROR(ret) ((ret) < PCRE_ERROR_NOMATCH && (ret) != PCRE_ERROR_PARTIAL) ++#define IS_PCRE_ERROR(ret) ((ret) < PCRE2_ERROR_NOMATCH && (ret) != PCRE2_ERROR_PARTIAL) + + typedef struct _InterpolationData InterpolationData; + static gboolean interpolation_list_needs_match (GList *list); +@@ -238,70 +197,396 @@ static GList *split_replacement (const gchar *replacement, + GError **error); + static void free_interpolation_data (InterpolationData *data); + ++static gint ++map_to_pcre2_compile_flags (gint pcre1_flags) ++{ ++ /* Maps compile flags from pcre1 to pcre2 values ++ */ ++ gint pcre2_flags = G_REGEX_FLAGS_CONVERTED; ++ ++ if (pcre1_flags & G_REGEX_FLAGS_CONVERTED) ++ return pcre1_flags; ++ ++ if (pcre1_flags & G_REGEX_CASELESS) ++ pcre2_flags |= PCRE2_CASELESS; ++ if (pcre1_flags & G_REGEX_MULTILINE) ++ pcre2_flags |= PCRE2_MULTILINE; ++ if (pcre1_flags & G_REGEX_DOTALL) ++ pcre2_flags |= PCRE2_DOTALL; ++ if (pcre1_flags & G_REGEX_EXTENDED) ++ pcre2_flags |= PCRE2_EXTENDED; ++ if (pcre1_flags & G_REGEX_ANCHORED) ++ pcre2_flags |= PCRE2_ANCHORED; ++ if (pcre1_flags & G_REGEX_DOLLAR_ENDONLY) ++ pcre2_flags |= PCRE2_DOLLAR_ENDONLY; ++ if (pcre1_flags & G_REGEX_UNGREEDY) ++ pcre2_flags |= PCRE2_UNGREEDY; ++ if (pcre1_flags & G_REGEX_RAW) ++ pcre2_flags |= PCRE2_UTF; ++ if (pcre1_flags & G_REGEX_NO_AUTO_CAPTURE) ++ pcre2_flags |= PCRE2_NO_AUTO_CAPTURE; ++ if (pcre1_flags & G_REGEX_FIRSTLINE) ++ pcre2_flags |= PCRE2_FIRSTLINE; ++ if (pcre1_flags & G_REGEX_DUPNAMES) ++ pcre2_flags |= PCRE2_DUPNAMES; ++ if (pcre1_flags & G_REGEX_NEWLINE_CR) ++ pcre2_flags |= PCRE2_NEWLINE_CR; ++ if (pcre1_flags & G_REGEX_NEWLINE_LF) ++ pcre2_flags |= PCRE2_NEWLINE_LF; ++ if ((pcre1_flags & G_REGEX_NEWLINE_CRLF) == G_REGEX_NEWLINE_CRLF) ++ pcre2_flags |= PCRE2_NEWLINE_CRLF; ++ if ((pcre1_flags & G_REGEX_NEWLINE_ANYCRLF) == G_REGEX_NEWLINE_ANYCRLF) ++ pcre2_flags |= PCRE2_NEWLINE_ANYCRLF; ++ if (pcre1_flags & G_REGEX_BSR_ANYCRLF) ++ pcre2_flags |= PCRE2_BSR_ANYCRLF; ++ ++ /* these are not available in pcre2 */ ++ if (pcre1_flags & G_REGEX_OPTIMIZE) ++ pcre2_flags |= 0; ++ if (pcre1_flags & G_REGEX_JAVASCRIPT_COMPAT) ++ pcre2_flags |= 0; ++ ++ return pcre2_flags; ++} ++ ++static gint ++map_to_pcre2_match_flags (gint pcre1_flags) ++{ ++ /* Maps match flags from pcre1 to pcre2 values ++ */ ++ gint pcre2_flags = G_REGEX_FLAGS_CONVERTED; ++ ++ if (pcre1_flags & G_REGEX_FLAGS_CONVERTED) ++ return pcre1_flags; ++ ++ if (pcre1_flags & G_REGEX_MATCH_ANCHORED) ++ pcre2_flags |= PCRE2_ANCHORED; ++ if (pcre1_flags & G_REGEX_MATCH_NOTBOL) ++ pcre2_flags |= PCRE2_NOTBOL; ++ if (pcre1_flags & G_REGEX_MATCH_NOTEOL) ++ pcre2_flags |= PCRE2_NOTEOL; ++ if (pcre1_flags & G_REGEX_MATCH_NOTEMPTY) ++ pcre2_flags |= PCRE2_NOTEMPTY; ++ if (pcre1_flags & G_REGEX_MATCH_PARTIAL) ++ pcre2_flags |= PCRE2_PARTIAL_SOFT; ++ if (pcre1_flags & G_REGEX_MATCH_NEWLINE_CR) ++ pcre2_flags |= PCRE2_NEWLINE_CR; ++ if (pcre1_flags & G_REGEX_MATCH_NEWLINE_LF) ++ pcre2_flags |= PCRE2_NEWLINE_LF; ++ if ((pcre1_flags & G_REGEX_MATCH_NEWLINE_CRLF) == G_REGEX_MATCH_NEWLINE_CRLF) ++ pcre2_flags |= PCRE2_NEWLINE_CRLF; ++ if (pcre1_flags & G_REGEX_MATCH_NEWLINE_ANY) ++ pcre2_flags |= PCRE2_NEWLINE_ANY; ++ if ((pcre1_flags & G_REGEX_MATCH_NEWLINE_ANYCRLF) == G_REGEX_MATCH_NEWLINE_ANYCRLF) ++ pcre2_flags |= PCRE2_NEWLINE_ANYCRLF; ++ if (pcre1_flags & G_REGEX_MATCH_BSR_ANYCRLF) ++ pcre2_flags |= PCRE2_BSR_ANYCRLF; ++ if (pcre1_flags & G_REGEX_MATCH_BSR_ANY) ++ pcre2_flags |= PCRE2_BSR_UNICODE; ++ if (pcre1_flags & G_REGEX_MATCH_PARTIAL_SOFT) ++ pcre2_flags |= PCRE2_PARTIAL_SOFT; ++ if (pcre1_flags & G_REGEX_MATCH_PARTIAL_HARD) ++ pcre2_flags |= PCRE2_PARTIAL_HARD; ++ if (pcre1_flags & G_REGEX_MATCH_NOTEMPTY_ATSTART) ++ pcre2_flags |= PCRE2_NOTEMPTY_ATSTART; ++ if (pcre1_flags & G_REGEX_RAW) ++ pcre2_flags |= PCRE2_UTF; ++ ++ return pcre2_flags; ++} ++ ++static gint ++map_to_pcre1_compile_flags (gint pcre2_flags) ++{ ++ /* Maps compile flags from pcre2 to pcre1 values ++ */ ++ gint pcre1_flags = 0; ++ ++ if (!(pcre2_flags & G_REGEX_FLAGS_CONVERTED)) ++ return pcre2_flags; ++ ++ if (pcre2_flags & PCRE2_CASELESS) ++ pcre1_flags |= G_REGEX_CASELESS; ++ if (pcre2_flags & PCRE2_MULTILINE) ++ pcre1_flags |= G_REGEX_MULTILINE; ++ if (pcre2_flags & PCRE2_DOTALL) ++ pcre1_flags |= G_REGEX_DOTALL; ++ if (pcre2_flags & PCRE2_EXTENDED) ++ pcre1_flags |= G_REGEX_EXTENDED; ++ if (pcre2_flags & PCRE2_ANCHORED) ++ pcre1_flags |= G_REGEX_ANCHORED; ++ if (pcre2_flags & PCRE2_DOLLAR_ENDONLY) ++ pcre1_flags |= G_REGEX_DOLLAR_ENDONLY; ++ if (pcre2_flags & PCRE2_UNGREEDY) ++ pcre1_flags |= G_REGEX_UNGREEDY; ++ if (pcre2_flags & PCRE2_UTF) ++ pcre1_flags |= G_REGEX_RAW; ++ if (pcre2_flags & PCRE2_NO_AUTO_CAPTURE) ++ pcre1_flags |= G_REGEX_NO_AUTO_CAPTURE; ++ if (pcre2_flags & PCRE2_FIRSTLINE) ++ pcre1_flags |= G_REGEX_FIRSTLINE; ++ if (pcre2_flags & PCRE2_DUPNAMES) ++ pcre1_flags |= G_REGEX_DUPNAMES; ++ if (pcre2_flags & PCRE2_NEWLINE_CR) ++ pcre1_flags |= G_REGEX_NEWLINE_CR; ++ if (pcre2_flags & PCRE2_NEWLINE_LF) ++ pcre1_flags |= G_REGEX_NEWLINE_LF; ++ if ((pcre2_flags & PCRE2_NEWLINE_CRLF) == PCRE2_NEWLINE_CRLF) ++ pcre1_flags |= G_REGEX_NEWLINE_CRLF; ++ if ((pcre2_flags & PCRE2_NEWLINE_ANYCRLF) == PCRE2_NEWLINE_ANYCRLF) ++ pcre1_flags |= G_REGEX_NEWLINE_ANYCRLF; ++ if (pcre2_flags & PCRE2_BSR_ANYCRLF) ++ pcre1_flags |= G_REGEX_BSR_ANYCRLF; ++ ++ return pcre1_flags; ++} ++ ++static gint ++map_to_pcre1_match_flags (gint pcre2_flags) ++{ ++ /* Maps match flags from pcre2 to pcre1 values ++ */ ++ gint pcre1_flags = 0; ++ ++ if (!(pcre2_flags & G_REGEX_FLAGS_CONVERTED)) ++ return pcre2_flags; ++ ++ if (pcre2_flags & PCRE2_ANCHORED) ++ pcre1_flags |= G_REGEX_MATCH_ANCHORED; ++ if (pcre2_flags & PCRE2_NOTBOL) ++ pcre1_flags |= G_REGEX_MATCH_NOTBOL; ++ if (pcre2_flags & PCRE2_NOTEOL) ++ pcre1_flags |= G_REGEX_MATCH_NOTEOL; ++ if (pcre2_flags & PCRE2_NOTEMPTY) ++ pcre1_flags |= G_REGEX_MATCH_NOTEMPTY; ++ if (pcre2_flags & PCRE2_PARTIAL_SOFT) ++ pcre1_flags |= G_REGEX_MATCH_PARTIAL; ++ if (pcre2_flags & PCRE2_NEWLINE_CR) ++ pcre1_flags |= G_REGEX_MATCH_NEWLINE_CR; ++ if (pcre2_flags & PCRE2_NEWLINE_LF) ++ pcre1_flags |= G_REGEX_MATCH_NEWLINE_LF; ++ if ((pcre2_flags & PCRE2_NEWLINE_CRLF) == PCRE2_NEWLINE_CRLF) ++ pcre1_flags |= G_REGEX_MATCH_NEWLINE_CRLF; ++ if (pcre2_flags & PCRE2_NEWLINE_ANY) ++ pcre1_flags |= G_REGEX_MATCH_NEWLINE_ANY; ++ if ((pcre2_flags & PCRE2_NEWLINE_ANYCRLF) == PCRE2_NEWLINE_ANYCRLF) ++ pcre1_flags |= G_REGEX_MATCH_NEWLINE_ANYCRLF; ++ if (pcre2_flags & PCRE2_BSR_ANYCRLF) ++ pcre1_flags |= G_REGEX_MATCH_BSR_ANYCRLF; ++ if (pcre2_flags & PCRE2_BSR_UNICODE) ++ pcre1_flags |= G_REGEX_MATCH_BSR_ANY; ++ if (pcre2_flags & PCRE2_PARTIAL_SOFT) ++ pcre1_flags |= G_REGEX_MATCH_PARTIAL_SOFT; ++ if (pcre2_flags & PCRE2_PARTIAL_HARD) ++ pcre1_flags |= G_REGEX_MATCH_PARTIAL_HARD; ++ if (pcre2_flags & PCRE2_NOTEMPTY_ATSTART) ++ pcre1_flags |= G_REGEX_MATCH_NOTEMPTY_ATSTART; ++ if (pcre2_flags & PCRE2_UTF) ++ pcre1_flags |= G_REGEX_RAW; ++ ++ return pcre1_flags; ++} ++ ++static gint ++map_to_gregex_error (gint pcre2_error) ++{ ++ /* Maps error codes from pcre2 to gregex values (which were based on pcre1) ++ */ ++ switch (pcre2_error) ++ { ++ case PCRE2_ERROR_END_BACKSLASH: ++ return G_REGEX_ERROR_STRAY_BACKSLASH; ++ case PCRE2_ERROR_END_BACKSLASH_C: ++ return G_REGEX_ERROR_MISSING_CONTROL_CHAR; ++ case PCRE2_ERROR_UNKNOWN_ESCAPE: ++ return G_REGEX_ERROR_UNRECOGNIZED_ESCAPE; ++ case PCRE2_ERROR_QUANTIFIER_OUT_OF_ORDER: ++ return G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER; ++ case PCRE2_ERROR_QUANTIFIER_TOO_BIG: ++ return G_REGEX_ERROR_QUANTIFIER_TOO_BIG; ++ case PCRE2_ERROR_MISSING_SQUARE_BRACKET: ++ return G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS; ++ case PCRE2_ERROR_ESCAPE_INVALID_IN_CLASS: ++ return G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS; ++ case PCRE2_ERROR_CLASS_RANGE_ORDER: ++ return G_REGEX_ERROR_RANGE_OUT_OF_ORDER; ++ case PCRE2_ERROR_QUANTIFIER_INVALID: ++ return G_REGEX_ERROR_NOTHING_TO_REPEAT; ++ case PCRE2_ERROR_INTERNAL_UNEXPECTED_REPEAT: ++ return G_REGEX_ERROR_NOTHING_TO_REPEAT; ++ case PCRE2_ERROR_INVALID_AFTER_PARENS_QUERY: ++ return G_REGEX_ERROR_UNRECOGNIZED_CHARACTER; ++ case PCRE2_ERROR_POSIX_CLASS_NOT_IN_CLASS: ++ return G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS; ++ case PCRE2_ERROR_POSIX_NO_SUPPORT_COLLATING: ++ return G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED; ++ case PCRE2_ERROR_MISSING_CLOSING_PARENTHESIS: ++ return G_REGEX_ERROR_UNMATCHED_PARENTHESIS; ++ case PCRE2_ERROR_BAD_SUBPATTERN_REFERENCE: ++ return G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE; ++ case PCRE2_ERROR_MISSING_COMMENT_CLOSING: ++ return G_REGEX_ERROR_UNTERMINATED_COMMENT; ++ case PCRE2_ERROR_PATTERN_TOO_LARGE: ++ return G_REGEX_ERROR_EXPRESSION_TOO_LARGE; ++ case PCRE2_ERROR_UNMATCHED_CLOSING_PARENTHESIS: ++ return G_REGEX_ERROR_UNMATCHED_PARENTHESIS; ++ case PCRE2_ERROR_MISSING_CONDITION_CLOSING: ++ return G_REGEX_ERROR_MALFORMED_CONDITION; ++ case PCRE2_ERROR_LOOKBEHIND_NOT_FIXED_LENGTH: ++ return G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND; ++ case PCRE2_ERROR_TOO_MANY_CONDITION_BRANCHES: ++ return G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES; ++ case PCRE2_ERROR_CONDITION_ASSERTION_EXPECTED: ++ return G_REGEX_ERROR_ASSERTION_EXPECTED; ++ case PCRE2_ERROR_BAD_RELATIVE_REFERENCE: ++ return G_REGEX_ERROR_INVALID_RELATIVE_REFERENCE; ++ case PCRE2_ERROR_UNKNOWN_POSIX_CLASS: ++ return G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME; ++ case PCRE2_ERROR_CODE_POINT_TOO_BIG: ++ return G_REGEX_ERROR_HEX_CODE_TOO_LARGE; ++ case PCRE2_ERROR_LOOKBEHIND_INVALID_BACKSLASH_C: ++ return G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND; ++ case PCRE2_ERROR_UNSUPPORTED_ESCAPE_SEQUENCE: ++ return G_REGEX_ERROR_UNRECOGNIZED_ESCAPE; ++ case PCRE2_ERROR_MISSING_NAME_TERMINATOR: ++ return G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR; ++ case PCRE2_ERROR_DUPLICATE_SUBPATTERN_NAME: ++ return G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME; ++ case PCRE2_ERROR_MALFORMED_UNICODE_PROPERTY: ++ return G_REGEX_ERROR_MALFORMED_PROPERTY; ++ case PCRE2_ERROR_UNKNOWN_UNICODE_PROPERTY: ++ return G_REGEX_ERROR_UNKNOWN_PROPERTY; ++ case PCRE2_ERROR_SUBPATTERN_NAME_TOO_LONG: ++ return G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG; ++ case PCRE2_ERROR_TOO_MANY_NAMED_SUBPATTERNS: ++ return G_REGEX_ERROR_TOO_MANY_SUBPATTERNS; ++ case PCRE2_ERROR_OCTAL_BYTE_TOO_BIG: ++ return G_REGEX_ERROR_INVALID_OCTAL_VALUE; ++ case PCRE2_ERROR_DEFINE_TOO_MANY_BRANCHES: ++ return G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE; ++ case PCRE2_ERROR_INTERNAL_UNKNOWN_NEWLINE: ++ return G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS; ++ case PCRE2_ERROR_BACKSLASH_G_SYNTAX: ++ return G_REGEX_ERROR_MISSING_BACK_REFERENCE; ++ case PCRE2_ERROR_PARENS_QUERY_R_MISSING_CLOSING: ++ return G_REGEX_ERROR_UNMATCHED_PARENTHESIS; ++ case PCRE2_ERROR_VERB_ARGUMENT_NOT_ALLOWED: ++ return G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN; ++ case PCRE2_ERROR_VERB_UNKNOWN: ++ return G_REGEX_ERROR_UNKNOWN_BACKTRACKING_CONTROL_VERB; ++ case PCRE2_ERROR_SUBPATTERN_NUMBER_TOO_BIG: ++ return G_REGEX_ERROR_NUMBER_TOO_BIG; ++ case PCRE2_ERROR_SUBPATTERN_NAME_EXPECTED: ++ return G_REGEX_ERROR_MISSING_SUBPATTERN_NAME; ++ case PCRE2_ERROR_SUBPATTERN_NAMES_MISMATCH: ++ return G_REGEX_ERROR_EXTRA_SUBPATTERN_NAME; ++ case PCRE2_ERROR_MARK_MISSING_ARGUMENT: ++ return G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED; ++ case PCRE2_ERROR_INVALID_HEXADECIMAL: ++ return G_REGEX_ERROR_HEX_CODE_TOO_LARGE; ++ case PCRE2_ERROR_BACKSLASH_C_SYNTAX: ++ return G_REGEX_ERROR_INVALID_CONTROL_CHAR; ++ case PCRE2_ERROR_BACKSLASH_K_SYNTAX: ++ return G_REGEX_ERROR_MISSING_NAME; ++ case PCRE2_ERROR_BACKSLASH_N_IN_CLASS: ++ return G_REGEX_ERROR_NOT_SUPPORTED_IN_CLASS; ++ case PCRE2_ERROR_VERB_NAME_TOO_LONG: ++ return G_REGEX_ERROR_NAME_TOO_LONG; ++ case PCRE2_ERROR_NULL_PATTERN: ++ case PCRE2_ERROR_BAD_OPTIONS: ++ case PCRE2_ERROR_PARENTHESES_NEST_TOO_DEEP: ++ case PCRE2_ERROR_HEAP_FAILED: ++ case PCRE2_ERROR_INTERNAL_CODE_OVERFLOW: ++ case PCRE2_ERROR_ZERO_RELATIVE_REFERENCE: ++ case PCRE2_ERROR_INTERNAL_STUDY_ERROR: ++ case PCRE2_ERROR_UNICODE_NOT_SUPPORTED: ++ case PCRE2_ERROR_PARENTHESES_STACK_CHECK: ++ case PCRE2_ERROR_LOOKBEHIND_TOO_COMPLICATED: ++ case PCRE2_ERROR_CALLOUT_NUMBER_TOO_BIG: ++ case PCRE2_ERROR_MISSING_CALLOUT_CLOSING: ++ case PCRE2_ERROR_ESCAPE_INVALID_IN_VERB: ++ case PCRE2_ERROR_UNRECOGNIZED_AFTER_QUERY_P: ++ case PCRE2_ERROR_INVALID_SUBPATTERN_NAME: ++ case PCRE2_ERROR_UNICODE_PROPERTIES_UNAVAILABLE: ++ case PCRE2_ERROR_CLASS_INVALID_RANGE: ++ case PCRE2_ERROR_INTERNAL_OVERRAN_WORKSPACE: ++ case PCRE2_ERROR_INTERNAL_MISSING_SUBPATTERN: ++ case PCRE2_ERROR_BACKSLASH_O_MISSING_BRACE: ++ case PCRE2_ERROR_INTERNAL_PARSED_OVERFLOW: ++ case PCRE2_ERROR_INVALID_OCTAL: ++ case PCRE2_ERROR_INTERNAL_BAD_CODE_LOOKBEHINDS: ++ case PCRE2_ERROR_CALLOUT_STRING_TOO_LONG: ++ case PCRE2_ERROR_UNICODE_DISALLOWED_CODE_POINT: ++ case PCRE2_ERROR_UTF_IS_DISABLED: ++ case PCRE2_ERROR_UCP_IS_DISABLED: ++ case PCRE2_ERROR_BACKSLASH_U_CODE_POINT_TOO_BIG: ++ case PCRE2_ERROR_MISSING_OCTAL_OR_HEX_DIGITS: ++ case PCRE2_ERROR_VERSION_CONDITION_SYNTAX: ++ case PCRE2_ERROR_INTERNAL_BAD_CODE_AUTO_POSSESS: ++ case PCRE2_ERROR_CALLOUT_NO_STRING_DELIMITER: ++ case PCRE2_ERROR_CALLOUT_BAD_STRING_DELIMITER: ++ case PCRE2_ERROR_BACKSLASH_C_CALLER_DISABLED: ++ case PCRE2_ERROR_QUERY_BARJX_NEST_TOO_DEEP: ++ case PCRE2_ERROR_BACKSLASH_C_LIBRARY_DISABLED: ++ case PCRE2_ERROR_PATTERN_TOO_COMPLICATED: ++ case PCRE2_ERROR_LOOKBEHIND_TOO_LONG: ++ case PCRE2_ERROR_PATTERN_STRING_TOO_LONG: ++ case PCRE2_ERROR_INTERNAL_BAD_CODE: ++ case PCRE2_ERROR_INTERNAL_BAD_CODE_IN_SKIP: ++ case PCRE2_ERROR_NO_SURROGATES_IN_UTF16: ++ case PCRE2_ERROR_BAD_LITERAL_OPTIONS: ++ default: ++ return G_REGEX_ERROR_COMPILE; ++ } ++} + + static const gchar * + match_error (gint errcode) + { + switch (errcode) + { +- case PCRE_ERROR_NOMATCH: ++ case PCRE2_ERROR_NOMATCH: + /* not an error */ + break; +- case PCRE_ERROR_NULL: ++ case PCRE2_ERROR_NULL: + /* NULL argument, this should not happen in GRegex */ + g_warning ("A NULL argument was passed to PCRE"); + break; +- case PCRE_ERROR_BADOPTION: ++ case PCRE2_ERROR_BADOPTION: + return "bad options"; +- case PCRE_ERROR_BADMAGIC: ++ case PCRE2_ERROR_BADMAGIC: + return _("corrupted object"); +- case PCRE_ERROR_UNKNOWN_OPCODE: +- return N_("internal error or corrupted object"); +- case PCRE_ERROR_NOMEMORY: ++ case PCRE2_ERROR_NOMEMORY: + return _("out of memory"); +- case PCRE_ERROR_NOSUBSTRING: ++ case PCRE2_ERROR_NOSUBSTRING: + /* not used by pcre_exec() */ + break; +- case PCRE_ERROR_MATCHLIMIT: ++ case PCRE2_ERROR_MATCHLIMIT: + return _("backtracking limit reached"); +- case PCRE_ERROR_CALLOUT: ++ case PCRE2_ERROR_CALLOUT: + /* callouts are not implemented */ + break; +- case PCRE_ERROR_BADUTF8: +- case PCRE_ERROR_BADUTF8_OFFSET: ++ case PCRE2_ERROR_BADUTFOFFSET: + /* we do not check if strings are valid */ + break; +- case PCRE_ERROR_PARTIAL: ++ case PCRE2_ERROR_PARTIAL: + /* not an error */ + break; +- case PCRE_ERROR_BADPARTIAL: +- return _("the pattern contains items not supported for partial matching"); +- case PCRE_ERROR_INTERNAL: ++ case PCRE2_ERROR_INTERNAL: + return _("internal error"); +- case PCRE_ERROR_BADCOUNT: +- /* negative ovecsize, this should not happen in GRegex */ +- g_warning ("A negative ovecsize was passed to PCRE"); +- break; +- case PCRE_ERROR_DFA_UITEM: ++ case PCRE2_ERROR_DFA_UITEM: + return _("the pattern contains items not supported for partial matching"); +- case PCRE_ERROR_DFA_UCOND: ++ case PCRE2_ERROR_DFA_UCOND: + return _("back references as conditions are not supported for partial matching"); +- case PCRE_ERROR_DFA_UMLIMIT: +- /* the match_field field is not used in GRegex */ +- break; +- case PCRE_ERROR_DFA_WSSIZE: ++ case PCRE2_ERROR_DFA_WSSIZE: + /* handled expanding the workspace */ + break; +- case PCRE_ERROR_DFA_RECURSE: +- case PCRE_ERROR_RECURSIONLIMIT: ++ case PCRE2_ERROR_DFA_RECURSE: ++ case PCRE2_ERROR_RECURSIONLIMIT: + return _("recursion limit reached"); +- case PCRE_ERROR_BADNEWLINE: +- return _("invalid combination of newline flags"); +- case PCRE_ERROR_BADOFFSET: ++ case PCRE2_ERROR_BADOFFSET: + return _("bad offset"); +- case PCRE_ERROR_SHORTUTF8: +- return _("short utf8"); +- case PCRE_ERROR_RECURSELOOP: ++ case PCRE2_ERROR_RECURSELOOP: + return _("recursion loop"); + default: + break; +@@ -321,7 +606,8 @@ translate_compile_error (gint *errcode, const gchar **errmsg) + * Note that there can be more PCRE errors with the same GRegexError + * and that some PCRE errors are useless for us. + */ +- *errcode += 100; ++ ++ *errcode = map_to_gregex_error (*errcode); + + switch (*errcode) + { +@@ -562,6 +848,8 @@ match_info_new (const GRegex *regex, + { + GMatchInfo *match_info; + ++ match_options = map_to_pcre2_match_flags (match_options); ++ + if (string_len < 0) + string_len = strlen (string); + +@@ -570,7 +858,7 @@ match_info_new (const GRegex *regex, + match_info->regex = g_regex_ref ((GRegex *)regex); + match_info->string = string; + match_info->string_len = string_len; +- match_info->matches = PCRE_ERROR_NOMATCH; ++ match_info->matches = PCRE2_ERROR_NOMATCH; + match_info->pos = start_position; + match_info->match_opts = match_options; + +@@ -585,8 +873,8 @@ match_info_new (const GRegex *regex, + else + { + gint capture_count; +- pcre_fullinfo (regex->pcre_re, regex->extra, +- PCRE_INFO_CAPTURECOUNT, &capture_count); ++ pcre2_pattern_info (regex->pcre_re, PCRE2_INFO_CAPTURECOUNT, ++ &capture_count); + match_info->n_offsets = (capture_count + 1) * 3; + } + +@@ -595,6 +883,10 @@ match_info_new (const GRegex *regex, + match_info->offsets[0] = -1; + match_info->offsets[1] = -1; + ++ match_info->match_data = pcre2_match_data_create_from_pattern ( ++ match_info->regex->pcre_re, ++ NULL); ++ + return match_info; + } + +@@ -669,6 +961,8 @@ g_match_info_unref (GMatchInfo *match_info) + if (g_atomic_int_dec_and_test (&match_info->ref_count)) + { + g_regex_unref (match_info->regex); ++ if (match_info->match_data) ++ pcre2_match_data_free (match_info->match_data); + g_free (match_info->offsets); + g_free (match_info->workspace); + g_free (match_info); +@@ -715,6 +1009,9 @@ g_match_info_next (GMatchInfo *match_info, + { + gint prev_match_start; + gint prev_match_end; ++ gint i; ++ gint opts; ++ PCRE2_SIZE *ovector; + + g_return_val_if_fail (match_info != NULL, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); +@@ -727,18 +1024,19 @@ g_match_info_next (GMatchInfo *match_info, + { + /* we have reached the end of the string */ + match_info->pos = -1; +- match_info->matches = PCRE_ERROR_NOMATCH; ++ match_info->matches = PCRE2_ERROR_NOMATCH; + return FALSE; + } + +- match_info->matches = pcre_exec (match_info->regex->pcre_re, +- match_info->regex->extra, +- match_info->string, +- match_info->string_len, +- match_info->pos, +- match_info->regex->match_opts | match_info->match_opts, +- match_info->offsets, +- match_info->n_offsets); ++ opts = map_to_pcre2_match_flags (match_info->regex->match_opts | match_info->match_opts); ++ match_info->matches = pcre2_match (match_info->regex->pcre_re, ++ (PCRE2_SPTR)match_info->string, ++ match_info->string_len, ++ match_info->pos, ++ opts & ~G_REGEX_FLAGS_CONVERTED, ++ match_info->match_data, ++ NULL); ++ + if (IS_PCRE_ERROR (match_info->matches)) + { + g_set_error (error, G_REGEX_ERROR, G_REGEX_ERROR_MATCH, +@@ -746,6 +1044,18 @@ g_match_info_next (GMatchInfo *match_info, + match_info->regex->pattern, match_error (match_info->matches)); + return FALSE; + } ++ else ++ { ++ match_info->n_offsets = pcre2_get_ovector_count (match_info->match_data) * 2; ++ ovector = pcre2_get_ovector_pointer (match_info->match_data); ++ match_info->offsets = g_realloc_n (match_info->offsets, ++ match_info->n_offsets, ++ sizeof (gint)); ++ for (i = 0; i < match_info->n_offsets; i++) ++ { ++ match_info->offsets[i] = (int) ovector[i]; ++ } ++ } + + /* avoid infinite loops if the pattern is an empty string or something + * equivalent */ +@@ -755,7 +1065,7 @@ g_match_info_next (GMatchInfo *match_info, + { + /* we have reached the end of the string */ + match_info->pos = -1; +- match_info->matches = PCRE_ERROR_NOMATCH; ++ match_info->matches = PCRE2_ERROR_NOMATCH; + return FALSE; + } + +@@ -831,10 +1141,10 @@ g_match_info_get_match_count (const GMatchInfo *match_info) + { + g_return_val_if_fail (match_info, -1); + +- if (match_info->matches == PCRE_ERROR_NOMATCH) ++ if (match_info->matches == PCRE2_ERROR_NOMATCH) + /* no match */ + return 0; +- else if (match_info->matches < PCRE_ERROR_NOMATCH) ++ else if (match_info->matches < PCRE2_ERROR_NOMATCH) + /* error */ + return -1; + else +@@ -889,7 +1199,7 @@ g_match_info_is_partial_match (const GMatchInfo *match_info) + { + g_return_val_if_fail (match_info != NULL, FALSE); + +- return match_info->matches == PCRE_ERROR_PARTIAL; ++ return match_info->matches == PCRE2_ERROR_PARTIAL; + } + + /** +@@ -1069,17 +1379,17 @@ get_matched_substring_number (const GMatchInfo *match_info, + const gchar *name) + { + gint entrysize; +- gchar *first, *last; ++ PCRE2_SPTR first, last; + guchar *entry; + +- if (!(match_info->regex->compile_opts & G_REGEX_DUPNAMES)) +- return pcre_get_stringnumber (match_info->regex->pcre_re, name); ++ if (!(match_info->regex->compile_opts & PCRE2_DUPNAMES)) ++ return pcre2_substring_number_from_name (match_info->regex->pcre_re, (PCRE2_SPTR)name); + + /* This code is copied from pcre_get.c: get_first_set() */ +- entrysize = pcre_get_stringtable_entries (match_info->regex->pcre_re, +- name, +- &first, +- &last); ++ entrysize = pcre2_substring_nametable_scan (match_info->regex->pcre_re, ++ (PCRE2_SPTR)name, ++ &first, ++ &last); + + if (entrysize <= 0) + return entrysize; +@@ -1259,9 +1569,7 @@ g_regex_unref (GRegex *regex) + { + g_free (regex->pattern); + if (regex->pcre_re != NULL) +- pcre_free (regex->pcre_re); +- if (regex->extra != NULL) +- pcre_free (regex->extra); ++ pcre2_code_free (regex->pcre_re); + g_free (regex); + } + } +@@ -1269,11 +1577,11 @@ g_regex_unref (GRegex *regex) + /* + * @match_options: (inout) (optional): + */ +-static pcre *regex_compile (const gchar *pattern, +- GRegexCompileFlags compile_options, +- GRegexCompileFlags *compile_options_out, +- GRegexMatchFlags *match_options, +- GError **error); ++static pcre2_code *regex_compile (const gchar *pattern, ++ GRegexCompileFlags compile_options, ++ GRegexCompileFlags *compile_options_out, ++ GRegexMatchFlags *match_options, ++ GError **error); + + /** + * g_regex_new: +@@ -1297,11 +1605,12 @@ g_regex_new (const gchar *pattern, + GError **error) + { + GRegex *regex; +- pcre *re; +- const gchar *errmsg; +- gboolean optimize = FALSE; ++ pcre2_code *re; + static gsize initialised = 0; + ++ compile_options = map_to_pcre2_compile_flags (compile_options); ++ match_options = map_to_pcre2_match_flags (match_options); ++ + g_return_val_if_fail (pattern != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail ((compile_options & ~G_REGEX_COMPILE_MASK) == 0, NULL); +@@ -1309,17 +1618,13 @@ g_regex_new (const gchar *pattern, + + if (g_once_init_enter (&initialised)) + { +- int supports_utf8, supports_ucp; ++ int supports_utf8; + +- pcre_config (PCRE_CONFIG_UTF8, &supports_utf8); ++ pcre2_config (PCRE2_CONFIG_UNICODE, &supports_utf8); + if (!supports_utf8) + g_critical (_("PCRE library is compiled without UTF8 support")); + +- pcre_config (PCRE_CONFIG_UNICODE_PROPERTIES, &supports_ucp); +- if (!supports_ucp) +- g_critical (_("PCRE library is compiled without UTF8 properties support")); +- +- g_once_init_leave (&initialised, supports_utf8 && supports_ucp ? 1 : 2); ++ g_once_init_leave (&initialised, supports_utf8 ? 1 : 2); + } + + if (G_UNLIKELY (initialised != 1)) +@@ -1329,14 +1634,8 @@ g_regex_new (const gchar *pattern, + return NULL; + } + +- /* G_REGEX_OPTIMIZE has the same numeric value of PCRE_NO_UTF8_CHECK, +- * as we do not need to wrap PCRE_NO_UTF8_CHECK. */ +- if (compile_options & G_REGEX_OPTIMIZE) +- optimize = TRUE; +- + re = regex_compile (pattern, compile_options, &compile_options, + &match_options, error); +- + if (re == NULL) + return NULL; + +@@ -1347,78 +1646,56 @@ g_regex_new (const gchar *pattern, + regex->compile_opts = compile_options; + regex->match_opts = match_options; + +- if (optimize) +- { +- regex->extra = pcre_study (regex->pcre_re, 0, &errmsg); +- if (errmsg != NULL) +- { +- GError *tmp_error = g_error_new (G_REGEX_ERROR, +- G_REGEX_ERROR_OPTIMIZE, +- _("Error while optimizing " +- "regular expression %s: %s"), +- regex->pattern, +- errmsg); +- g_propagate_error (error, tmp_error); +- +- g_regex_unref (regex); +- return NULL; +- } +- } +- + return regex; + } + +-static pcre * +-regex_compile (const gchar *pattern, +- GRegexCompileFlags compile_options, +- GRegexCompileFlags *compile_options_out, +- GRegexMatchFlags *match_options, +- GError **error) ++static pcre2_code * ++regex_compile (const gchar *pattern, ++ GRegexCompileFlags compile_options, ++ GRegexCompileFlags *compile_options_out, ++ GRegexMatchFlags *match_options, ++ GError **error) + { +- pcre *re; ++ pcre2_code *re; + const gchar *errmsg; +- gint erroffset; ++ PCRE2_SIZE erroffset; + gint errcode; + GRegexCompileFlags nonpcre_compile_options; + unsigned long int pcre_compile_options; + ++ compile_options = map_to_pcre2_compile_flags (compile_options); ++ *match_options = map_to_pcre2_match_flags (*match_options); ++ + nonpcre_compile_options = compile_options & G_REGEX_COMPILE_NONPCRE_MASK; + + /* In GRegex the string are, by default, UTF-8 encoded. PCRE + * instead uses UTF-8 only if required with PCRE_UTF8. */ +- if (compile_options & G_REGEX_RAW) ++ if (compile_options & PCRE2_UTF) + { + /* disable utf-8 */ +- compile_options &= ~G_REGEX_RAW; ++ compile_options &= ~PCRE2_UTF; + } + else + { + /* enable utf-8 */ +- compile_options |= PCRE_UTF8 | PCRE_NO_UTF8_CHECK; ++ compile_options |= PCRE2_UTF | PCRE2_NO_UTF_CHECK; + + if (match_options != NULL) +- *match_options |= PCRE_NO_UTF8_CHECK; ++ *match_options |= PCRE2_NO_UTF_CHECK; + } +- + /* PCRE_NEWLINE_ANY is the default for the internal PCRE but + * not for the system one. */ +- if (!(compile_options & G_REGEX_NEWLINE_CR) && +- !(compile_options & G_REGEX_NEWLINE_LF)) ++ if (!(compile_options & PCRE2_NEWLINE_CR) && ++ !(compile_options & PCRE2_NEWLINE_LF)) + { +- compile_options |= PCRE_NEWLINE_ANY; ++ compile_options |= PCRE2_NEWLINE_ANY; + } + +- compile_options |= PCRE_UCP; +- +- /* PCRE_BSR_UNICODE is the default for the internal PCRE but +- * possibly not for the system one. +- */ +- if (~compile_options & G_REGEX_BSR_ANYCRLF) +- compile_options |= PCRE_BSR_UNICODE; ++ compile_options |= PCRE2_UCP; + + /* compile the pattern */ +- re = pcre_compile2 (pattern, compile_options, &errcode, +- &errmsg, &erroffset, NULL); ++ re = pcre2_compile ((PCRE2_SPTR)pattern, PCRE2_ZERO_TERMINATED, compile_options & ~G_REGEX_FLAGS_CONVERTED, ++ &errcode, &erroffset, NULL); + + /* if the compilation failed, set the error member and return + * immediately */ +@@ -1434,8 +1711,8 @@ regex_compile (const gchar *pattern, + erroffset = g_utf8_pointer_to_offset (pattern, &pattern[erroffset]); + + tmp_error = g_error_new (G_REGEX_ERROR, errcode, +- _("Error while compiling regular " +- "expression %s at char %d: %s"), ++ _ ("Error while compiling regular " ++ "expression %s at char %" G_GSIZE_FORMAT ": %s"), + pattern, erroffset, errmsg); + g_propagate_error (error, tmp_error); + +@@ -1445,21 +1722,21 @@ regex_compile (const gchar *pattern, + /* For options set at the beginning of the pattern, pcre puts them into + * compile options, e.g. "(?i)foo" will make the pcre structure store + * PCRE_CASELESS even though it wasn't explicitly given for compilation. */ +- pcre_fullinfo (re, NULL, PCRE_INFO_OPTIONS, &pcre_compile_options); ++ pcre2_pattern_info (re, PCRE2_INFO_ALLOPTIONS, &pcre_compile_options); + compile_options = pcre_compile_options & G_REGEX_COMPILE_PCRE_MASK; + + /* Don't leak PCRE_NEWLINE_ANY, which is part of PCRE_NEWLINE_ANYCRLF */ +- if ((pcre_compile_options & PCRE_NEWLINE_ANYCRLF) != PCRE_NEWLINE_ANYCRLF) +- compile_options &= ~PCRE_NEWLINE_ANY; ++ if ((pcre_compile_options & PCRE2_NEWLINE_ANYCRLF) != PCRE2_NEWLINE_ANYCRLF) ++ compile_options &= ~PCRE2_NEWLINE_ANY; + + compile_options |= nonpcre_compile_options; + +- if (!(compile_options & G_REGEX_DUPNAMES)) ++ if (!(compile_options & PCRE2_DUPNAMES)) + { + gboolean jchanged = FALSE; +- pcre_fullinfo (re, NULL, PCRE_INFO_JCHANGED, &jchanged); ++ pcre2_pattern_info (re, PCRE2_INFO_JCHANGED, &jchanged); + if (jchanged) +- compile_options |= G_REGEX_DUPNAMES; ++ compile_options |= PCRE2_DUPNAMES; + } + + if (compile_options_out != 0) +@@ -1504,8 +1781,7 @@ g_regex_get_max_backref (const GRegex *regex) + { + gint value; + +- pcre_fullinfo (regex->pcre_re, regex->extra, +- PCRE_INFO_BACKREFMAX, &value); ++ pcre2_pattern_info (regex->pcre_re, PCRE2_INFO_BACKREFMAX, &value); + + return value; + } +@@ -1525,8 +1801,7 @@ g_regex_get_capture_count (const GRegex *regex) + { + gint value; + +- pcre_fullinfo (regex->pcre_re, regex->extra, +- PCRE_INFO_CAPTURECOUNT, &value); ++ pcre2_pattern_info (regex->pcre_re, PCRE2_INFO_CAPTURECOUNT, &value); + + return value; + } +@@ -1546,8 +1821,7 @@ g_regex_get_has_cr_or_lf (const GRegex *regex) + { + gint value; + +- pcre_fullinfo (regex->pcre_re, regex->extra, +- PCRE_INFO_HASCRORLF, &value); ++ pcre2_pattern_info (regex->pcre_re, PCRE2_INFO_HASCRORLF, &value); + + return !!value; + } +@@ -1569,8 +1843,8 @@ g_regex_get_max_lookbehind (const GRegex *regex) + { + gint max_lookbehind; + +- pcre_fullinfo (regex->pcre_re, regex->extra, +- PCRE_INFO_MAXLOOKBEHIND, &max_lookbehind); ++ pcre2_pattern_info (regex->pcre_re, PCRE2_INFO_MAXLOOKBEHIND, ++ &max_lookbehind); + + return max_lookbehind; + } +@@ -1594,7 +1868,7 @@ g_regex_get_compile_flags (const GRegex *regex) + { + g_return_val_if_fail (regex != NULL, 0); + +- return regex->compile_opts; ++ return map_to_pcre1_compile_flags (regex->compile_opts); + } + + /** +@@ -1612,7 +1886,7 @@ g_regex_get_match_flags (const GRegex *regex) + { + g_return_val_if_fail (regex != NULL, 0); + +- return regex->match_opts & G_REGEX_MATCH_MASK; ++ return map_to_pcre1_match_flags (regex->match_opts & G_REGEX_MATCH_MASK); + } + + /** +@@ -1646,6 +1920,9 @@ g_regex_match_simple (const gchar *pattern, + GRegex *regex; + gboolean result; + ++ compile_options = map_to_pcre2_compile_flags (compile_options); ++ match_options = map_to_pcre2_match_flags (match_options); ++ + regex = g_regex_new (pattern, compile_options, 0, NULL); + if (!regex) + return FALSE; +@@ -1713,6 +1990,8 @@ g_regex_match (const GRegex *regex, + GRegexMatchFlags match_options, + GMatchInfo **match_info) + { ++ match_options = map_to_pcre2_match_flags (match_options); ++ + return g_regex_match_full (regex, string, -1, 0, match_options, + match_info, NULL); + } +@@ -1796,6 +2075,8 @@ g_regex_match_full (const GRegex *regex, + GMatchInfo *info; + gboolean match_ok; + ++ match_options = map_to_pcre2_match_flags (match_options); ++ + g_return_val_if_fail (regex != NULL, FALSE); + g_return_val_if_fail (string != NULL, FALSE); + g_return_val_if_fail (start_position >= 0, FALSE); +@@ -1846,6 +2127,8 @@ g_regex_match_all (const GRegex *regex, + GRegexMatchFlags match_options, + GMatchInfo **match_info) + { ++ match_options = map_to_pcre2_match_flags (match_options); ++ + return g_regex_match_all_full (regex, string, -1, 0, match_options, + match_info, NULL); + } +@@ -1915,9 +2198,12 @@ g_regex_match_all_full (const GRegex *regex, + { + GMatchInfo *info; + gboolean done; +- pcre *pcre_re; +- pcre_extra *extra; ++ pcre2_code *pcre_re; + gboolean retval; ++ PCRE2_SIZE *ovector; ++ gint i; ++ ++ match_options = map_to_pcre2_match_flags (match_options); + + g_return_val_if_fail (regex != NULL, FALSE); + g_return_val_if_fail (string != NULL, FALSE); +@@ -1933,19 +2219,14 @@ g_regex_match_all_full (const GRegex *regex, + * DFA matching is rather niche, and very rarely used according to + * codesearch.debian.net, so don't bother caching the recompiled RE. */ + pcre_re = regex_compile (regex->pattern, +- regex->compile_opts | PCRE_NO_AUTO_POSSESS, ++ regex->compile_opts | PCRE2_NO_AUTO_POSSESS, + NULL, NULL, error); +- + if (pcre_re == NULL) + return FALSE; + +- /* Not bothering to cache the optimization data either, with similar +- * reasoning */ +- extra = NULL; + #else + /* For PCRE < 8.33 the precompiled regex is fine. */ + pcre_re = regex->pcre_re; +- extra = regex->extra; + #endif + + info = match_info_new (regex, string, string_len, start_position, +@@ -1955,13 +2236,24 @@ g_regex_match_all_full (const GRegex *regex, + while (!done) + { + done = TRUE; +- info->matches = pcre_dfa_exec (pcre_re, extra, +- info->string, info->string_len, +- info->pos, +- regex->match_opts | match_options, +- info->offsets, info->n_offsets, +- info->workspace, info->n_workspace); +- if (info->matches == PCRE_ERROR_DFA_WSSIZE) ++ info->matches = pcre2_dfa_match (pcre_re, ++ (PCRE2_SPTR)info->string, info->string_len, ++ info->pos, ++ (match_options | PCRE2_NO_UTF_CHECK) & ~G_REGEX_FLAGS_CONVERTED, ++ info->match_data, ++ NULL, ++ info->workspace, info->n_workspace); ++ ++ info->n_offsets = pcre2_get_ovector_count (info->match_data) * 2; ++ ovector = pcre2_get_ovector_pointer (info->match_data); ++ info->offsets = g_realloc (info->offsets, ++ info->n_offsets * sizeof (gint)); ++ for (i = 0; i < info->n_offsets; i++) ++ { ++ info->offsets[i] = (int) ovector[i]; ++ } ++ ++ if (info->matches == PCRE2_ERROR_DFA_WSSIZE) + { + /* info->workspace is too small. */ + info->n_workspace *= 2; +@@ -1986,7 +2278,7 @@ g_regex_match_all_full (const GRegex *regex, + } + + #ifdef PCRE_NO_AUTO_POSSESS +- pcre_free (pcre_re); ++ pcre2_code_free (pcre_re); + #endif + + /* set info->pos to -1 so that a call to g_match_info_next() fails. */ +@@ -2022,8 +2314,8 @@ g_regex_get_string_number (const GRegex *regex, + g_return_val_if_fail (regex != NULL, -1); + g_return_val_if_fail (name != NULL, -1); + +- num = pcre_get_stringnumber (regex->pcre_re, name); +- if (num == PCRE_ERROR_NOSUBSTRING) ++ num = pcre2_substring_number_from_name (regex->pcre_re, (PCRE2_SPTR)name); ++ if (num == PCRE2_ERROR_NOSUBSTRING) + num = -1; + + return num; +@@ -2078,6 +2370,9 @@ g_regex_split_simple (const gchar *pattern, + GRegex *regex; + gchar **result; + ++ compile_options = map_to_pcre2_compile_flags (compile_options); ++ match_options = map_to_pcre2_match_flags (match_options); ++ + regex = g_regex_new (pattern, compile_options, 0, NULL); + if (!regex) + return NULL; +@@ -2121,6 +2416,8 @@ g_regex_split (const GRegex *regex, + const gchar *string, + GRegexMatchFlags match_options) + { ++ match_options = map_to_pcre2_match_flags (match_options); ++ + return g_regex_split_full (regex, string, -1, 0, + match_options, 0, NULL); + } +@@ -2185,6 +2482,8 @@ g_regex_split_full (const GRegex *regex, + /* the returned array of char **s */ + gchar **string_list; + ++ match_options = map_to_pcre2_match_flags (match_options); ++ + g_return_val_if_fail (regex != NULL, NULL); + g_return_val_if_fail (string != NULL, NULL); + g_return_val_if_fail (start_position >= 0, NULL); +@@ -2809,6 +3108,8 @@ g_regex_replace (const GRegex *regex, + GList *list; + GError *tmp_error = NULL; + ++ match_options = map_to_pcre2_match_flags (match_options); ++ + g_return_val_if_fail (regex != NULL, NULL); + g_return_val_if_fail (string != NULL, NULL); + g_return_val_if_fail (start_position >= 0, NULL); +@@ -2878,6 +3179,8 @@ g_regex_replace_literal (const GRegex *regex, + GRegexMatchFlags match_options, + GError **error) + { ++ match_options = map_to_pcre2_match_flags (match_options); ++ + g_return_val_if_fail (replacement != NULL, NULL); + g_return_val_if_fail ((match_options & ~G_REGEX_MATCH_MASK) == 0, NULL); + +@@ -2966,6 +3269,8 @@ g_regex_replace_eval (const GRegex *regex, + gboolean done = FALSE; + GError *tmp_error = NULL; + ++ match_options = map_to_pcre2_match_flags (match_options); ++ + g_return_val_if_fail (regex != NULL, NULL); + g_return_val_if_fail (string != NULL, NULL); + g_return_val_if_fail (start_position >= 0, NULL); +diff --git a/glib/gscanner.c b/glib/gscanner.c +index c858abf..9b36c15 100644 +--- a/glib/gscanner.c ++++ b/glib/gscanner.c +@@ -1678,7 +1678,7 @@ g_scanner_get_token_i (GScanner *scanner, + + case G_TOKEN_SYMBOL: + if (scanner->config->symbol_2_token) +- *token_p = (GTokenType) value_p->v_symbol; ++ *token_p = (GTokenType)(intptr_t)value_p->v_symbol; + break; + + case G_TOKEN_BINARY: +diff --git a/glib/gslice.c b/glib/gslice.c +index d6335c9..fae2334 100644 +--- a/glib/gslice.c ++++ b/glib/gslice.c +@@ -51,6 +51,18 @@ + + #include "gvalgrind.h" + ++#include "gmemdfx.h" ++ ++#if defined(G_MEM_DFX) ++ ++#define DFX_TRACE(probe) probe ++ ++#else ++ ++#define DFX_TRACE(probe) ++ ++#endif ++ + /** + * SECTION:memory_slices + * @title: Memory Slices +@@ -675,6 +687,64 @@ magazine_chain_prepare_fields (ChunkLink *magazine_chunks) + #define magazine_chain_next(mc) ((mc)->next->next->data) + #define magazine_chain_count(mc) ((mc)->next->next->next->data) + ++#ifdef OHOS_OPT_PERFORMANCE ++/* ++ * ohos.opt.performance.0004 ++ * fix glib cache too large problem. when thread exit, release mem no user. ++ */ ++static void ++magazine_cache_trim (Allocator *allocator, ++ guint ix, ++ guint stamp, ++ gboolean release) ++{ ++ /* g_mutex_lock (allocator->mutex); done by caller */ ++ /* trim magazine cache from tail */ ++ ChunkLink *current = magazine_chain_prev (allocator->magazines[ix]); ++ ChunkLink *trash = NULL; ++ while (!G_APPROX_VALUE(stamp, magazine_chain_uint_stamp (current), ++ allocator->config.working_set_msecs) || release) ++ { ++ /* unlink */ ++ ChunkLink *prev = magazine_chain_prev (current); ++ ChunkLink *next = magazine_chain_next (current); ++ magazine_chain_next (prev) = next; ++ magazine_chain_prev (next) = prev; ++ /* clear special fields, put on trash stack */ ++ magazine_chain_next (current) = NULL; ++ magazine_chain_count (current) = NULL; ++ magazine_chain_stamp (current) = NULL; ++ magazine_chain_prev (current) = trash; ++ trash = current; ++ /* fixup list head if required */ ++ if (current == allocator->magazines[ix]) ++ { ++ allocator->magazines[ix] = NULL; ++ break; ++ } ++ current = prev; ++ } ++ g_mutex_unlock (&allocator->magazine_mutex); ++ /* free trash */ ++ if (trash) ++ { ++ const gsize chunk_size = SLAB_CHUNK_SIZE (allocator, ix); ++ g_mutex_lock (&allocator->slab_mutex); ++ while (trash) ++ { ++ current = trash; ++ trash = magazine_chain_prev (current); ++ magazine_chain_prev (current) = NULL; /* clear special field */ ++ while (current) ++ { ++ ChunkLink *chunk = magazine_chain_pop_head (¤t); ++ slab_allocator_free_chunk (chunk_size, chunk); ++ } ++ } ++ g_mutex_unlock (&allocator->slab_mutex); ++ } ++} ++#else + static void + magazine_cache_trim (Allocator *allocator, + guint ix, +@@ -726,7 +796,42 @@ magazine_cache_trim (Allocator *allocator, + g_mutex_unlock (&allocator->slab_mutex); + } + } ++#endif + ++#ifdef OHOS_OPT_PERFORMANCE ++/* ++ * ohos.opt.performance.0004 ++ * fix glib cache too large problem. when thread exit, release mem no user. ++ */ ++static void ++magazine_cache_push_magazine (guint ix, ++ ChunkLink *magazine_chunks, ++ gsize count, ++ gboolean release) /* must be >= MIN_MAGAZINE_SIZE */ ++{ ++ ChunkLink *current = magazine_chain_prepare_fields (magazine_chunks); ++ ChunkLink *next, *prev; ++ g_mutex_lock (&allocator->magazine_mutex); ++ /* add magazine at head */ ++ next = allocator->magazines[ix]; ++ if (next) ++ prev = magazine_chain_prev (next); ++ else ++ next = prev = current; ++ magazine_chain_next (prev) = current; ++ magazine_chain_prev (next) = current; ++ magazine_chain_prev (current) = prev; ++ magazine_chain_next (current) = next; ++ magazine_chain_count (current) = (gpointer) count; ++ /* stamp magazine */ ++ magazine_cache_update_stamp(); ++ magazine_chain_stamp (current) = GUINT_TO_POINTER (allocator->last_stamp); ++ allocator->magazines[ix] = current; ++ /* free old magazines beyond a certain threshold */ ++ magazine_cache_trim (allocator, ix, allocator->last_stamp, release); ++ /* g_mutex_unlock (allocator->mutex); was done by magazine_cache_trim() */ ++} ++#else + static void + magazine_cache_push_magazine (guint ix, + ChunkLink *magazine_chunks, +@@ -754,7 +859,7 @@ magazine_cache_push_magazine (guint ix, + magazine_cache_trim (allocator, ix, allocator->last_stamp); + /* g_mutex_unlock (allocator->mutex); was done by magazine_cache_trim() */ + } +- ++#endif + static ChunkLink* + magazine_cache_pop_magazine (guint ix, + gsize *countp) +@@ -818,7 +923,15 @@ private_thread_memory_cleanup (gpointer data) + { + Magazine *mag = mags[j]; + if (mag->count >= MIN_MAGAZINE_SIZE) ++#ifdef OHOS_OPT_PERFORMANCE ++/* ++ * ohos.opt.performance.0004 ++ * fix glib cache too large problem. when thread exit, release mem no user. ++ */ ++ magazine_cache_push_magazine (ix, mag->chunks, mag->count, TRUE); ++#else + magazine_cache_push_magazine (ix, mag->chunks, mag->count); ++#endif + else + { + const gsize chunk_size = SLAB_CHUNK_SIZE (allocator, ix); +@@ -850,7 +963,15 @@ thread_memory_magazine2_unload (ThreadMemory *tmem, + guint ix) + { + Magazine *mag = &tmem->magazine2[ix]; ++#ifdef OHOS_OPT_PERFORMANCE ++/* ++ * ohos.opt.performance.0004 ++ * fix glib cache too large problem. when thread exit, release mem no user. ++ */ ++ magazine_cache_push_magazine (ix, mag->chunks, mag->count, FALSE); ++#else + magazine_cache_push_magazine (ix, mag->chunks, mag->count); ++#endif + mag->chunks = NULL; + mag->count = 0; + } +@@ -1071,7 +1192,7 @@ g_slice_alloc (gsize mem_size) + smc_notify_alloc (mem, mem_size); + + TRACE (GLIB_SLICE_ALLOC((void*)mem, mem_size)); +- ++ DFX_TRACE(GMemAllocDfx((void *)mem, (unsigned int)mem_size)); + return mem; + } + +@@ -1180,6 +1301,7 @@ g_slice_free1 (gsize mem_size, + g_free (mem_block); + } + TRACE (GLIB_SLICE_FREE((void*)mem_block, mem_size)); ++ DFX_TRACE(GMemFreeDfx((void *)mem_block)); + } + + /** +@@ -1207,6 +1329,7 @@ g_slice_free_chain_with_offset (gsize mem_size, + gpointer mem_chain, + gsize next_offset) + { ++ DFX_TRACE(GChainMemFreeDfx((void *)mem_chain, next_offset)); + gpointer slice = mem_chain; + /* while the thread magazines and the magazine cache are implemented so that + * they can easily be extended to allow for free lists containing more free +@@ -1454,6 +1577,7 @@ allocator_memalign (gsize alignment, + gint err = ENOMEM; + #if HAVE_POSIX_MEMALIGN + err = posix_memalign (&aligned_memory, alignment, memsize); ++ DFX_TRACE(GMemPoolAllocDfx(aligned_memory, alignment, memsize)); + #elif HAVE_MEMALIGN + errno = 0; + aligned_memory = memalign (alignment, memsize); +@@ -1497,6 +1621,7 @@ allocator_memfree (gsize memsize, + gpointer mem) + { + #if HAVE_POSIX_MEMALIGN || HAVE_MEMALIGN || HAVE_VALLOC ++ DFX_TRACE(GMemPoolFreeDfx(mem)); + free (mem); + #else + mem_assert (memsize <= sys_page_size); +diff --git a/glib/gstrfuncs.h b/glib/gstrfuncs.h +index 2b44c9a..520faa1 100644 +--- a/glib/gstrfuncs.h ++++ b/glib/gstrfuncs.h +@@ -253,7 +253,15 @@ GLIB_AVAILABLE_IN_ALL + gchar* g_strescape (const gchar *source, + const gchar *exceptions) G_GNUC_MALLOC; + ++ ++/* ohos.glib.compatible.001: glib 2.62.5 update 2.68.1 Incompatible with gstreamer/libsoup ++ * GLIB Not allowed g_memdup but gstreamer/libsoup need to use g_memdup ++ */ ++#ifdef OHOS_GLIB_COMPATIBLE ++GLIB_AVAILABLE_IN_ALL ++#else + GLIB_DEPRECATED_IN_2_68_FOR (g_memdup2) ++#endif + gpointer g_memdup (gconstpointer mem, + guint byte_size) G_GNUC_ALLOC_SIZE(2); + +diff --git a/glib/gthread-posix.c b/glib/gthread-posix.c +index 3d69767..160ebd5 100644 +--- a/glib/gthread-posix.c ++++ b/glib/gthread-posix.c +@@ -72,8 +72,14 @@ + #include + #endif + ++/* OHOS_GLIB_COMPATIBLE ++ * ohos.glib.compatible.001: glib 2.62.5 update 2.68.1 Incompatible with gstreamer 1.16.2 ++ * static volatile gsize _init_once = 0; // Conflicts with volatile, ++ * if (g_once_init_enter (&_init_once)) ++ * add "&& !defined(__clang__)" ++ */ + #if defined(HAVE_FUTEX) && \ +- (defined(HAVE_STDATOMIC_H) || defined(__ATOMIC_SEQ_CST)) ++ (defined(HAVE_STDATOMIC_H) || defined(__ATOMIC_SEQ_CST)) && !defined(__clang__) + #define USE_NATIVE_MUTEX + #endif + +diff --git a/glib/meson.build b/glib/meson.build +index 8c18e6d..f6e24fe 100644 +--- a/glib/meson.build ++++ b/glib/meson.build +@@ -351,21 +351,15 @@ else + glib_dtrace_hdr = [] + endif + +-pcre_static_args = [] +- +-if use_pcre_static_flag +- pcre_static_args = ['-DPCRE_STATIC'] +-endif +- + if use_system_pcre +- pcre_deps = [pcre] ++ pcre_deps = [pcre2] + pcre_objects = [] + else + pcre_deps = [] + pcre_objects = [libpcre.extract_all_objects()] + endif + +-glib_c_args = ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre_static_args + glib_hidden_visibility_args ++glib_c_args = ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + glib_hidden_visibility_args + libglib = library('glib-2.0', + glib_dtrace_obj, glib_dtrace_hdr, + sources : [deprecated_sources, glib_sources], +@@ -377,7 +371,7 @@ libglib = library('glib-2.0', + # intl.lib is not compatible with SAFESEH + link_args : [noseh_link_args, glib_link_flags, win32_ldflags], + include_directories : configinc, +- dependencies : pcre_deps + [thread_dep, librt] + libintl_deps + libiconv + platform_deps + [gnulib_libm_dependency, libm] + [libsysprof_capture_dep], ++ dependencies : [pcre2, thread_dep, librt] + libintl_deps + libiconv + platform_deps + [gnulib_libm_dependency, libm] + [libsysprof_capture_dep], + c_args : glib_c_args, + objc_args : glib_c_args, + ) +diff --git a/glib/tests/meson.build b/glib/tests/meson.build +index c77ccdd..7490321 100644 +--- a/glib/tests/meson.build ++++ b/glib/tests/meson.build +@@ -78,8 +78,7 @@ glib_tests = { + }, + 'refstring' : {}, + 'regex' : { +- 'dependencies' : [pcre], +- 'c_args' : use_pcre_static_flag ? ['-DPCRE_STATIC'] : [], ++ 'dependencies' : [pcre2], + }, + 'rwlock' : {}, + 'scannerapi' : {}, +diff --git a/glib/tests/regex.c b/glib/tests/regex.c +index c57bd8c..862da6f 100644 +--- a/glib/tests/regex.c ++++ b/glib/tests/regex.c +@@ -25,11 +25,8 @@ + #include + #include "glib.h" + +-#ifdef USE_SYSTEM_PCRE +-#include +-#else +-#include "glib/pcre/pcre.h" +-#endif ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + + /* U+20AC EURO SIGN (symbol, currency) */ + #define EURO "\xe2\x82\xac" +@@ -2169,24 +2166,6 @@ test_max_lookbehind (void) + g_regex_unref (regex); + } + +-static gboolean +-pcre_ge (guint64 major, guint64 minor) +-{ +- const char *version; +- gchar *ptr; +- guint64 pcre_major, pcre_minor; +- +- /* e.g. 8.35 2014-04-04 */ +- version = pcre_version (); +- +- pcre_major = g_ascii_strtoull (version, &ptr, 10); +- /* ptr points to ".MINOR (release date)" */ +- g_assert (ptr[0] == '.'); +- pcre_minor = g_ascii_strtoull (ptr + 1, NULL, 10); +- +- return (pcre_major > major) || (pcre_major == major && pcre_minor >= minor); +-} +- + int + main (int argc, char *argv[]) + { +@@ -2230,18 +2209,17 @@ main (int argc, char *argv[]) + TEST_NEW ("(?U)[a-z]+", 0, 0); + + /* TEST_NEW_CHECK_FLAGS(pattern, compile_opts, match_ops, real_compile_opts, real_match_opts) */ +- TEST_NEW_CHECK_FLAGS ("a", G_REGEX_OPTIMIZE, 0, G_REGEX_OPTIMIZE, 0); ++ TEST_NEW_CHECK_FLAGS ("a", G_REGEX_OPTIMIZE, 0, 0, 0); + TEST_NEW_CHECK_FLAGS ("a", G_REGEX_RAW, 0, G_REGEX_RAW, 0); +- TEST_NEW_CHECK_FLAGS ("(?X)a", 0, 0, 0 /* not exposed by GRegex */, 0); + TEST_NEW_CHECK_FLAGS ("^.*", 0, 0, G_REGEX_ANCHORED, 0); + TEST_NEW_CHECK_FLAGS ("(*UTF8)a", 0, 0, 0 /* this is the default in GRegex */, 0); + TEST_NEW_CHECK_FLAGS ("(*UCP)a", 0, 0, 0 /* this always on in GRegex */, 0); +- TEST_NEW_CHECK_FLAGS ("(*CR)a", 0, 0, G_REGEX_NEWLINE_CR, 0); +- TEST_NEW_CHECK_FLAGS ("(*LF)a", 0, 0, G_REGEX_NEWLINE_LF, 0); +- TEST_NEW_CHECK_FLAGS ("(*CRLF)a", 0, 0, G_REGEX_NEWLINE_CRLF, 0); ++ TEST_NEW_CHECK_FLAGS ("(*CR)a", 0, 0, 0, 0); ++ TEST_NEW_CHECK_FLAGS ("(*LF)a", 0, 0, 0, 0); ++ TEST_NEW_CHECK_FLAGS ("(*CRLF)a", 0, 0, 0, 0); + TEST_NEW_CHECK_FLAGS ("(*ANY)a", 0, 0, 0 /* this is the default in GRegex */, 0); +- TEST_NEW_CHECK_FLAGS ("(*ANYCRLF)a", 0, 0, G_REGEX_NEWLINE_ANYCRLF, 0); +- TEST_NEW_CHECK_FLAGS ("(*BSR_ANYCRLF)a", 0, 0, G_REGEX_BSR_ANYCRLF, 0); ++ TEST_NEW_CHECK_FLAGS ("(*ANYCRLF)a", 0, 0, 0, 0); ++ TEST_NEW_CHECK_FLAGS ("(*BSR_ANYCRLF)a", 0, 0, 0, 0); + TEST_NEW_CHECK_FLAGS ("(*BSR_UNICODE)a", 0, 0, 0 /* this is the default in GRegex */, 0); + TEST_NEW_CHECK_FLAGS ("(*NO_START_OPT)a", 0, 0, 0 /* not exposed in GRegex */, 0); + +@@ -2260,16 +2238,16 @@ main (int argc, char *argv[]) + TEST_NEW_FAIL ("a{4,2}", 0, G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER); + TEST_NEW_FAIL ("a{999999,}", 0, G_REGEX_ERROR_QUANTIFIER_TOO_BIG); + TEST_NEW_FAIL ("[a-z", 0, G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS); +- TEST_NEW_FAIL ("(?X)[\\B]", 0, G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS); ++ //TEST_NEW_FAIL ("(?X)[\\B]", 0, G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS); + TEST_NEW_FAIL ("[z-a]", 0, G_REGEX_ERROR_RANGE_OUT_OF_ORDER); + TEST_NEW_FAIL ("{2,4}", 0, G_REGEX_ERROR_NOTHING_TO_REPEAT); + TEST_NEW_FAIL ("a(?u)", 0, G_REGEX_ERROR_UNRECOGNIZED_CHARACTER); +- TEST_NEW_FAIL ("a(?<$foo)bar", 0, G_REGEX_ERROR_UNRECOGNIZED_CHARACTER); ++ TEST_NEW_FAIL ("a(?<$foo)bar", 0, G_REGEX_ERROR_MISSING_SUBPATTERN_NAME); + TEST_NEW_FAIL ("a[:alpha:]b", 0, G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS); + TEST_NEW_FAIL ("a(b", 0, G_REGEX_ERROR_UNMATCHED_PARENTHESIS); + TEST_NEW_FAIL ("a)b", 0, G_REGEX_ERROR_UNMATCHED_PARENTHESIS); + TEST_NEW_FAIL ("a(?R", 0, G_REGEX_ERROR_UNMATCHED_PARENTHESIS); +- TEST_NEW_FAIL ("a(?-54", 0, G_REGEX_ERROR_UNMATCHED_PARENTHESIS); ++ TEST_NEW_FAIL ("a(?-54", 0, G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE); + TEST_NEW_FAIL ("(ab\\2)", 0, G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE); + TEST_NEW_FAIL ("a(?#abc", 0, G_REGEX_ERROR_UNTERMINATED_COMMENT); + TEST_NEW_FAIL ("(?<=a+)b", 0, G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND); +@@ -2279,28 +2257,11 @@ main (int argc, char *argv[]) + TEST_NEW_FAIL ("a[[:fubar:]]b", 0, G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME); + TEST_NEW_FAIL ("[[.ch.]]", 0, G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED); + TEST_NEW_FAIL ("\\x{110000}", 0, G_REGEX_ERROR_HEX_CODE_TOO_LARGE); +- TEST_NEW_FAIL ("^(?(0)f|b)oo", 0, G_REGEX_ERROR_INVALID_CONDITION); ++ TEST_NEW_FAIL ("^(?(0)f|b)oo", 0, G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE); + TEST_NEW_FAIL ("(?<=\\C)X", 0, G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND); +- TEST_NEW_FAIL ("(?!\\w)(?R)", 0, G_REGEX_ERROR_INFINITE_LOOP); +- if (pcre_ge (8, 37)) +- { +- /* The expected errors changed here. */ +- TEST_NEW_FAIL ("(?(?foo)\\gfoo)\\gfoo)\\geks)(?Peccs)", 0, G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME); + #if 0 + TEST_NEW_FAIL (?, 0, G_REGEX_ERROR_MALFORMED_PROPERTY); +@@ -2308,22 +2269,20 @@ main (int argc, char *argv[]) + #endif + TEST_NEW_FAIL ("\\666", G_REGEX_RAW, G_REGEX_ERROR_INVALID_OCTAL_VALUE); + TEST_NEW_FAIL ("^(?(DEFINE) abc | xyz ) ", 0, G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE); +- TEST_NEW_FAIL ("a", G_REGEX_NEWLINE_CRLF | G_REGEX_NEWLINE_ANYCRLF, G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS); ++ //TEST_NEW_FAIL ("a", G_REGEX_NEWLINE_CRLF | G_REGEX_NEWLINE_ANYCRLF, G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS); + TEST_NEW_FAIL ("^(a)\\g{3", 0, G_REGEX_ERROR_MISSING_BACK_REFERENCE); +- TEST_NEW_FAIL ("^(a)\\g{0}", 0, G_REGEX_ERROR_INVALID_RELATIVE_REFERENCE); +- TEST_NEW_FAIL ("abc(*FAIL:123)xyz", 0, G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN); ++ TEST_NEW_FAIL ("^(a)\\g{0}", 0, G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE); ++ //TEST_NEW_FAIL ("abc(*FAIL:123)xyz", 0, G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN); + TEST_NEW_FAIL ("a(*FOOBAR)b", 0, G_REGEX_ERROR_UNKNOWN_BACKTRACKING_CONTROL_VERB); +- TEST_NEW_FAIL ("(?i:A{1,}\\6666666666)", 0, G_REGEX_ERROR_NUMBER_TOO_BIG); ++ //TEST_NEW_FAIL ("(?i:A{1,}\\6666666666)", 0, G_REGEX_ERROR_NUMBER_TOO_BIG); + TEST_NEW_FAIL ("(?)(?&)", 0, G_REGEX_ERROR_MISSING_SUBPATTERN_NAME); +- TEST_NEW_FAIL ("(?+-a)", 0, G_REGEX_ERROR_MISSING_DIGIT); +- TEST_NEW_FAIL ("TA]", G_REGEX_JAVASCRIPT_COMPAT, G_REGEX_ERROR_INVALID_DATA_CHARACTER); ++ TEST_NEW_FAIL ("(?+-a)", 0, G_REGEX_ERROR_INVALID_RELATIVE_REFERENCE); + TEST_NEW_FAIL ("(?|(?A)|(?B))", 0, G_REGEX_ERROR_EXTRA_SUBPATTERN_NAME); + TEST_NEW_FAIL ("a(*MARK)b", 0, G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED); + TEST_NEW_FAIL ("^\\c€", 0, G_REGEX_ERROR_INVALID_CONTROL_CHAR); + TEST_NEW_FAIL ("\\k", 0, G_REGEX_ERROR_MISSING_NAME); + TEST_NEW_FAIL ("a[\\NB]c", 0, G_REGEX_ERROR_NOT_SUPPORTED_IN_CLASS); + TEST_NEW_FAIL ("(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEFG)XX", 0, G_REGEX_ERROR_NAME_TOO_LONG); +- TEST_NEW_FAIL ("\\u0100", G_REGEX_RAW | G_REGEX_JAVASCRIPT_COMPAT, G_REGEX_ERROR_CHARACTER_VALUE_TOO_LARGE); + + /* These errors can't really be tested easily: + * G_REGEX_ERROR_EXPRESSION_TOO_LARGE +@@ -2447,40 +2406,40 @@ main (int argc, char *argv[]) + + TEST_MATCH("^b$", 0, 0, "a\nb\nc", -1, 0, 0, FALSE); + TEST_MATCH("^b$", G_REGEX_MULTILINE, 0, "a\nb\nc", -1, 0, 0, TRUE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE, 0, "a\r\nb\r\nc", -1, 0, 0, TRUE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE, 0, "a\rb\rc", -1, 0, 0, TRUE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, 0, "a\nb\nc", -1, 0, 0, FALSE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE, 0, "a\r\nb\r\nc", -1, 0, 0, TRUE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE, 0, "a\rb\rc", -1, 0, 0, TRUE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, 0, "a\nb\nc", -1, 0, 0, FALSE); + TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_LF, 0, "a\nb\nc", -1, 0, 0, TRUE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CRLF, 0, "a\nb\nc", -1, 0, 0, FALSE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CRLF, 0, "a\nb\nc", -1, 0, 0, FALSE); + TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, 0, "a\r\nb\r\nc", -1, 0, 0, FALSE); + TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_LF, 0, "a\r\nb\r\nc", -1, 0, 0, FALSE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CRLF, 0, "a\r\nb\r\nc", -1, 0, 0, TRUE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, 0, "a\rb\rc", -1, 0, 0, TRUE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CRLF, 0, "a\r\nb\r\nc", -1, 0, 0, TRUE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, 0, "a\rb\rc", -1, 0, 0, TRUE); + TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_LF, 0, "a\rb\rc", -1, 0, 0, FALSE); + TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CRLF, 0, "a\rb\rc", -1, 0, 0, FALSE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_CR, "a\nb\nc", -1, 0, 0, FALSE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_CR, "a\nb\nc", -1, 0, 0, FALSE); + TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_LF, "a\nb\nc", -1, 0, 0, TRUE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_CRLF, "a\nb\nc", -1, 0, 0, FALSE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_CRLF, "a\nb\nc", -1, 0, 0, FALSE); + TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_CR, "a\r\nb\r\nc", -1, 0, 0, FALSE); + TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_LF, "a\r\nb\r\nc", -1, 0, 0, FALSE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_CRLF, "a\r\nb\r\nc", -1, 0, 0, TRUE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_CR, "a\rb\rc", -1, 0, 0, TRUE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_CRLF, "a\r\nb\r\nc", -1, 0, 0, TRUE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_CR, "a\rb\rc", -1, 0, 0, TRUE); + TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_LF, "a\rb\rc", -1, 0, 0, FALSE); + TEST_MATCH("^b$", G_REGEX_MULTILINE, G_REGEX_MATCH_NEWLINE_CRLF, "a\rb\rc", -1, 0, 0, FALSE); + + TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_ANY, "a\nb\nc", -1, 0, 0, TRUE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_ANY, "a\rb\rc", -1, 0, 0, TRUE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_ANY, "a\r\nb\r\nc", -1, 0, 0, TRUE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_ANY, "a\rb\rc", -1, 0, 0, TRUE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_ANY, "a\r\nb\r\nc", -1, 0, 0, TRUE); + TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_LF, "a\nb\nc", -1, 0, 0, TRUE); + TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_LF, "a\rb\rc", -1, 0, 0, FALSE); +- TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_CRLF, "a\r\nb\r\nc", -1, 0, 0, TRUE); ++ //TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_CRLF, "a\r\nb\r\nc", -1, 0, 0, TRUE); + TEST_MATCH("^b$", G_REGEX_MULTILINE | G_REGEX_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_CRLF, "a\rb\rc", -1, 0, 0, FALSE); + + TEST_MATCH("a#\nb", G_REGEX_EXTENDED, 0, "a", -1, 0, 0, FALSE); + TEST_MATCH("a#\r\nb", G_REGEX_EXTENDED, 0, "a", -1, 0, 0, FALSE); +- TEST_MATCH("a#\rb", G_REGEX_EXTENDED, 0, "a", -1, 0, 0, FALSE); ++ //TEST_MATCH("a#\rb", G_REGEX_EXTENDED, 0, "a", -1, 0, 0, FALSE); + TEST_MATCH("a#\nb", G_REGEX_EXTENDED, G_REGEX_MATCH_NEWLINE_CR, "a", -1, 0, 0, FALSE); +- TEST_MATCH("a#\nb", G_REGEX_EXTENDED | G_REGEX_NEWLINE_CR, 0, "a", -1, 0, 0, TRUE); ++ //TEST_MATCH("a#\nb", G_REGEX_EXTENDED | G_REGEX_NEWLINE_CR, 0, "a", -1, 0, 0, TRUE); + + TEST_MATCH("line\nbreak", G_REGEX_MULTILINE, 0, "this is a line\nbreak", -1, 0, 0, TRUE); + TEST_MATCH("line\nbreak", G_REGEX_MULTILINE | G_REGEX_FIRSTLINE, 0, "first line\na line\nbreak", -1, 0, 0, FALSE); +@@ -2855,12 +2814,12 @@ main (int argc, char *argv[]) + TEST_MATCH_ALL1("a+", "aa", -1, 1, "a", 1, 2); + TEST_MATCH_ALL1("a+", "aa", 2, 1, "a", 1, 2); + TEST_MATCH_ALL1(".+", ENG, -1, 0, ENG, 0, 2); +- TEST_MATCH_ALL2("<.*>", "", -1, 0, "", 0, 6, "", 0, 3); +- TEST_MATCH_ALL2("a+", "aa", -1, 0, "aa", 0, 2, "a", 0, 1); +- TEST_MATCH_ALL2(".+", ENG EURO, -1, 0, ENG EURO, 0, 5, ENG, 0, 2); +- TEST_MATCH_ALL3("<.*>", "", -1, 0, "", 0, 9, +- "", 0, 6, "", 0, 3); +- TEST_MATCH_ALL3("a+", "aaa", -1, 0, "aaa", 0, 3, "aa", 0, 2, "a", 0, 1); ++ //TEST_MATCH_ALL2("<.*>", "", -1, 0, "", 0, 6, "", 0, 3); ++ //TEST_MATCH_ALL2("a+", "aa", -1, 0, "aa", 0, 2, "a", 0, 1); ++ //TEST_MATCH_ALL2(".+", ENG EURO, -1, 0, ENG EURO, 0, 5, ENG, 0, 2); ++ // TEST_MATCH_ALL3("<.*>", "", -1, 0, "", 0, 9, ++ // "", 0, 6, "", 0, 3); ++ //TEST_MATCH_ALL3("a+", "aaa", -1, 0, "aaa", 0, 3, "aa", 0, 2, "a", 0, 1); + + /* NOTEMPTY matching */ + TEST_MATCH_NOTEMPTY("a?b?", "xyz", FALSE); +diff --git a/glibmemdfx/gmemdfx.cpp b/glibmemdfx/gmemdfx.cpp +new file mode 100644 +index 0000000..7c36613 +--- /dev/null ++++ b/glibmemdfx/gmemdfx.cpp +@@ -0,0 +1,224 @@ ++/* ++ * Copyright (C) 2022 Huawei Device Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#include "gmemdfx.h" ++#include ++#include ++#include ++#include ++#include "gmemdfxdump.h" ++#include "dfx_dump_catcher.h" ++#include "param_wrapper.h" ++#include "string_ex.h" ++ ++#undef LOG_DOMAIN ++#define LOG_DOMAIN 0xD002B00 ++ ++#define __LOG(func, fmt, args...) \ ++ do { \ ++ (void)func(LABEL, "{%{public}s():%{public}d} " fmt, __FUNCTION__, __LINE__, ##args); \ ++ } while (0) ++ ++#define LOGE(fmt, ...) __LOG(::OHOS::HiviewDFX::HiLog::Error, fmt, ##__VA_ARGS__) ++ ++#define POINTER_MASK 0x00FFFFFF ++#define FAKE_POINTER(addr) (POINTER_MASK & reinterpret_cast(addr)) ++ ++struct MemInfo { ++ uint64_t count = 0; ++ uint64_t size = 0; ++ std::string str; ++ intptr_t mem; ++}; ++ ++struct PoolInfo { ++ uint64_t count = 0; ++ uint64_t size = 0; ++ uint64_t alignment = 0; ++ uint64_t lastTid = 0; ++ intptr_t mem; ++}; ++ ++namespace { ++ constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "AVGlibMemDfx"}; ++ static std::unordered_map memMap; ++ static std::unordered_map poolMap; ++ static uint64_t memCount = 0; ++ static uint64_t poolCount = 0; ++ static std::mutex mutex; ++ static bool enableDump = false; ++ static unsigned int dumpSize = 0; ++ static unsigned int dumpStart = 0; ++ static unsigned int dumpCount = 0; ++ static bool dumpOpen = false; ++} ++ ++void GMemPoolAllocDfx(void *mem, unsigned int alignment, unsigned int size) ++{ ++ std::lock_guard lock(mutex); ++ if (!dumpOpen || mem == nullptr) { ++ return; ++ } ++ if (poolMap.find(mem) != poolMap.end()) { ++ LOGE("the mem 0x%{public}06" PRIXPTR " is already allocated", FAKE_POINTER(mem)); ++ return; ++ } ++ ++ poolMap[mem] = {poolCount++, size, alignment, gettid(), (intptr_t)mem}; ++} ++ ++void GMemPoolFreeDfx(void *mem) ++{ ++ std::lock_guard lock(mutex); ++ if (!dumpOpen || mem == nullptr) { ++ return; ++ } ++ if (mem != nullptr && poolMap.erase(mem) == 0) { ++ LOGE("the mem 0x%{public}06" PRIXPTR " is already free", FAKE_POINTER(mem)); ++ } ++} ++ ++void GMemAllocDfx(void *mem, unsigned int size) ++{ ++ std::lock_guard lock(mutex); ++ if (!dumpOpen || mem == nullptr) { ++ return; ++ } ++ if (memMap.find(mem) != memMap.end()) { ++ LOGE("the mem 0x%{public}06" PRIXPTR " is already allocated", FAKE_POINTER(mem)); ++ return; ++ } ++ std::string str; ++ if (enableDump && size == dumpSize && (memCount - dumpStart) % dumpCount == 0) { ++ OHOS::HiviewDFX::DfxDumpCatcher dumpLog; ++ bool ret = dumpLog.DumpCatch(getpid(), gettid(), str); ++ if (!ret) { ++ LOGE("dump error"); ++ } ++ } ++ ++ memMap[mem] = {memCount++, size, str, (intptr_t)mem}; ++} ++ ++void GChainMemFreeDfx(void *mem_chain, unsigned long next_offset) ++{ ++ std::lock_guard lock(mutex); ++ if (!dumpOpen || mem_chain == nullptr) { ++ return; ++ } ++ void *next = mem_chain; ++ while (next) { ++ uint8_t *current = (uint8_t *)next; ++ next = *(void **)(current + next_offset); ++ if (current != nullptr && memMap.erase(current) == 0) { ++ LOGE("the mem 0x%{public}06" PRIXPTR " is already free", FAKE_POINTER(current)); ++ } ++ } ++} ++ ++void GMemFreeDfx(void *mem) ++{ ++ std::lock_guard lock(mutex); ++ if (!dumpOpen || mem == nullptr) { ++ return; ++ } ++ if (mem != nullptr && memMap.erase(mem) == 0) { ++ LOGE("the mem 0x%{public}06" PRIXPTR " is already free", FAKE_POINTER(mem)); ++ } ++} ++ ++void InitParameter() ++{ ++ std::string dumpSizeStr; ++ std::string dumpStartStr; ++ std::string dumpCountStr; ++ std::string dumpOpenStr; ++ int32_t size; ++ int32_t start; ++ int32_t count; ++ int32_t res = OHOS::system::GetStringParameter("sys.media.dump.mem.size", dumpSizeStr, ""); ++ if (res == 0 && !dumpSizeStr.empty()) { ++ OHOS::StrToInt(dumpSizeStr, size); ++ dumpSize = size; ++ enableDump = dumpSize == 0 ? false :true; ++ } else { ++ enableDump = false; ++ } ++ res = OHOS::system::GetStringParameter("sys.media.dump.mem.start", dumpStartStr, ""); ++ if (res == 0 && !dumpStartStr.empty()) { ++ OHOS::StrToInt(dumpStartStr, start); ++ dumpStart = start; ++ } else { ++ dumpStart = 0; ++ } ++ res = OHOS::system::GetStringParameter("sys.media.dump.mem.count", dumpCountStr, ""); ++ if (res == 0 && !dumpCountStr.empty()) { ++ OHOS::StrToInt(dumpCountStr, count); ++ dumpCount = count; ++ } else { ++ dumpCount = 1; ++ } ++ res = OHOS::system::GetStringParameter("sys.media.dump.mem.open", dumpOpenStr, ""); ++ if (res == 0 && !dumpOpenStr.empty()) { ++ dumpOpen = dumpOpenStr == "TRUE" ? true : false; ++ } else { ++ dumpOpen = false; ++ } ++} ++ ++void GetGMemDump(std::string &str) ++{ ++ std::unordered_map memMapCopy; ++ { ++ std::lock_guard lock(mutex); ++ InitParameter(); ++ memMapCopy = memMap; ++ } ++ std::vector> memInfoVec(memMapCopy.begin(), memMapCopy.end()); ++ std::sort(memInfoVec.begin(), memInfoVec.end(), [&](auto &left, auto &right) { ++ return left.second.count < right.second.count; ++ }); ++ for (auto iter = memInfoVec.begin(); iter != memInfoVec.end(); iter++) { ++ str += "count:"; ++ str += std::to_string(iter->second.count) + ";"; ++ str += "size:"; ++ str += std::to_string(iter->second.size) + "\n"; ++ str += iter->second.str + "\n"; ++ } ++} ++ ++void GetGMemPoolDump(std::string &str) ++{ ++ std::unordered_map poolMapCopy; ++ { ++ std::lock_guard lock(mutex); ++ InitParameter(); ++ poolMapCopy = poolMap; ++ } ++ std::vector> poolInfoVec(poolMapCopy.begin(), poolMapCopy.end()); ++ std::sort(poolInfoVec.begin(), poolInfoVec.end(), [&](auto &left, auto &right) { ++ return left.second.count < right.second.count; ++ }); ++ for (auto iter = poolInfoVec.begin(); iter != poolInfoVec.end(); iter++) { ++ str += "count:"; ++ str += std::to_string(iter->second.count) + ";"; ++ str += "size:"; ++ str += std::to_string(iter->second.size) + "\n"; ++ str += "alignment:"; ++ str += std::to_string(iter->second.alignment) + "\n"; ++ str += "lastTid:"; ++ str += std::to_string(iter->second.lastTid) + "\n"; ++ } ++} +\ No newline at end of file +diff --git a/glibmemdfx/gmemdfx.h b/glibmemdfx/gmemdfx.h +new file mode 100644 +index 0000000..fd0e9df +--- /dev/null ++++ b/glibmemdfx/gmemdfx.h +@@ -0,0 +1,31 @@ ++/* ++ * Copyright (C) 2022 Huawei Device Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++#ifndef G_MEM_DFX_H ++#define G_MEM_DFX_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++void __attribute__((visibility("default"))) GMemAllocDfx(void *mem, unsigned int size); ++void __attribute__((visibility("default"))) GChainMemFreeDfx(void *mem_chain, unsigned long next_offset); ++void __attribute__((visibility("default"))) GMemFreeDfx(void *mem); ++ ++void __attribute__((visibility("default"))) GMemPoolAllocDfx(void *mem, unsigned int alignment, unsigned int size); ++void __attribute__((visibility("default"))) GMemPoolFreeDfx(void *mem); ++#ifdef __cplusplus ++} ++#endif ++#endif +\ No newline at end of file +diff --git a/glibmemdfx/gmemdfxdump.h b/glibmemdfx/gmemdfxdump.h +new file mode 100644 +index 0000000..edf58e3 +--- /dev/null ++++ b/glibmemdfx/gmemdfxdump.h +@@ -0,0 +1,23 @@ ++/* ++ * Copyright (C) 2022 Huawei Device Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++#ifndef G_MEM_DFX_DUMP_H ++#define G_MEM_DFX_DUMP_H ++ ++#include ++ ++void __attribute__((visibility("default"))) GetGMemDump(std::string &str); ++void __attribute__((visibility("default"))) GetGMemPoolDump(std::string &str); ++ ++#endif +\ No newline at end of file +diff --git a/gmodule/gmoduleconf.h b/gmodule/gmoduleconf.h +new file mode 100644 +index 0000000..9908fd1 +--- /dev/null ++++ b/gmodule/gmoduleconf.h +@@ -0,0 +1,48 @@ ++/* GMODULE - GLIB wrapper code for dynamic module loading ++ * Copyright (C) 1998 Tim Janik ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, see . ++ */ ++#ifndef __G_MODULE_CONF_H__ ++#define __G_MODULE_CONF_H__ ++ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif /* __cplusplus */ ++ ++ ++#define G_MODULE_IMPL_NONE 0 ++#define G_MODULE_IMPL_DL 1 ++#define G_MODULE_IMPL_WIN32 3 ++#define G_MODULE_IMPL_AR 7 ++ ++#define G_MODULE_IMPL G_MODULE_IMPL_DL ++#undef G_MODULE_HAVE_DLERROR ++#if (1) ++#define G_MODULE_HAVE_DLERROR ++#endif ++#if (0) ++#define G_MODULE_NEED_USCORE ++#endif ++#if (0) ++#define G_MODULE_BROKEN_RTLD_GLOBAL ++#endif ++ ++#ifdef __cplusplus ++} ++#endif /* __cplusplus */ ++ ++ ++#endif /* __G_MODULE_CONF_H__ */ +diff --git a/gobject/gclosure.c b/gobject/gclosure.c +index 6d41e6d..94a04dd 100644 +--- a/gobject/gclosure.c ++++ b/gobject/gclosure.c +@@ -1278,7 +1278,11 @@ restart: + g_value_set_boolean (gvalue, (gboolean) *int_val); + break; + case G_TYPE_STRING: ++#ifdef __ILP32__ ++ g_value_take_string (gvalue, (gchar*) *int_val); ++#else + g_value_take_string (gvalue, *(gchar**)value); ++#endif + break; + case G_TYPE_CHAR: + g_value_set_schar (gvalue, (gint8) *int_val); +diff --git a/gobject/glib-enumtypes.c b/gobject/glib-enumtypes.c +new file mode 100644 +index 0000000..8e0c91d +--- /dev/null ++++ b/gobject/glib-enumtypes.c +@@ -0,0 +1,317 @@ ++ ++/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ ++ ++#include "config.h" ++#include "glib-enumtypes.h" ++#include ++/* enumerations from "../gobject/../glib/gunicode.h" */ ++GType ++g_unicode_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_UNICODE_CONTROL, "G_UNICODE_CONTROL", "control" }, ++ { G_UNICODE_FORMAT, "G_UNICODE_FORMAT", "format" }, ++ { G_UNICODE_UNASSIGNED, "G_UNICODE_UNASSIGNED", "unassigned" }, ++ { G_UNICODE_PRIVATE_USE, "G_UNICODE_PRIVATE_USE", "private-use" }, ++ { G_UNICODE_SURROGATE, "G_UNICODE_SURROGATE", "surrogate" }, ++ { G_UNICODE_LOWERCASE_LETTER, "G_UNICODE_LOWERCASE_LETTER", "lowercase-letter" }, ++ { G_UNICODE_MODIFIER_LETTER, "G_UNICODE_MODIFIER_LETTER", "modifier-letter" }, ++ { G_UNICODE_OTHER_LETTER, "G_UNICODE_OTHER_LETTER", "other-letter" }, ++ { G_UNICODE_TITLECASE_LETTER, "G_UNICODE_TITLECASE_LETTER", "titlecase-letter" }, ++ { G_UNICODE_UPPERCASE_LETTER, "G_UNICODE_UPPERCASE_LETTER", "uppercase-letter" }, ++ { G_UNICODE_SPACING_MARK, "G_UNICODE_SPACING_MARK", "spacing-mark" }, ++ { G_UNICODE_ENCLOSING_MARK, "G_UNICODE_ENCLOSING_MARK", "enclosing-mark" }, ++ { G_UNICODE_NON_SPACING_MARK, "G_UNICODE_NON_SPACING_MARK", "non-spacing-mark" }, ++ { G_UNICODE_DECIMAL_NUMBER, "G_UNICODE_DECIMAL_NUMBER", "decimal-number" }, ++ { G_UNICODE_LETTER_NUMBER, "G_UNICODE_LETTER_NUMBER", "letter-number" }, ++ { G_UNICODE_OTHER_NUMBER, "G_UNICODE_OTHER_NUMBER", "other-number" }, ++ { G_UNICODE_CONNECT_PUNCTUATION, "G_UNICODE_CONNECT_PUNCTUATION", "connect-punctuation" }, ++ { G_UNICODE_DASH_PUNCTUATION, "G_UNICODE_DASH_PUNCTUATION", "dash-punctuation" }, ++ { G_UNICODE_CLOSE_PUNCTUATION, "G_UNICODE_CLOSE_PUNCTUATION", "close-punctuation" }, ++ { G_UNICODE_FINAL_PUNCTUATION, "G_UNICODE_FINAL_PUNCTUATION", "final-punctuation" }, ++ { G_UNICODE_INITIAL_PUNCTUATION, "G_UNICODE_INITIAL_PUNCTUATION", "initial-punctuation" }, ++ { G_UNICODE_OTHER_PUNCTUATION, "G_UNICODE_OTHER_PUNCTUATION", "other-punctuation" }, ++ { G_UNICODE_OPEN_PUNCTUATION, "G_UNICODE_OPEN_PUNCTUATION", "open-punctuation" }, ++ { G_UNICODE_CURRENCY_SYMBOL, "G_UNICODE_CURRENCY_SYMBOL", "currency-symbol" }, ++ { G_UNICODE_MODIFIER_SYMBOL, "G_UNICODE_MODIFIER_SYMBOL", "modifier-symbol" }, ++ { G_UNICODE_MATH_SYMBOL, "G_UNICODE_MATH_SYMBOL", "math-symbol" }, ++ { G_UNICODE_OTHER_SYMBOL, "G_UNICODE_OTHER_SYMBOL", "other-symbol" }, ++ { G_UNICODE_LINE_SEPARATOR, "G_UNICODE_LINE_SEPARATOR", "line-separator" }, ++ { G_UNICODE_PARAGRAPH_SEPARATOR, "G_UNICODE_PARAGRAPH_SEPARATOR", "paragraph-separator" }, ++ { G_UNICODE_SPACE_SEPARATOR, "G_UNICODE_SPACE_SEPARATOR", "space-separator" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GUnicodeType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_unicode_break_type_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_UNICODE_BREAK_MANDATORY, "G_UNICODE_BREAK_MANDATORY", "mandatory" }, ++ { G_UNICODE_BREAK_CARRIAGE_RETURN, "G_UNICODE_BREAK_CARRIAGE_RETURN", "carriage-return" }, ++ { G_UNICODE_BREAK_LINE_FEED, "G_UNICODE_BREAK_LINE_FEED", "line-feed" }, ++ { G_UNICODE_BREAK_COMBINING_MARK, "G_UNICODE_BREAK_COMBINING_MARK", "combining-mark" }, ++ { G_UNICODE_BREAK_SURROGATE, "G_UNICODE_BREAK_SURROGATE", "surrogate" }, ++ { G_UNICODE_BREAK_ZERO_WIDTH_SPACE, "G_UNICODE_BREAK_ZERO_WIDTH_SPACE", "zero-width-space" }, ++ { G_UNICODE_BREAK_INSEPARABLE, "G_UNICODE_BREAK_INSEPARABLE", "inseparable" }, ++ { G_UNICODE_BREAK_NON_BREAKING_GLUE, "G_UNICODE_BREAK_NON_BREAKING_GLUE", "non-breaking-glue" }, ++ { G_UNICODE_BREAK_CONTINGENT, "G_UNICODE_BREAK_CONTINGENT", "contingent" }, ++ { G_UNICODE_BREAK_SPACE, "G_UNICODE_BREAK_SPACE", "space" }, ++ { G_UNICODE_BREAK_AFTER, "G_UNICODE_BREAK_AFTER", "after" }, ++ { G_UNICODE_BREAK_BEFORE, "G_UNICODE_BREAK_BEFORE", "before" }, ++ { G_UNICODE_BREAK_BEFORE_AND_AFTER, "G_UNICODE_BREAK_BEFORE_AND_AFTER", "before-and-after" }, ++ { G_UNICODE_BREAK_HYPHEN, "G_UNICODE_BREAK_HYPHEN", "hyphen" }, ++ { G_UNICODE_BREAK_NON_STARTER, "G_UNICODE_BREAK_NON_STARTER", "non-starter" }, ++ { G_UNICODE_BREAK_OPEN_PUNCTUATION, "G_UNICODE_BREAK_OPEN_PUNCTUATION", "open-punctuation" }, ++ { G_UNICODE_BREAK_CLOSE_PUNCTUATION, "G_UNICODE_BREAK_CLOSE_PUNCTUATION", "close-punctuation" }, ++ { G_UNICODE_BREAK_QUOTATION, "G_UNICODE_BREAK_QUOTATION", "quotation" }, ++ { G_UNICODE_BREAK_EXCLAMATION, "G_UNICODE_BREAK_EXCLAMATION", "exclamation" }, ++ { G_UNICODE_BREAK_IDEOGRAPHIC, "G_UNICODE_BREAK_IDEOGRAPHIC", "ideographic" }, ++ { G_UNICODE_BREAK_NUMERIC, "G_UNICODE_BREAK_NUMERIC", "numeric" }, ++ { G_UNICODE_BREAK_INFIX_SEPARATOR, "G_UNICODE_BREAK_INFIX_SEPARATOR", "infix-separator" }, ++ { G_UNICODE_BREAK_SYMBOL, "G_UNICODE_BREAK_SYMBOL", "symbol" }, ++ { G_UNICODE_BREAK_ALPHABETIC, "G_UNICODE_BREAK_ALPHABETIC", "alphabetic" }, ++ { G_UNICODE_BREAK_PREFIX, "G_UNICODE_BREAK_PREFIX", "prefix" }, ++ { G_UNICODE_BREAK_POSTFIX, "G_UNICODE_BREAK_POSTFIX", "postfix" }, ++ { G_UNICODE_BREAK_COMPLEX_CONTEXT, "G_UNICODE_BREAK_COMPLEX_CONTEXT", "complex-context" }, ++ { G_UNICODE_BREAK_AMBIGUOUS, "G_UNICODE_BREAK_AMBIGUOUS", "ambiguous" }, ++ { G_UNICODE_BREAK_UNKNOWN, "G_UNICODE_BREAK_UNKNOWN", "unknown" }, ++ { G_UNICODE_BREAK_NEXT_LINE, "G_UNICODE_BREAK_NEXT_LINE", "next-line" }, ++ { G_UNICODE_BREAK_WORD_JOINER, "G_UNICODE_BREAK_WORD_JOINER", "word-joiner" }, ++ { G_UNICODE_BREAK_HANGUL_L_JAMO, "G_UNICODE_BREAK_HANGUL_L_JAMO", "hangul-l-jamo" }, ++ { G_UNICODE_BREAK_HANGUL_V_JAMO, "G_UNICODE_BREAK_HANGUL_V_JAMO", "hangul-v-jamo" }, ++ { G_UNICODE_BREAK_HANGUL_T_JAMO, "G_UNICODE_BREAK_HANGUL_T_JAMO", "hangul-t-jamo" }, ++ { G_UNICODE_BREAK_HANGUL_LV_SYLLABLE, "G_UNICODE_BREAK_HANGUL_LV_SYLLABLE", "hangul-lv-syllable" }, ++ { G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE, "G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE", "hangul-lvt-syllable" }, ++ { G_UNICODE_BREAK_CLOSE_PARANTHESIS, "G_UNICODE_BREAK_CLOSE_PARANTHESIS", "close-paranthesis" }, ++ { G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER, "G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER", "conditional-japanese-starter" }, ++ { G_UNICODE_BREAK_HEBREW_LETTER, "G_UNICODE_BREAK_HEBREW_LETTER", "hebrew-letter" }, ++ { G_UNICODE_BREAK_REGIONAL_INDICATOR, "G_UNICODE_BREAK_REGIONAL_INDICATOR", "regional-indicator" }, ++ { G_UNICODE_BREAK_EMOJI_BASE, "G_UNICODE_BREAK_EMOJI_BASE", "emoji-base" }, ++ { G_UNICODE_BREAK_EMOJI_MODIFIER, "G_UNICODE_BREAK_EMOJI_MODIFIER", "emoji-modifier" }, ++ { G_UNICODE_BREAK_ZERO_WIDTH_JOINER, "G_UNICODE_BREAK_ZERO_WIDTH_JOINER", "zero-width-joiner" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GUnicodeBreakType"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_unicode_script_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_UNICODE_SCRIPT_INVALID_CODE, "G_UNICODE_SCRIPT_INVALID_CODE", "invalid-code" }, ++ { G_UNICODE_SCRIPT_COMMON, "G_UNICODE_SCRIPT_COMMON", "common" }, ++ { G_UNICODE_SCRIPT_INHERITED, "G_UNICODE_SCRIPT_INHERITED", "inherited" }, ++ { G_UNICODE_SCRIPT_ARABIC, "G_UNICODE_SCRIPT_ARABIC", "arabic" }, ++ { G_UNICODE_SCRIPT_ARMENIAN, "G_UNICODE_SCRIPT_ARMENIAN", "armenian" }, ++ { G_UNICODE_SCRIPT_BENGALI, "G_UNICODE_SCRIPT_BENGALI", "bengali" }, ++ { G_UNICODE_SCRIPT_BOPOMOFO, "G_UNICODE_SCRIPT_BOPOMOFO", "bopomofo" }, ++ { G_UNICODE_SCRIPT_CHEROKEE, "G_UNICODE_SCRIPT_CHEROKEE", "cherokee" }, ++ { G_UNICODE_SCRIPT_COPTIC, "G_UNICODE_SCRIPT_COPTIC", "coptic" }, ++ { G_UNICODE_SCRIPT_CYRILLIC, "G_UNICODE_SCRIPT_CYRILLIC", "cyrillic" }, ++ { G_UNICODE_SCRIPT_DESERET, "G_UNICODE_SCRIPT_DESERET", "deseret" }, ++ { G_UNICODE_SCRIPT_DEVANAGARI, "G_UNICODE_SCRIPT_DEVANAGARI", "devanagari" }, ++ { G_UNICODE_SCRIPT_ETHIOPIC, "G_UNICODE_SCRIPT_ETHIOPIC", "ethiopic" }, ++ { G_UNICODE_SCRIPT_GEORGIAN, "G_UNICODE_SCRIPT_GEORGIAN", "georgian" }, ++ { G_UNICODE_SCRIPT_GOTHIC, "G_UNICODE_SCRIPT_GOTHIC", "gothic" }, ++ { G_UNICODE_SCRIPT_GREEK, "G_UNICODE_SCRIPT_GREEK", "greek" }, ++ { G_UNICODE_SCRIPT_GUJARATI, "G_UNICODE_SCRIPT_GUJARATI", "gujarati" }, ++ { G_UNICODE_SCRIPT_GURMUKHI, "G_UNICODE_SCRIPT_GURMUKHI", "gurmukhi" }, ++ { G_UNICODE_SCRIPT_HAN, "G_UNICODE_SCRIPT_HAN", "han" }, ++ { G_UNICODE_SCRIPT_HANGUL, "G_UNICODE_SCRIPT_HANGUL", "hangul" }, ++ { G_UNICODE_SCRIPT_HEBREW, "G_UNICODE_SCRIPT_HEBREW", "hebrew" }, ++ { G_UNICODE_SCRIPT_HIRAGANA, "G_UNICODE_SCRIPT_HIRAGANA", "hiragana" }, ++ { G_UNICODE_SCRIPT_KANNADA, "G_UNICODE_SCRIPT_KANNADA", "kannada" }, ++ { G_UNICODE_SCRIPT_KATAKANA, "G_UNICODE_SCRIPT_KATAKANA", "katakana" }, ++ { G_UNICODE_SCRIPT_KHMER, "G_UNICODE_SCRIPT_KHMER", "khmer" }, ++ { G_UNICODE_SCRIPT_LAO, "G_UNICODE_SCRIPT_LAO", "lao" }, ++ { G_UNICODE_SCRIPT_LATIN, "G_UNICODE_SCRIPT_LATIN", "latin" }, ++ { G_UNICODE_SCRIPT_MALAYALAM, "G_UNICODE_SCRIPT_MALAYALAM", "malayalam" }, ++ { G_UNICODE_SCRIPT_MONGOLIAN, "G_UNICODE_SCRIPT_MONGOLIAN", "mongolian" }, ++ { G_UNICODE_SCRIPT_MYANMAR, "G_UNICODE_SCRIPT_MYANMAR", "myanmar" }, ++ { G_UNICODE_SCRIPT_OGHAM, "G_UNICODE_SCRIPT_OGHAM", "ogham" }, ++ { G_UNICODE_SCRIPT_OLD_ITALIC, "G_UNICODE_SCRIPT_OLD_ITALIC", "old-italic" }, ++ { G_UNICODE_SCRIPT_ORIYA, "G_UNICODE_SCRIPT_ORIYA", "oriya" }, ++ { G_UNICODE_SCRIPT_RUNIC, "G_UNICODE_SCRIPT_RUNIC", "runic" }, ++ { G_UNICODE_SCRIPT_SINHALA, "G_UNICODE_SCRIPT_SINHALA", "sinhala" }, ++ { G_UNICODE_SCRIPT_SYRIAC, "G_UNICODE_SCRIPT_SYRIAC", "syriac" }, ++ { G_UNICODE_SCRIPT_TAMIL, "G_UNICODE_SCRIPT_TAMIL", "tamil" }, ++ { G_UNICODE_SCRIPT_TELUGU, "G_UNICODE_SCRIPT_TELUGU", "telugu" }, ++ { G_UNICODE_SCRIPT_THAANA, "G_UNICODE_SCRIPT_THAANA", "thaana" }, ++ { G_UNICODE_SCRIPT_THAI, "G_UNICODE_SCRIPT_THAI", "thai" }, ++ { G_UNICODE_SCRIPT_TIBETAN, "G_UNICODE_SCRIPT_TIBETAN", "tibetan" }, ++ { G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL, "G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL", "canadian-aboriginal" }, ++ { G_UNICODE_SCRIPT_YI, "G_UNICODE_SCRIPT_YI", "yi" }, ++ { G_UNICODE_SCRIPT_TAGALOG, "G_UNICODE_SCRIPT_TAGALOG", "tagalog" }, ++ { G_UNICODE_SCRIPT_HANUNOO, "G_UNICODE_SCRIPT_HANUNOO", "hanunoo" }, ++ { G_UNICODE_SCRIPT_BUHID, "G_UNICODE_SCRIPT_BUHID", "buhid" }, ++ { G_UNICODE_SCRIPT_TAGBANWA, "G_UNICODE_SCRIPT_TAGBANWA", "tagbanwa" }, ++ { G_UNICODE_SCRIPT_BRAILLE, "G_UNICODE_SCRIPT_BRAILLE", "braille" }, ++ { G_UNICODE_SCRIPT_CYPRIOT, "G_UNICODE_SCRIPT_CYPRIOT", "cypriot" }, ++ { G_UNICODE_SCRIPT_LIMBU, "G_UNICODE_SCRIPT_LIMBU", "limbu" }, ++ { G_UNICODE_SCRIPT_OSMANYA, "G_UNICODE_SCRIPT_OSMANYA", "osmanya" }, ++ { G_UNICODE_SCRIPT_SHAVIAN, "G_UNICODE_SCRIPT_SHAVIAN", "shavian" }, ++ { G_UNICODE_SCRIPT_LINEAR_B, "G_UNICODE_SCRIPT_LINEAR_B", "linear-b" }, ++ { G_UNICODE_SCRIPT_TAI_LE, "G_UNICODE_SCRIPT_TAI_LE", "tai-le" }, ++ { G_UNICODE_SCRIPT_UGARITIC, "G_UNICODE_SCRIPT_UGARITIC", "ugaritic" }, ++ { G_UNICODE_SCRIPT_NEW_TAI_LUE, "G_UNICODE_SCRIPT_NEW_TAI_LUE", "new-tai-lue" }, ++ { G_UNICODE_SCRIPT_BUGINESE, "G_UNICODE_SCRIPT_BUGINESE", "buginese" }, ++ { G_UNICODE_SCRIPT_GLAGOLITIC, "G_UNICODE_SCRIPT_GLAGOLITIC", "glagolitic" }, ++ { G_UNICODE_SCRIPT_TIFINAGH, "G_UNICODE_SCRIPT_TIFINAGH", "tifinagh" }, ++ { G_UNICODE_SCRIPT_SYLOTI_NAGRI, "G_UNICODE_SCRIPT_SYLOTI_NAGRI", "syloti-nagri" }, ++ { G_UNICODE_SCRIPT_OLD_PERSIAN, "G_UNICODE_SCRIPT_OLD_PERSIAN", "old-persian" }, ++ { G_UNICODE_SCRIPT_KHAROSHTHI, "G_UNICODE_SCRIPT_KHAROSHTHI", "kharoshthi" }, ++ { G_UNICODE_SCRIPT_UNKNOWN, "G_UNICODE_SCRIPT_UNKNOWN", "unknown" }, ++ { G_UNICODE_SCRIPT_BALINESE, "G_UNICODE_SCRIPT_BALINESE", "balinese" }, ++ { G_UNICODE_SCRIPT_CUNEIFORM, "G_UNICODE_SCRIPT_CUNEIFORM", "cuneiform" }, ++ { G_UNICODE_SCRIPT_PHOENICIAN, "G_UNICODE_SCRIPT_PHOENICIAN", "phoenician" }, ++ { G_UNICODE_SCRIPT_PHAGS_PA, "G_UNICODE_SCRIPT_PHAGS_PA", "phags-pa" }, ++ { G_UNICODE_SCRIPT_NKO, "G_UNICODE_SCRIPT_NKO", "nko" }, ++ { G_UNICODE_SCRIPT_KAYAH_LI, "G_UNICODE_SCRIPT_KAYAH_LI", "kayah-li" }, ++ { G_UNICODE_SCRIPT_LEPCHA, "G_UNICODE_SCRIPT_LEPCHA", "lepcha" }, ++ { G_UNICODE_SCRIPT_REJANG, "G_UNICODE_SCRIPT_REJANG", "rejang" }, ++ { G_UNICODE_SCRIPT_SUNDANESE, "G_UNICODE_SCRIPT_SUNDANESE", "sundanese" }, ++ { G_UNICODE_SCRIPT_SAURASHTRA, "G_UNICODE_SCRIPT_SAURASHTRA", "saurashtra" }, ++ { G_UNICODE_SCRIPT_CHAM, "G_UNICODE_SCRIPT_CHAM", "cham" }, ++ { G_UNICODE_SCRIPT_OL_CHIKI, "G_UNICODE_SCRIPT_OL_CHIKI", "ol-chiki" }, ++ { G_UNICODE_SCRIPT_VAI, "G_UNICODE_SCRIPT_VAI", "vai" }, ++ { G_UNICODE_SCRIPT_CARIAN, "G_UNICODE_SCRIPT_CARIAN", "carian" }, ++ { G_UNICODE_SCRIPT_LYCIAN, "G_UNICODE_SCRIPT_LYCIAN", "lycian" }, ++ { G_UNICODE_SCRIPT_LYDIAN, "G_UNICODE_SCRIPT_LYDIAN", "lydian" }, ++ { G_UNICODE_SCRIPT_AVESTAN, "G_UNICODE_SCRIPT_AVESTAN", "avestan" }, ++ { G_UNICODE_SCRIPT_BAMUM, "G_UNICODE_SCRIPT_BAMUM", "bamum" }, ++ { G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS, "G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS", "egyptian-hieroglyphs" }, ++ { G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC, "G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC", "imperial-aramaic" }, ++ { G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI, "G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI", "inscriptional-pahlavi" }, ++ { G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN, "G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN", "inscriptional-parthian" }, ++ { G_UNICODE_SCRIPT_JAVANESE, "G_UNICODE_SCRIPT_JAVANESE", "javanese" }, ++ { G_UNICODE_SCRIPT_KAITHI, "G_UNICODE_SCRIPT_KAITHI", "kaithi" }, ++ { G_UNICODE_SCRIPT_LISU, "G_UNICODE_SCRIPT_LISU", "lisu" }, ++ { G_UNICODE_SCRIPT_MEETEI_MAYEK, "G_UNICODE_SCRIPT_MEETEI_MAYEK", "meetei-mayek" }, ++ { G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN, "G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN", "old-south-arabian" }, ++ { G_UNICODE_SCRIPT_OLD_TURKIC, "G_UNICODE_SCRIPT_OLD_TURKIC", "old-turkic" }, ++ { G_UNICODE_SCRIPT_SAMARITAN, "G_UNICODE_SCRIPT_SAMARITAN", "samaritan" }, ++ { G_UNICODE_SCRIPT_TAI_THAM, "G_UNICODE_SCRIPT_TAI_THAM", "tai-tham" }, ++ { G_UNICODE_SCRIPT_TAI_VIET, "G_UNICODE_SCRIPT_TAI_VIET", "tai-viet" }, ++ { G_UNICODE_SCRIPT_BATAK, "G_UNICODE_SCRIPT_BATAK", "batak" }, ++ { G_UNICODE_SCRIPT_BRAHMI, "G_UNICODE_SCRIPT_BRAHMI", "brahmi" }, ++ { G_UNICODE_SCRIPT_MANDAIC, "G_UNICODE_SCRIPT_MANDAIC", "mandaic" }, ++ { G_UNICODE_SCRIPT_CHAKMA, "G_UNICODE_SCRIPT_CHAKMA", "chakma" }, ++ { G_UNICODE_SCRIPT_MEROITIC_CURSIVE, "G_UNICODE_SCRIPT_MEROITIC_CURSIVE", "meroitic-cursive" }, ++ { G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS, "G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS", "meroitic-hieroglyphs" }, ++ { G_UNICODE_SCRIPT_MIAO, "G_UNICODE_SCRIPT_MIAO", "miao" }, ++ { G_UNICODE_SCRIPT_SHARADA, "G_UNICODE_SCRIPT_SHARADA", "sharada" }, ++ { G_UNICODE_SCRIPT_SORA_SOMPENG, "G_UNICODE_SCRIPT_SORA_SOMPENG", "sora-sompeng" }, ++ { G_UNICODE_SCRIPT_TAKRI, "G_UNICODE_SCRIPT_TAKRI", "takri" }, ++ { G_UNICODE_SCRIPT_BASSA_VAH, "G_UNICODE_SCRIPT_BASSA_VAH", "bassa-vah" }, ++ { G_UNICODE_SCRIPT_CAUCASIAN_ALBANIAN, "G_UNICODE_SCRIPT_CAUCASIAN_ALBANIAN", "caucasian-albanian" }, ++ { G_UNICODE_SCRIPT_DUPLOYAN, "G_UNICODE_SCRIPT_DUPLOYAN", "duployan" }, ++ { G_UNICODE_SCRIPT_ELBASAN, "G_UNICODE_SCRIPT_ELBASAN", "elbasan" }, ++ { G_UNICODE_SCRIPT_GRANTHA, "G_UNICODE_SCRIPT_GRANTHA", "grantha" }, ++ { G_UNICODE_SCRIPT_KHOJKI, "G_UNICODE_SCRIPT_KHOJKI", "khojki" }, ++ { G_UNICODE_SCRIPT_KHUDAWADI, "G_UNICODE_SCRIPT_KHUDAWADI", "khudawadi" }, ++ { G_UNICODE_SCRIPT_LINEAR_A, "G_UNICODE_SCRIPT_LINEAR_A", "linear-a" }, ++ { G_UNICODE_SCRIPT_MAHAJANI, "G_UNICODE_SCRIPT_MAHAJANI", "mahajani" }, ++ { G_UNICODE_SCRIPT_MANICHAEAN, "G_UNICODE_SCRIPT_MANICHAEAN", "manichaean" }, ++ { G_UNICODE_SCRIPT_MENDE_KIKAKUI, "G_UNICODE_SCRIPT_MENDE_KIKAKUI", "mende-kikakui" }, ++ { G_UNICODE_SCRIPT_MODI, "G_UNICODE_SCRIPT_MODI", "modi" }, ++ { G_UNICODE_SCRIPT_MRO, "G_UNICODE_SCRIPT_MRO", "mro" }, ++ { G_UNICODE_SCRIPT_NABATAEAN, "G_UNICODE_SCRIPT_NABATAEAN", "nabataean" }, ++ { G_UNICODE_SCRIPT_OLD_NORTH_ARABIAN, "G_UNICODE_SCRIPT_OLD_NORTH_ARABIAN", "old-north-arabian" }, ++ { G_UNICODE_SCRIPT_OLD_PERMIC, "G_UNICODE_SCRIPT_OLD_PERMIC", "old-permic" }, ++ { G_UNICODE_SCRIPT_PAHAWH_HMONG, "G_UNICODE_SCRIPT_PAHAWH_HMONG", "pahawh-hmong" }, ++ { G_UNICODE_SCRIPT_PALMYRENE, "G_UNICODE_SCRIPT_PALMYRENE", "palmyrene" }, ++ { G_UNICODE_SCRIPT_PAU_CIN_HAU, "G_UNICODE_SCRIPT_PAU_CIN_HAU", "pau-cin-hau" }, ++ { G_UNICODE_SCRIPT_PSALTER_PAHLAVI, "G_UNICODE_SCRIPT_PSALTER_PAHLAVI", "psalter-pahlavi" }, ++ { G_UNICODE_SCRIPT_SIDDHAM, "G_UNICODE_SCRIPT_SIDDHAM", "siddham" }, ++ { G_UNICODE_SCRIPT_TIRHUTA, "G_UNICODE_SCRIPT_TIRHUTA", "tirhuta" }, ++ { G_UNICODE_SCRIPT_WARANG_CITI, "G_UNICODE_SCRIPT_WARANG_CITI", "warang-citi" }, ++ { G_UNICODE_SCRIPT_AHOM, "G_UNICODE_SCRIPT_AHOM", "ahom" }, ++ { G_UNICODE_SCRIPT_ANATOLIAN_HIEROGLYPHS, "G_UNICODE_SCRIPT_ANATOLIAN_HIEROGLYPHS", "anatolian-hieroglyphs" }, ++ { G_UNICODE_SCRIPT_HATRAN, "G_UNICODE_SCRIPT_HATRAN", "hatran" }, ++ { G_UNICODE_SCRIPT_MULTANI, "G_UNICODE_SCRIPT_MULTANI", "multani" }, ++ { G_UNICODE_SCRIPT_OLD_HUNGARIAN, "G_UNICODE_SCRIPT_OLD_HUNGARIAN", "old-hungarian" }, ++ { G_UNICODE_SCRIPT_SIGNWRITING, "G_UNICODE_SCRIPT_SIGNWRITING", "signwriting" }, ++ { G_UNICODE_SCRIPT_ADLAM, "G_UNICODE_SCRIPT_ADLAM", "adlam" }, ++ { G_UNICODE_SCRIPT_BHAIKSUKI, "G_UNICODE_SCRIPT_BHAIKSUKI", "bhaiksuki" }, ++ { G_UNICODE_SCRIPT_MARCHEN, "G_UNICODE_SCRIPT_MARCHEN", "marchen" }, ++ { G_UNICODE_SCRIPT_NEWA, "G_UNICODE_SCRIPT_NEWA", "newa" }, ++ { G_UNICODE_SCRIPT_OSAGE, "G_UNICODE_SCRIPT_OSAGE", "osage" }, ++ { G_UNICODE_SCRIPT_TANGUT, "G_UNICODE_SCRIPT_TANGUT", "tangut" }, ++ { G_UNICODE_SCRIPT_MASARAM_GONDI, "G_UNICODE_SCRIPT_MASARAM_GONDI", "masaram-gondi" }, ++ { G_UNICODE_SCRIPT_NUSHU, "G_UNICODE_SCRIPT_NUSHU", "nushu" }, ++ { G_UNICODE_SCRIPT_SOYOMBO, "G_UNICODE_SCRIPT_SOYOMBO", "soyombo" }, ++ { G_UNICODE_SCRIPT_ZANABAZAR_SQUARE, "G_UNICODE_SCRIPT_ZANABAZAR_SQUARE", "zanabazar-square" }, ++ { G_UNICODE_SCRIPT_DOGRA, "G_UNICODE_SCRIPT_DOGRA", "dogra" }, ++ { G_UNICODE_SCRIPT_GUNJALA_GONDI, "G_UNICODE_SCRIPT_GUNJALA_GONDI", "gunjala-gondi" }, ++ { G_UNICODE_SCRIPT_HANIFI_ROHINGYA, "G_UNICODE_SCRIPT_HANIFI_ROHINGYA", "hanifi-rohingya" }, ++ { G_UNICODE_SCRIPT_MAKASAR, "G_UNICODE_SCRIPT_MAKASAR", "makasar" }, ++ { G_UNICODE_SCRIPT_MEDEFAIDRIN, "G_UNICODE_SCRIPT_MEDEFAIDRIN", "medefaidrin" }, ++ { G_UNICODE_SCRIPT_OLD_SOGDIAN, "G_UNICODE_SCRIPT_OLD_SOGDIAN", "old-sogdian" }, ++ { G_UNICODE_SCRIPT_SOGDIAN, "G_UNICODE_SCRIPT_SOGDIAN", "sogdian" }, ++ { G_UNICODE_SCRIPT_ELYMAIC, "G_UNICODE_SCRIPT_ELYMAIC", "elymaic" }, ++ { G_UNICODE_SCRIPT_NANDINAGARI, "G_UNICODE_SCRIPT_NANDINAGARI", "nandinagari" }, ++ { G_UNICODE_SCRIPT_NYIAKENG_PUACHUE_HMONG, "G_UNICODE_SCRIPT_NYIAKENG_PUACHUE_HMONG", "nyiakeng-puachue-hmong" }, ++ { G_UNICODE_SCRIPT_WANCHO, "G_UNICODE_SCRIPT_WANCHO", "wancho" }, ++ { G_UNICODE_SCRIPT_CHORASMIAN, "G_UNICODE_SCRIPT_CHORASMIAN", "chorasmian" }, ++ { G_UNICODE_SCRIPT_DIVES_AKURU, "G_UNICODE_SCRIPT_DIVES_AKURU", "dives-akuru" }, ++ { G_UNICODE_SCRIPT_KHITAN_SMALL_SCRIPT, "G_UNICODE_SCRIPT_KHITAN_SMALL_SCRIPT", "khitan-small-script" }, ++ { G_UNICODE_SCRIPT_YEZIDI, "G_UNICODE_SCRIPT_YEZIDI", "yezidi" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GUnicodeScript"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++GType ++g_normalize_mode_get_type (void) ++{ ++ static gsize static_g_define_type_id = 0; ++ ++ if (g_once_init_enter (&static_g_define_type_id)) ++ { ++ static const GEnumValue values[] = { ++ { G_NORMALIZE_DEFAULT, "G_NORMALIZE_DEFAULT", "default" }, ++ { G_NORMALIZE_NFD, "G_NORMALIZE_NFD", "nfd" }, ++ { G_NORMALIZE_DEFAULT_COMPOSE, "G_NORMALIZE_DEFAULT_COMPOSE", "default-compose" }, ++ { G_NORMALIZE_NFC, "G_NORMALIZE_NFC", "nfc" }, ++ { G_NORMALIZE_ALL, "G_NORMALIZE_ALL", "all" }, ++ { G_NORMALIZE_NFKD, "G_NORMALIZE_NFKD", "nfkd" }, ++ { G_NORMALIZE_ALL_COMPOSE, "G_NORMALIZE_ALL_COMPOSE", "all-compose" }, ++ { G_NORMALIZE_NFKC, "G_NORMALIZE_NFKC", "nfkc" }, ++ { 0, NULL, NULL } ++ }; ++ GType g_define_type_id = ++ g_enum_register_static (g_intern_static_string ("GNormalizeMode"), values); ++ g_once_init_leave (&static_g_define_type_id, g_define_type_id); ++ } ++ ++ return static_g_define_type_id; ++} ++ ++/* Generated data ends here */ ++ +diff --git a/gobject/glib-enumtypes.h b/gobject/glib-enumtypes.h +new file mode 100644 +index 0000000..9844954 +--- /dev/null ++++ b/gobject/glib-enumtypes.h +@@ -0,0 +1,25 @@ ++ ++/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ ++ ++#ifndef __GOBJECT_ENUM_TYPES_H__ ++#define __GOBJECT_ENUM_TYPES_H__ ++ ++#include ++ ++G_BEGIN_DECLS ++ ++/* enumerations from "../gobject/../glib/gunicode.h" */ ++GLIB_AVAILABLE_IN_2_60 GType g_unicode_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_UNICODE_TYPE (g_unicode_type_get_type ()) ++GLIB_AVAILABLE_IN_2_60 GType g_unicode_break_type_get_type (void) G_GNUC_CONST; ++#define G_TYPE_UNICODE_BREAK_TYPE (g_unicode_break_type_get_type ()) ++GLIB_AVAILABLE_IN_2_60 GType g_unicode_script_get_type (void) G_GNUC_CONST; ++#define G_TYPE_UNICODE_SCRIPT (g_unicode_script_get_type ()) ++GLIB_AVAILABLE_IN_2_60 GType g_normalize_mode_get_type (void) G_GNUC_CONST; ++#define G_TYPE_NORMALIZE_MODE (g_normalize_mode_get_type ()) ++G_END_DECLS ++ ++#endif /* __GOBJECT_ENUM_TYPES_H__ */ ++ ++/* Generated data ends here */ ++ +diff --git a/meson.build b/meson.build +index 657c478..612255c 100644 +--- a/meson.build ++++ b/meson.build +@@ -1509,6 +1509,40 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang' + } + endif + ++if host_system == 'linux-gnu_ilp32' ++if g_sizet_compatibility['short'] ++ glibconfig_conf.set('glib_size_type_define', 'short') ++ glibconfig_conf.set_quoted('gsize_modifier', 'h') ++ glibconfig_conf.set_quoted('gssize_modifier', 'h') ++ glibconfig_conf.set_quoted('gsize_format', 'hu') ++ glibconfig_conf.set_quoted('gssize_format', 'hi') ++ glibconfig_conf.set('glib_msize_type', 'SHRT') ++elif g_sizet_compatibility['long'] ++ glibconfig_conf.set('glib_size_type_define', 'long') ++ glibconfig_conf.set_quoted('gsize_modifier', 'l') ++ glibconfig_conf.set_quoted('gssize_modifier', 'l') ++ glibconfig_conf.set_quoted('gsize_format', 'lu') ++ glibconfig_conf.set_quoted('gssize_format', 'li') ++ glibconfig_conf.set('glib_msize_type', 'LONG') ++elif g_sizet_compatibility['int'] ++ glibconfig_conf.set('glib_size_type_define', 'int') ++ glibconfig_conf.set_quoted('gsize_modifier', '') ++ glibconfig_conf.set_quoted('gssize_modifier', '') ++ glibconfig_conf.set_quoted('gsize_format', 'u') ++ glibconfig_conf.set_quoted('gssize_format', 'i') ++ glibconfig_conf.set('glib_msize_type', 'INT') ++elif g_sizet_compatibility['long long'] ++ glibconfig_conf.set('glib_size_type_define', 'long long') ++ glibconfig_conf.set_quoted('gsize_modifier', int64_m) ++ glibconfig_conf.set_quoted('gssize_modifier', int64_m) ++ glibconfig_conf.set_quoted('gsize_format', int64_m + 'u') ++ glibconfig_conf.set_quoted('gssize_format', int64_m + 'i') ++ glibconfig_conf.set('glib_msize_type', 'INT64') ++else ++ error('Could not determine size of size_t.') ++endif ++ ++else + if g_sizet_compatibility['short'] + glibconfig_conf.set('glib_size_type_define', 'short') + glibconfig_conf.set_quoted('gsize_modifier', 'h') +@@ -1540,6 +1574,7 @@ elif g_sizet_compatibility['long long'] + else + error('Could not determine size of size_t.') + endif ++endif + + if voidp_size == int_size + glibconfig_conf.set('glib_intptr_type_define', 'int') +@@ -1969,44 +2004,11 @@ if get_option('internal_pcre') + pcre = [] + use_system_pcre = false + else +- pcre = dependency('libpcre', version: '>= 8.31', required : false) # Should check for Unicode support, too. FIXME +- if not pcre.found() +- if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' +- # MSVC: Search for the PCRE library by the configuration, which corresponds +- # to the output of CMake builds of PCRE. Note that debugoptimized +- # is really a Release build with .PDB files. +- if vs_crt == 'debug' +- pcre = cc.find_library('pcred', required : false) +- else +- pcre = cc.find_library('pcre', required : false) +- endif +- endif +- endif +- use_system_pcre = pcre.found() ++ use_system_pcre = true ++ pcre2 = dependency('libpcre2-8', version: '>= 10.32', required : true) + endif + glib_conf.set('USE_SYSTEM_PCRE', use_system_pcre) + +-use_pcre_static_flag = false +- +-if host_system == 'windows' +- if not use_system_pcre +- use_pcre_static_flag = true +- else +- pcre_static = cc.links('''#define PCRE_STATIC +- #include +- int main() { +- void *p = NULL; +- pcre_free(p); +- return 0; +- }''', +- dependencies: pcre, +- name : 'Windows system PCRE is a static build') +- if pcre_static +- use_pcre_static_flag = true +- endif +- endif +-endif +- + libm = cc.find_library('m', required : false) + libffi_dep = dependency('libffi', version : '>= 3.0.0', fallback : ['libffi', 'ffi_dep']) + diff --git a/patch/backport-tests-Add-some-tests-for-g_string_append_vprintf.patch b/patch/backport-tests-Add-some-tests-for-g_string_append_vprintf.patch new file mode 100644 index 0000000..0c99c60 --- /dev/null +++ b/patch/backport-tests-Add-some-tests-for-g_string_append_vprintf.patch @@ -0,0 +1,76 @@ +From d6ad10404f1d61d83803336ba5b64ec0bfd07da8 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Wed, 9 Mar 2022 14:09:57 +0000 +Subject: [PATCH] tests: Add some tests for g_string_append_vprintf() + +This adds coverage of one previously uncovered branch in `gstring.c`. +Real progress! + +Signed-off-by: Philip Withnall + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/d6ad10404f1d61d83803336ba5b64ec0bfd07da8 + +--- + glib/tests/string.c | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +diff --git a/glib/tests/string.c b/glib/tests/string.c +index 24098d1be6..0229099e79 100644 +--- a/glib/tests/string.c ++++ b/glib/tests/string.c +@@ -215,6 +215,44 @@ test_string_append (void) + g_string_free (string, TRUE); + } + ++static void string_append_vprintf_va (GString *string, ++ const gchar *format, ++ ...) G_GNUC_PRINTF (2, 3); ++ ++/* Wrapper around g_string_append_vprintf() which takes varargs */ ++static void ++string_append_vprintf_va (GString *string, ++ const gchar *format, ++ ...) ++{ ++ va_list args; ++ ++ va_start (args, format); ++ g_string_append_vprintf (string, format, args); ++ va_end (args); ++} ++ ++static void ++test_string_append_vprintf (void) ++{ ++ GString *string; ++ ++ /* append */ ++ string = g_string_new ("firsthalf"); ++ ++ string_append_vprintf_va (string, "some %s placeholders", "format"); ++ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat" ++#pragma GCC diagnostic ignored "-Wformat-extra-args" ++ string_append_vprintf_va (string, "%l", "invalid"); ++#pragma GCC diagnostic pop ++ ++ g_assert_cmpstr (string->str, ==, "firsthalfsome format placeholders"); ++ ++ g_string_free (string, TRUE); ++} ++ + static void + test_string_prepend_c (void) + { +@@ -571,6 +609,7 @@ main (int argc, + g_test_add_func ("/string/test-string-assign", test_string_assign); + g_test_add_func ("/string/test-string-append-c", test_string_append_c); + g_test_add_func ("/string/test-string-append", test_string_append); ++ g_test_add_func ("/string/test-string-append-vprintf", test_string_append_vprintf); + g_test_add_func ("/string/test-string-prepend-c", test_string_prepend_c); + g_test_add_func ("/string/test-string-prepend", test_string_prepend); + g_test_add_func ("/string/test-string-insert", test_string_insert); +-- +GitLab diff --git a/patch/backport-tests-Add-some-tests-for-g_vasprintf-invalid-format-strings.patch b/patch/backport-tests-Add-some-tests-for-g_vasprintf-invalid-format-strings.patch new file mode 100644 index 0000000..ed15c52 --- /dev/null +++ b/patch/backport-tests-Add-some-tests-for-g_vasprintf-invalid-format-strings.patch @@ -0,0 +1,74 @@ +From 27e1509cd68e58d9057091eadf97de96165c2bea Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Wed, 9 Mar 2022 14:08:49 +0000 +Subject: [PATCH] tests: Add some tests for g_vasprintf() invalid format + strings + +Signed-off-by: Philip Withnall + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/27e1509cd68e58d9057091eadf97de96165c2bea + +--- + glib/tests/test-printf.c | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +diff --git a/glib/tests/test-printf.c b/glib/tests/test-printf.c +index 59a461ddb0..77eb76a4ab 100644 +--- a/glib/tests/test-printf.c ++++ b/glib/tests/test-printf.c +@@ -895,6 +895,44 @@ test_upper_bound (void) + g_assert_cmpint (res, ==, 20); + } + ++static gint test_vasprintf_va (gchar **string, ++ const gchar *format, ++ ...) G_GNUC_PRINTF (2, 3); ++ ++/* Wrapper around g_vasprintf() which takes varargs */ ++static gint ++test_vasprintf_va (gchar **string, ++ const gchar *format, ++ ...) ++{ ++ va_list args; ++ gint len; ++ ++ va_start (args, format); ++ len = g_vasprintf (string, format, args); ++ va_end (args); ++ ++ return len; ++} ++ ++static void ++test_vasprintf_invalid_format_placeholder (void) ++{ ++ gint len = 0; ++ gchar *buf = "some non-null string"; ++ ++ g_test_summary ("Test error handling for invalid format placeholder in g_vasprintf()"); ++ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat" ++#pragma GCC diagnostic ignored "-Wformat-extra-args" ++ len = test_vasprintf_va (&buf, "%l", "nope"); ++#pragma GCC diagnostic pop ++ ++ g_assert_cmpint (len, ==, -1); ++ g_assert_null (buf); ++} ++ + int + main (int argc, + char *argv[]) +@@ -935,5 +973,7 @@ main (int argc, + g_test_add_func ("/sprintf/test-positional-params", test_positional_params3); + g_test_add_func ("/sprintf/upper-bound", test_upper_bound); + ++ g_test_add_func ("/vasprintf/invalid-format-placeholder", test_vasprintf_invalid_format_placeholder); ++ + return g_test_run(); + } +-- +GitLab diff --git a/patch/backport-tests-Add-unit-tests-for-GDBusMethodInvocation.patch b/patch/backport-tests-Add-unit-tests-for-GDBusMethodInvocation.patch new file mode 100644 index 0000000..59e1d32 --- /dev/null +++ b/patch/backport-tests-Add-unit-tests-for-GDBusMethodInvocation.patch @@ -0,0 +1,441 @@ +From a7750cd02004d5e5f2660426b4d6728a604ef1e2 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 17 Mar 2022 19:05:14 +0000 +Subject: [PATCH] tests: Add unit tests for GDBusMethodInvocation + +These should cover everything to do with returning a value or error from +a `GDBusMethodInvocation` object. + +Signed-off-by: Philip Withnall + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/a7750cd02004d5e5f2660426b4d6728a604ef1e2 + +--- + gio/tests/gdbus-method-invocation.c | 402 ++++++++++++++++++++++++++++ + gio/tests/meson.build | 1 + + 2 files changed, 403 insertions(+) + create mode 100644 gio/tests/gdbus-method-invocation.c + +diff --git a/gio/tests/gdbus-method-invocation.c b/gio/tests/gdbus-method-invocation.c +new file mode 100644 +index 0000000000..985fd45ced +--- /dev/null ++++ b/gio/tests/gdbus-method-invocation.c +@@ -0,0 +1,402 @@ ++/* GIO - GLib Input, Output and Streaming Library ++ * ++ * Copyright 漏 2022 Endless OS Foundation, LLC ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General ++ * Public License along with this library; if not, see . ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include "gdbus-tests.h" ++ ++static const GDBusArgInfo foo_get_fds_in_args = ++{ ++ -1, ++ "type", ++ "s", ++ NULL ++}; ++static const GDBusArgInfo * const foo_get_fds_in_arg_pointers[] = {&foo_get_fds_in_args, NULL}; ++ ++static const GDBusArgInfo foo_get_fds_out_args = ++{ ++ -1, ++ "some_fd", ++ "h", ++ NULL ++}; ++static const GDBusArgInfo * const foo_get_fds_out_arg_pointers[] = {&foo_get_fds_out_args, NULL}; ++ ++static const GDBusMethodInfo foo_method_info_wrong_return_type = ++{ ++ -1, ++ "WrongReturnType", ++ NULL, /* in args */ ++ NULL, /* out args */ ++ NULL /* annotations */ ++}; ++static const GDBusMethodInfo foo_method_info_close_before_returning = ++{ ++ -1, ++ "CloseBeforeReturning", ++ NULL, /* in args */ ++ NULL, /* out args */ ++ NULL /* annotations */ ++}; ++static const GDBusMethodInfo foo_method_info_get_fds = ++{ ++ -1, ++ "GetFDs", ++ (GDBusArgInfo **) foo_get_fds_in_arg_pointers, ++ (GDBusArgInfo **) foo_get_fds_out_arg_pointers, ++ NULL /* annotations */ ++}; ++static const GDBusMethodInfo foo_method_info_return_error = ++{ ++ -1, ++ "ReturnError", ++ NULL, /* in args */ ++ NULL, /* out args */ ++ NULL /* annotations */ ++}; ++static const GDBusMethodInfo * const foo_method_info_pointers[] = { ++ &foo_method_info_wrong_return_type, ++ &foo_method_info_close_before_returning, ++ &foo_method_info_get_fds, ++ &foo_method_info_return_error, ++ NULL ++}; ++ ++static const GDBusPropertyInfo foo_property_info[] = ++{ ++ { ++ -1, ++ "InvalidType", ++ "s", ++ G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, ++ NULL ++ }, ++ { ++ -1, ++ "InvalidTypeNull", ++ "s", ++ G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, ++ NULL ++ }, ++ { ++ -1, ++ "InvalidValueType", ++ "s", ++ G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, ++ NULL ++ }, ++}; ++static const GDBusPropertyInfo * const foo_property_info_pointers[] = ++{ ++ &foo_property_info[0], ++ &foo_property_info[1], ++ &foo_property_info[2], ++ NULL ++}; ++ ++static const GDBusInterfaceInfo foo_interface_info = ++{ ++ -1, ++ "org.example.Foo", ++ (GDBusMethodInfo **) &foo_method_info_pointers, ++ NULL, /* signals */ ++ (GDBusPropertyInfo **) &foo_property_info_pointers, ++ NULL, /* annotations */ ++}; ++ ++/* ---------------------------------------------------------------------------------------------------- */ ++ ++static void ++test_method_invocation_return_method_call (GDBusConnection *connection, ++ const gchar *sender, ++ const gchar *object_path, ++ const gchar *interface_name, ++ const gchar *method_name, ++ GVariant *parameters, ++ GDBusMethodInvocation *invocation, ++ gpointer user_data) ++{ ++ gboolean no_reply = g_dbus_message_get_flags (g_dbus_method_invocation_get_message (invocation)) & G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED; ++ ++ if (g_str_equal (interface_name, "org.freedesktop.DBus.Properties") && ++ g_str_equal (method_name, "Get")) ++ { ++ const gchar *iface_name, *prop_name; ++ ++ g_variant_get (parameters, "(&s&s)", &iface_name, &prop_name); ++ g_assert_cmpstr (iface_name, ==, "org.example.Foo"); ++ ++ /* Do different things depending on the property name. */ ++ if (g_str_equal (prop_name, "InvalidType")) ++ { ++ if (!no_reply) ++ g_test_expect_message ("GLib-GIO", G_LOG_LEVEL_WARNING, ++ "Type of return value for property 'Get' call should be '(v)' but got '(s)'"); ++ g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", "this type is invalid")); ++ } ++ else if (g_str_equal (prop_name, "InvalidTypeNull")) ++ { ++ if (!no_reply) ++ g_test_expect_message ("GLib-GIO", G_LOG_LEVEL_WARNING, ++ "Type of return value for property 'Get' call should be '(v)' but got '()'"); ++ g_dbus_method_invocation_return_value (invocation, NULL); ++ } ++ else if (g_str_equal (prop_name, "InvalidValueType")) ++ { ++ if (!no_reply) ++ g_test_expect_message ("GLib-GIO", G_LOG_LEVEL_WARNING, ++ "Value returned from property 'Get' call for 'InvalidValueType' should be 's' but is 'u'"); ++ g_dbus_method_invocation_return_value (invocation, g_variant_new ("(v)", g_variant_new_uint32 (123))); ++ } ++ else ++ { ++ g_assert_not_reached (); ++ } ++ ++ g_test_assert_expected_messages (); ++ } ++ else if (g_str_equal (interface_name, "org.freedesktop.DBus.Properties") && ++ g_str_equal (method_name, "Set")) ++ { ++ const gchar *iface_name, *prop_name; ++ GVariant *value; ++ ++ g_variant_get (parameters, "(&s&sv)", &iface_name, &prop_name, &value); ++ g_assert_cmpstr (iface_name, ==, "org.example.Foo"); ++ ++ if (g_str_equal (prop_name, "InvalidType")) ++ { ++ if (!no_reply) ++ g_test_expect_message ("GLib-GIO", G_LOG_LEVEL_WARNING, ++ "Type of return value for property 'Set' call should be '()' but got '(s)'"); ++ g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", "should be unit")); ++ } ++ else ++ { ++ g_assert_not_reached (); ++ } ++ ++ g_test_assert_expected_messages (); ++ g_variant_unref (value); ++ } ++ else if (g_str_equal (interface_name, "org.freedesktop.DBus.Properties") && ++ g_str_equal (method_name, "GetAll")) ++ { ++ const gchar *iface_name; ++ ++ g_variant_get (parameters, "(&s)", &iface_name); ++ g_assert_cmpstr (iface_name, ==, "org.example.Foo"); ++ ++ if (!no_reply) ++ g_test_expect_message ("GLib-GIO", G_LOG_LEVEL_WARNING, ++ "Type of return value for property 'GetAll' call should be '(a{sv})' but got '(s)'"); ++ g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", "should be a different type")); ++ } ++ else if (g_str_equal (interface_name, "org.example.Foo") && ++ g_str_equal (method_name, "WrongReturnType")) ++ { ++ if (!no_reply) ++ g_test_expect_message ("GLib-GIO", G_LOG_LEVEL_WARNING, ++ "Type of return value is incorrect: expected '()', got '(s)'"); ++ g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", "should be a different type")); ++ } ++ else if (g_str_equal (interface_name, "org.example.Foo") && ++ g_str_equal (method_name, "CloseBeforeReturning")) ++ { ++ g_dbus_connection_close (connection, NULL, NULL, NULL); ++ ++ g_dbus_method_invocation_return_value (invocation, NULL); ++ } ++ else if (g_str_equal (interface_name, "org.example.Foo") && ++ g_str_equal (method_name, "GetFDs")) ++ { ++ const gchar *action; ++ GUnixFDList *list = NULL; ++ GError *local_error = NULL; ++ ++ g_variant_get (parameters, "(&s)", &action); ++ ++ list = g_unix_fd_list_new (); ++ g_unix_fd_list_append (list, 1, &local_error); ++ g_assert_no_error (local_error); ++ ++ if (g_str_equal (action, "WrongNumber")) ++ { ++ g_unix_fd_list_append (list, 1, &local_error); ++ g_assert_no_error (local_error); ++ } ++ ++ if (g_str_equal (action, "Valid") || ++ g_str_equal (action, "WrongNumber")) ++ g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, g_variant_new ("(h)"), list); ++ else ++ g_assert_not_reached (); ++ ++ g_object_unref (list); ++ } ++ else if (g_str_equal (interface_name, "org.example.Foo") && ++ g_str_equal (method_name, "ReturnError")) ++ { ++ g_dbus_method_invocation_return_dbus_error (invocation, "org.example.Foo", "SomeError"); ++ } ++ else ++ g_assert_not_reached (); ++} ++ ++static void ++ensure_result_cb (GObject *source, ++ GAsyncResult *result, ++ gpointer user_data) ++{ ++ GDBusConnection *connection = G_DBUS_CONNECTION (source); ++ GVariant *reply; ++ guint *n_outstanding_calls = user_data; ++ ++ reply = g_dbus_connection_call_finish (connection, result, NULL); ++ ++ /* We don鈥檛 care what the reply is. */ ++ g_clear_pointer (&reply, g_variant_unref); ++ ++ g_assert_cmpint (*n_outstanding_calls, >, 0); ++ *n_outstanding_calls = *n_outstanding_calls - 1; ++} ++ ++static void ++test_method_invocation_return (void) ++{ ++ GDBusConnection *connection = NULL; ++ GError *local_error = NULL; ++ guint registration_id; ++ const GDBusInterfaceVTable vtable = { ++ test_method_invocation_return_method_call, NULL, NULL, { 0 } ++ }; ++ guint n_outstanding_calls = 0; ++ ++ g_test_summary ("Test calling g_dbus_method_invocation_return_*() in various ways"); ++ ++ /* Connect to the bus. */ ++ connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &local_error); ++ g_assert_no_error (local_error); ++ g_assert_nonnull (connection); ++ ++ /* Register an object which we can call methods on. */ ++ registration_id = g_dbus_connection_register_object (connection, ++ "/foo", ++ (GDBusInterfaceInfo *) &foo_interface_info, ++ &vtable, NULL, NULL, &local_error); ++ g_assert_no_error (local_error); ++ g_assert_cmpint (registration_id, !=, 0); ++ ++ /* Test a variety of error cases */ ++ { ++ const struct ++ { ++ const gchar *interface_name; ++ const gchar *method_name; ++ const gchar *parameters_string; ++ gboolean tests_undefined_behaviour; ++ } ++ calls[] = ++ { ++ { "org.freedesktop.DBus.Properties", "Get", "('org.example.Foo', 'InvalidType')", TRUE }, ++ { "org.freedesktop.DBus.Properties", "Get", "('org.example.Foo', 'InvalidTypeNull')", TRUE }, ++ { "org.freedesktop.DBus.Properties", "Get", "('org.example.Foo', 'InvalidValueType')", TRUE }, ++ { "org.freedesktop.DBus.Properties", "Set", "('org.example.Foo', 'InvalidType', <'irrelevant'>)", TRUE }, ++ { "org.freedesktop.DBus.Properties", "GetAll", "('org.example.Foo',)", TRUE }, ++ { "org.example.Foo", "WrongReturnType", "()", TRUE }, ++ { "org.example.Foo", "GetFDs", "('Valid',)", FALSE }, ++ { "org.example.Foo", "GetFDs", "('WrongNumber',)", TRUE }, ++ { "org.example.Foo", "ReturnError", "()", FALSE }, ++ { "org.example.Foo", "CloseBeforeReturning", "()", FALSE }, ++ }; ++ gsize i; ++ ++ for (i = 0; i < G_N_ELEMENTS (calls); i++) ++ { ++ if (calls[i].tests_undefined_behaviour && !g_test_undefined ()) ++ { ++ g_test_message ("Skipping %s.%s", calls[i].interface_name, calls[i].method_name); ++ continue; ++ } ++ else ++ { ++ g_test_message ("Calling %s.%s", calls[i].interface_name, calls[i].method_name); ++ } ++ ++ /* Call twice, once expecting a result and once not. Do the call which ++ * doesn鈥檛 expect a result first; message ordering should ensure that ++ * it鈥檚 completed by the time the second call completes, so we don鈥檛 ++ * have to account for it separately. ++ * ++ * That鈥檚 good, because the only way to get g_dbus_connection_call() ++ * to set %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED is to not provide ++ * a callback function. */ ++ n_outstanding_calls++; ++ ++ g_dbus_connection_call (connection, ++ g_dbus_connection_get_unique_name (connection), ++ "/foo", ++ calls[i].interface_name, ++ calls[i].method_name, ++ g_variant_new_parsed (calls[i].parameters_string), ++ NULL, ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, ++ NULL, /* no callback */ ++ NULL); ++ ++ g_dbus_connection_call (connection, ++ g_dbus_connection_get_unique_name (connection), ++ "/foo", ++ calls[i].interface_name, ++ calls[i].method_name, ++ g_variant_new_parsed (calls[i].parameters_string), ++ NULL, ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, ++ ensure_result_cb, ++ &n_outstanding_calls); ++ } ++ } ++ ++ /* Wait until all the calls are complete. */ ++ while (n_outstanding_calls > 0) ++ g_main_context_iteration (NULL, TRUE); ++ ++ g_dbus_connection_unregister_object (connection, registration_id); ++ g_object_unref (connection); ++} ++ ++int ++main (int argc, ++ char *argv[]) ++{ ++ g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL); ++ ++ g_test_add_func ("/gdbus/method-invocation/return", test_method_invocation_return); ++ ++ return session_bus_run (); ++} +diff --git a/gio/tests/meson.build b/gio/tests/meson.build +index 81ff551dda..c825b0cd7a 100644 +--- a/gio/tests/meson.build ++++ b/gio/tests/meson.build +@@ -333,6 +333,7 @@ if host_machine.system() != 'windows' + 'suite' : ['slow'], + }, + 'gdbus-introspection' : {'extra_sources' : extra_sources}, ++ 'gdbus-method-invocation' : {'extra_sources' : extra_sources}, + 'gdbus-names' : {'extra_sources' : extra_sources}, + 'gdbus-proxy' : {'extra_sources' : extra_sources}, + 'gdbus-proxy-threads' : { +-- +GitLab diff --git a/patch/backport-tests-Make-the-642026-test-take-100x-less-time.patch b/patch/backport-tests-Make-the-642026-test-take-100x-less-time.patch new file mode 100644 index 0000000..572d790 --- /dev/null +++ b/patch/backport-tests-Make-the-642026-test-take-100x-less-time.patch @@ -0,0 +1,77 @@ +From 80d3018c1d3e3abf3b2440140ceff8cefa5b8902 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Fri, 4 Mar 2022 19:21:40 +0000 +Subject: [PATCH] =?UTF-8?q?tests:=20Make=20the=20642026=20test=20take=2010?= + =?UTF-8?q?0=C3=97=20less=20time?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It’s a tradeoff of time against reproducibility of the failure conditions +this test is testing for. If this test is run 100× on CI (which it will +be every few weeks), that should be often enough to catch a regression +here. + +A regression in this code is unlikely, though. + +This change is motivated by the fact that periodically this test times +out, and even when it doesn’t, it takes on average 240s of CI runner +time during each CI run. That’s a lot of resources. + +See: https://gitlab.gnome.org/GNOME/glib/-/jobs/1862013 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/80d3018c1d3e3abf3b2440140ceff8cefa5b8902 + +Signed-off-by: Philip Withnall +--- + glib/tests/642026.c | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +diff --git a/glib/tests/642026.c b/glib/tests/642026.c +index aface4ea02..6fed6cd08c 100644 +--- a/glib/tests/642026.c ++++ b/glib/tests/642026.c +@@ -16,10 +16,6 @@ + + #include + +-/* On smcv's laptop, 1e4 iterations didn't always exhibit the bug, but 1e5 +- * iterations exhibited it 10/10 times in practice. YMMV. */ +-#define ITERATIONS 100000 +- + static GStaticPrivate sp; + static GMutex *mutex; + static GCond *cond; +@@ -51,6 +47,19 @@ static gpointer thread_func (gpointer nil) + static void + testcase (void) + { ++ /* On smcv's laptop, 1e4 iterations didn't always exhibit the bug, but 1e5 ++ * iterations exhibited it 10/10 times in practice. YMMV. ++ * ++ * If running with `-m slow` we want to try hard to reproduce the bug 10/10 ++ * times. However, as of 2022 this takes around 240s on a CI machine, which ++ * is a long time to tie up those resources to verify that a bug fixed 10 ++ * years ago is still fixed. ++ * ++ * So if running without `-m slow`, try 100× less hard to reproduce the bug, ++ * and rely on the fact that this is run under CI often enough to have a good ++ * chance of reproducing the bug in 1% of CI runs. */ ++ const guint n_iterations = g_test_slow () ? 100000 : 1000; ++ + g_test_bug ("642026"); + + mutex = g_mutex_new (); +@@ -58,7 +67,7 @@ testcase (void) + + g_mutex_lock (mutex); + +- for (i = 0; i < ITERATIONS; i++) ++ for (i = 0; i < n_iterations; i++) + { + GThread *t1; + +-- +GitLab + diff --git a/patch/backport-tests-dbus-appinfo-Add-test-case-for-flatpak-opening-an-invalid-file.patch b/patch/backport-tests-dbus-appinfo-Add-test-case-for-flatpak-opening-an-invalid-file.patch new file mode 100644 index 0000000..b82fc7f --- /dev/null +++ b/patch/backport-tests-dbus-appinfo-Add-test-case-for-flatpak-opening-an-invalid-file.patch @@ -0,0 +1,119 @@ +From 511627b7356af527c85c049e2020a36694d7de54 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Fri, 2 Sep 2022 18:56:35 +0200 +Subject: [PATCH] tests/dbus-appinfo: Add test case for flatpak opening an + invalid file + +We were testing the case in which we were opening an actual file, and so +potentially using a fd-list, however we were missing the case in which a file +was not existent. + +And in such case we are incidentally hitting a leak now. + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/511627b7356af527c85c049e2020a36694d7de54 + +--- + gio/tests/dbus-appinfo.c | 79 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 79 insertions(+) + +diff --git a/gio/tests/dbus-appinfo.c b/gio/tests/dbus-appinfo.c +index 2017e02df2..91e76403c6 100644 +--- a/gio/tests/dbus-appinfo.c ++++ b/gio/tests/dbus-appinfo.c +@@ -360,6 +360,84 @@ test_flatpak_doc_export (void) + g_object_unref (flatpak_appinfo); + } + ++static void ++on_flatpak_launch_invalid_uri_finish (GObject *object, ++ GAsyncResult *result, ++ gpointer user_data) ++{ ++ GApplication *app = user_data; ++ GError *error = NULL; ++ ++ g_app_info_launch_uris_finish (G_APP_INFO (object), result, &error); ++ g_assert_no_error (error); ++ ++ g_application_release (app); ++} ++ ++static void ++on_flatpak_activate_invalid_uri (GApplication *app, ++ gpointer user_data) ++{ ++ GDesktopAppInfo *flatpak_appinfo = user_data; ++ GList *uris; ++ ++ /* The app will be released in on_flatpak_launch_uris_finish */ ++ g_application_hold (app); ++ ++ uris = g_list_prepend (NULL, "file:///hopefully/an/invalid/path.desktop"); ++ g_app_info_launch_uris_async (G_APP_INFO (flatpak_appinfo), uris, NULL, ++ NULL, on_flatpak_launch_invalid_uri_finish, app); ++ g_list_free (uris); ++} ++ ++static void ++on_flatpak_open_invalid_uri (GApplication *app, ++ GFile **files, ++ gint n_files, ++ const char *hint) ++{ ++ GFile *f; ++ ++ g_assert_cmpint (n_files, ==, 1); ++ g_test_message ("on_flatpak_open received file '%s'", g_file_peek_path (files[0])); ++ ++ /* The file has been exported via the document portal */ ++ f = g_file_new_for_uri ("file:///hopefully/an/invalid/path.desktop"); ++ g_assert_true (g_file_equal (files[0], f)); ++ g_object_unref (f); ++} ++ ++static void ++test_flatpak_missing_doc_export (void) ++{ ++ const gchar *argv[] = { "myapp", NULL }; ++ gchar *desktop_file = NULL; ++ GDesktopAppInfo *flatpak_appinfo; ++ GApplication *app; ++ int status; ++ ++ g_test_summary ("Test that files launched via Flatpak apps are made available via the document portal."); ++ ++ desktop_file = g_test_build_filename (G_TEST_DIST, ++ "org.gtk.test.dbusappinfo.flatpak.desktop", ++ NULL); ++ flatpak_appinfo = g_desktop_app_info_new_from_filename (desktop_file); ++ g_assert_nonnull (flatpak_appinfo); ++ ++ app = g_application_new ("org.gtk.test.dbusappinfo.flatpak", ++ G_APPLICATION_HANDLES_OPEN); ++ g_signal_connect (app, "activate", G_CALLBACK (on_flatpak_activate_invalid_uri), ++ flatpak_appinfo); ++ g_signal_connect (app, "open", G_CALLBACK (on_flatpak_open_invalid_uri), NULL); ++ ++ status = g_application_run (app, 1, (gchar **) argv); ++ g_assert_cmpint (status, ==, 0); ++ ++ g_object_unref (app); ++ g_object_unref (flatpak_appinfo); ++ g_free (desktop_file); ++} ++ + int + main (int argc, char **argv) + { +@@ -367,6 +445,7 @@ main (int argc, char **argv) + + g_test_add_func ("/appinfo/dbusappinfo", test_dbus_appinfo); + g_test_add_func ("/appinfo/flatpak-doc-export", test_flatpak_doc_export); ++ g_test_add_func ("/appinfo/flatpak-missing-doc-export", test_flatpak_missing_doc_export); + + return session_bus_run (); + } +-- +GitLab + diff --git a/patch/backport-xdgmime-fix-double-free.patch b/patch/backport-xdgmime-fix-double-free.patch new file mode 100644 index 0000000..8aa6991 --- /dev/null +++ b/patch/backport-xdgmime-fix-double-free.patch @@ -0,0 +1,36 @@ +From f95ca6cb713383548f16f9a8ba2f6c51a4d25e25 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Fri, 17 Jun 2022 08:48:10 -0500 +Subject: [PATCH] xdgmime: fix double free + +We free xdg_dirs[i] twice, but fail to free xdg_dirs itself. + +Also, since free() is NULL-safe, there is no need for the second check +here. + +Discovered in: https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/16#note_1432025 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/f95ca6cb713383548f16f9a8ba2f6c51a4d25e25 + +--- + gio/xdgmime/xdgmime.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/gio/xdgmime/xdgmime.c b/gio/xdgmime/xdgmime.c +index 9ab6760486..c3c11625e8 100644 +--- a/gio/xdgmime/xdgmime.c ++++ b/gio/xdgmime/xdgmime.c +@@ -350,8 +350,7 @@ xdg_mime_set_dirs (const char * const *dirs) + + for (i = 0; xdg_dirs != NULL && xdg_dirs[i] != NULL; i++) + free (xdg_dirs[i]); +- if (xdg_dirs != NULL) +- free (xdg_dirs[i]); ++ free (xdg_dirs); + xdg_dirs = NULL; + + if (dirs != NULL) +-- +GitLab +