summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2023-03-13 23:45:33 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2023-03-13 23:45:33 +0000
commit22d26f8a78a8768185de4351274e77e080debcec (patch)
treeba27584b1e0c8df9f40c0ca7e00a922f5b617a82
parentd532f909811befd14257e5e7d423ff4b5179354b (diff)
downloadgobject-introspection-22d26f8a78a8768185de4351274e77e080debcec.tar.gz
Update GIR data for GLib
Sync up to GLib 2.76.0
-rw-r--r--gir/gio-2.0.c92
-rw-r--r--gir/glib-2.0.c7
-rw-r--r--gir/gobject-2.0.c14
3 files changed, 88 insertions, 25 deletions
diff --git a/gir/gio-2.0.c b/gir/gio-2.0.c
index 148cd244..d615c07b 100644
--- a/gir/gio-2.0.c
+++ b/gir/gio-2.0.c
@@ -7057,6 +7057,11 @@
* g_file_info_get_attribute_byte_string().This optimization will matter
* only if calling the API in a tight loop.
*
+ * It is an error to call these accessors without specifying their required file
+ * attributes when creating the #GFileInfo. Use g_file_info_has_attribute() or
+ * g_file_info_list_attributes() to check what attributes are specified for a
+ * #GFileInfo.
+ *
* #GFileAttributeMatcher allows for searching through a #GFileInfo for
* attributes.
*/
@@ -22284,7 +22289,7 @@
* @matcher: a #GFileAttributeMatcher.
* @attribute: a file attribute key.
*
- * Checks if a attribute matcher only matches a given attribute. Always
+ * Checks if an attribute matcher only matches a given attribute. Always
* returns %FALSE if "*" was used when creating the matcher.
*
* Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
@@ -23555,9 +23560,10 @@
* Gets the access time of the current @info and returns it as a
* #GDateTime.
*
- * This requires the %G_FILE_ATTRIBUTE_TIME_ACCESS attribute. If
- * %G_FILE_ATTRIBUTE_TIME_ACCESS_USEC is provided, the resulting #GDateTime
- * will have microsecond precision.
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_TIME_ACCESS. If %G_FILE_ATTRIBUTE_TIME_ACCESS_USEC is
+ * provided, the resulting #GDateTime will additionally have microsecond
+ * precision.
*
* If nanosecond precision is needed, %G_FILE_ATTRIBUTE_TIME_ACCESS_NSEC must
* be queried separately using g_file_info_get_attribute_uint32().
@@ -23572,7 +23578,7 @@
* @info: a #GFileInfo.
* @attribute: a file attribute key.
*
- * Gets the value of a attribute, formatted as a string.
+ * Gets the value of an attribute, formatted as a string.
* This escapes things as needed to make the string valid
* UTF-8.
*
@@ -23745,6 +23751,9 @@
*
* Gets the file's content type.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
+ *
* Returns: (nullable): a string containing the file's content type,
* or %NULL if unknown.
*/
@@ -23757,9 +23766,10 @@
* Gets the creation time of the current @info and returns it as a
* #GDateTime.
*
- * This requires the %G_FILE_ATTRIBUTE_TIME_CREATED attribute. If
- * %G_FILE_ATTRIBUTE_TIME_CREATED_USEC is provided, the resulting #GDateTime
- * will have microsecond precision.
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_TIME_CREATED. If %G_FILE_ATTRIBUTE_TIME_CREATED_USEC is
+ * provided, the resulting #GDateTime will additionally have microsecond
+ * precision.
*
* If nanosecond precision is needed, %G_FILE_ATTRIBUTE_TIME_CREATED_NSEC must
* be queried separately using g_file_info_get_attribute_uint32().
@@ -23774,8 +23784,8 @@
* @info: a #GFileInfo.
*
* Returns the #GDateTime representing the deletion date of the file, as
- * available in G_FILE_ATTRIBUTE_TRASH_DELETION_DATE. If the
- * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, %NULL is returned.
+ * available in %G_FILE_ATTRIBUTE_TRASH_DELETION_DATE. If the
+ * %G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, %NULL is returned.
*
* Returns: (nullable): a #GDateTime, or %NULL.
* Since: 2.36
@@ -23788,6 +23798,9 @@
*
* Gets a display name for a file. This is guaranteed to always be set.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
+ *
* Returns: (not nullable): a string containing the display name.
*/
@@ -23798,6 +23811,9 @@
*
* Gets the edit name for a file.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
+ *
* Returns: a string containing the edit name.
*/
@@ -23809,6 +23825,9 @@
* Gets the [entity tag][gfile-etag] for a given
* #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_ETAG_VALUE.
+ *
* Returns: (nullable): a string containing the value of the "etag:value" attribute.
*/
@@ -23820,6 +23839,9 @@
* Gets a file's type (whether it is a regular file, symlink, etc).
* This is different from the file's content type, see g_file_info_get_content_type().
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_TYPE.
+ *
* Returns: a #GFileType for the given file.
*/
@@ -23830,6 +23852,9 @@
*
* Gets the icon for a file.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_ICON.
+ *
* Returns: (nullable) (transfer none): #GIcon for the given @info.
*/
@@ -23840,6 +23865,9 @@
*
* Checks if a file is a backup file.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP.
+ *
* Returns: %TRUE if file is a backup file, %FALSE otherwise.
*/
@@ -23850,6 +23878,9 @@
*
* Checks if a file is hidden.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
+ *
* Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
*/
@@ -23860,6 +23891,9 @@
*
* Checks if a file is a symlink.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
+ *
* Returns: %TRUE if the given @info is a symlink.
*/
@@ -23871,9 +23905,10 @@
* Gets the modification time of the current @info and returns it as a
* #GDateTime.
*
- * This requires the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute. If
- * %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC is provided, the resulting #GDateTime
- * will have microsecond precision.
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_TIME_MODIFIED. If %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC is
+ * provided, the resulting #GDateTime will additionally have microsecond
+ * precision.
*
* If nanosecond precision is needed, %G_FILE_ATTRIBUTE_TIME_MODIFIED_NSEC must
* be queried separately using g_file_info_get_attribute_uint32().
@@ -23891,6 +23926,10 @@
* Gets the modification time of the current @info and sets it
* in @result.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_TIME_MODIFIED. If %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC is
+ * provided it will be used too.
+ *
* Deprecated: 2.62: Use g_file_info_get_modification_date_time() instead, as
* #GTimeVal is deprecated due to the year 2038 problem.
*/
@@ -23902,6 +23941,9 @@
*
* Gets the name for a file. This is guaranteed to always be set.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_NAME.
+ *
* Returns: (type filename) (not nullable): a string containing the file name.
*/
@@ -23914,6 +23956,9 @@
* the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute and is converted
* from #guint64 to #goffset before returning the result.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_SIZE.
+ *
* Returns: a #goffset containing the file's size (in bytes).
*/
@@ -23925,6 +23970,9 @@
* Gets the value of the sort_order attribute from the #GFileInfo.
* See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
+ *
* Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
*/
@@ -23935,6 +23983,9 @@
*
* Gets the symbolic icon for a file.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
+ *
* Returns: (nullable) (transfer none): #GIcon for the given @info.
* Since: 2.34
*/
@@ -23946,6 +23997,9 @@
*
* Gets the symlink target for a given #GFileInfo.
*
+ * It is an error to call this if the #GFileInfo does not contain
+ * %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET.
+ *
* Returns: (nullable): a string containing the symlink target.
*/
@@ -28712,7 +28766,7 @@
/**
* g_list_store_find_with_equal_func:
* @store: a #GListStore
- * @item: (type GObject): an item
+ * @item: (type GObject) (nullable): an item
* @equal_func: (scope call): A custom equality check function
* @position: (out) (optional): the first position of @item, if it was found.
*
@@ -28721,6 +28775,10 @@
* matches. If @item was not found, then @position will not be set, and this
* method will return %FALSE.
*
+ * @item is always passed as second parameter to @equal_func.
+ *
+ * Since GLib 2.76 it is possible to pass `NULL` for @item.
+ *
* Returns: Whether @store contains @item. If it was found, @position will be
* set to the position where @item occurred for the first time.
* Since: 2.64
@@ -28730,7 +28788,7 @@
/**
* g_list_store_find_with_equal_func_full:
* @store: a #GListStore
- * @item: (type GObject): an item
+ * @item: (type GObject) (nullable): an item
* @equal_func: (scope call): A custom equality check function
* @user_data: (closure): user data for @equal_func
* @position: (out) (optional): the first position of @item, if it was found.
@@ -28738,6 +28796,10 @@
* Like g_list_store_find_with_equal_func() but with an additional @user_data
* that is passed to @equal_func.
*
+ * @item is always passed as second parameter to @equal_func.
+ *
+ * Since GLib 2.76 it is possible to pass `NULL` for @item.
+ *
* Returns: Whether @store contains @item. If it was found, @position will be
* set to the position where @item occurred for the first time.
* Since: 2.74
diff --git a/gir/glib-2.0.c b/gir/glib-2.0.c
index 7bdd1c41..d9489c5c 100644
--- a/gir/glib-2.0.c
+++ b/gir/glib-2.0.c
@@ -17837,7 +17837,7 @@
* }
*
* // DO THIS INSTEAD
- * fd = g_open (filename, O_WRONLY | O_NOFOLLOW);
+ * fd = g_open (filename, O_WRONLY | O_NOFOLLOW | O_CLOEXEC);
* if (fd == -1)
* {
* // check error
@@ -35885,8 +35885,9 @@
* Returns: %TRUE for the forked child and %FALSE for the executing parent process.
* Since: 2.16
* Deprecated: This function is implemented only on Unix platforms,
- * and is not always reliable due to problems inherent in
- * fork-without-exec. Use g_test_trap_subprocess() instead.
+ * is not always reliable due to problems inherent in fork-without-exec
+ * and doesn't set close-on-exec flag on its file descriptors.
+ * Use g_test_trap_subprocess() instead.
*/
diff --git a/gir/gobject-2.0.c b/gir/gobject-2.0.c
index 8520043f..6290706e 100644
--- a/gir/gobject-2.0.c
+++ b/gir/gobject-2.0.c
@@ -6528,7 +6528,7 @@
* other validly registered type ID, but randomized type IDs should
* not be passed in and will most likely lead to a crash.
*
- * Returns: static type name or %NULL
+ * Returns: (nullable): static type name or %NULL
*/
@@ -6905,7 +6905,7 @@
* g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (@value),
* return_value);
*
- * Returns: boxed contents of @value
+ * Returns: (transfer full) (nullable): boxed contents of @value
*/
@@ -6917,7 +6917,7 @@
* its reference count. If the contents of the #GValue are %NULL, then
* %NULL will be returned.
*
- * Returns: (type GObject.Object) (transfer full): object content of @value,
+ * Returns: (type GObject.Object) (transfer full) (nullable): object content of @value,
* should be unreferenced when no longer needed.
*/
@@ -6940,7 +6940,7 @@
*
* Get a copy the contents of a %G_TYPE_STRING #GValue.
*
- * Returns: a newly allocated copy of the string content of @value
+ * Returns: (nullable) (transfer full): a newly allocated copy of the string content of @value
*/
@@ -6984,7 +6984,7 @@
*
* Get the contents of a %G_TYPE_BOXED derived #GValue.
*
- * Returns: (transfer none): boxed contents of @value
+ * Returns: (transfer none) (nullable): boxed contents of @value
*/
@@ -7089,7 +7089,7 @@
*
* Get the contents of a %G_TYPE_OBJECT derived #GValue.
*
- * Returns: (type GObject.Object) (transfer none): object contents of @value
+ * Returns: (type GObject.Object) (transfer none) (nullable): object contents of @value
*/
@@ -7130,7 +7130,7 @@
*
* Get the contents of a %G_TYPE_STRING #GValue.
*
- * Returns: string content of @value
+ * Returns: (nullable) (transfer none): string content of @value
*/