Projects
Mega:23.09
gobject-introspection
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
_service:tar_scm:gobject-introspection.spec
Changed
@@ -1,12 +1,12 @@ -%global glib2_version 2.74.0 +%global glib2_version 2.76.4 Name: gobject-introspection -Version: 1.74.0 -Release: 2 +Version: 1.76.1 +Release: 1 Summary: Introspection system for GObject-based libraries License: GPLv2+ and LGPLv2+ and MIT URL: https://wiki.gnome.org/Projects/GObjectIntrospection -Source0: https://download.gnome.org/sources/gobject-introspection/1.74/%{name}-%{version}.tar.xz +Source0: https://download.gnome.org/sources/gobject-introspection/1.76/%{name}-%{version}.tar.xz BuildRequires: gcc bison cairo-gobject-devel chrpath flex fontconfig-devel freetype-devel gettext glib2-devel >= %{glib2_version} libxslt meson BuildRequires: gtk-doc libffi-devel libX11-devel libXfixes-devel libXft-devel libxml2-devel mesa-libGL-devel python3-devel python3-mako python3-markdown @@ -74,6 +74,9 @@ %{_mandir}/man1/*.1* %changelog +* Sat Jan 27 2024 shixuantong <shixuantong1@huawei.com> - 1.76.1-1 +- upgrade version to 1.76.1 + * Thu May 25 2023 fuanan <fuanan3@h-partners.com> - 1.74.0-2 - enable test in check
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="url">git@gitee.com:src-openeuler/gobject-introspection.git</param> <param name="scm">git</param> - <param name="revision">openEuler-23.09</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/subprojects/libffi.wrap
Deleted
@@ -1,5 +0,0 @@ -wrap-git -directory=libffi -url=https://github.com/centricular/libffi.git -revision=meson -depth=1
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/subprojects/proxy-libintl.wrap
Deleted
@@ -1,5 +0,0 @@ -wrap-git -directory=proxy-libintl -url=https://github.com/centricular/proxy-libintl.git -revision=master -depth=1
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/subprojects/zlib.wrap
Deleted
@@ -1,12 +0,0 @@ -wrap-file -directory = zlib-1.2.12 -source_url = http://zlib.net/fossils/zlib-1.2.12.tar.gz -source_filename = zlib-1.2.12.tar.gz -source_hash = 91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9 -patch_filename = zlib_1.2.12-1_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/zlib_1.2.12-1/get_patch -patch_hash = 8ec8344f3fe7b06ad4be768fd416694bc56cb4545ce78b0f1c18b3e72b3ec936 - -provide -zlib = zlib_dep -
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/.gitlab-ci.yml -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/.gitlab-ci.yml
Changed
@@ -17,6 +17,7 @@ EXTRA_MESON_FLAGS: "-Ddoctool=enabled -Dgtk_doc=true" script: - meson setup ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _build . + - .gitlab-ci/show-git-commits.sh || true - meson compile -C _build - sudo meson install -C _build - g-ir-scanner --version @@ -36,6 +37,7 @@ EXTRA_MESON_FLAGS: "-Ddoctool=enabled -Dgtk_doc=true" script: - meson setup ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _build . + - .gitlab-ci/show-git-commits.sh || true - meson compile -C _build - sudo meson install -C _build - g-ir-scanner --version @@ -53,6 +55,7 @@ EXTRA_MESON_FLAGS: "-Ddoctool=enabled -Dgtk_doc=true -Dwerror=true" script: - meson setup ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _build . + - .gitlab-ci/show-git-commits.sh || true - meson compile -C _build - meson test -C _build --print-errorlogs --suite=gobject-introspection --no-suite=glib - ninja -C _build gi-doc @@ -78,6 +81,7 @@ CCACHE_DIR: "${CI_PROJECT_DIR}/_ccache" script: - meson setup _build . + - .gitlab-ci/show-git-commits.sh || true - meson compile -C _build - meson test -C _build --print-errorlogs --suite=gobject-introspection except: @@ -97,6 +101,7 @@ EXTRA_MESON_FLAGS: "-Dwerror=true" script: - meson setup ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _build . + - .gitlab-ci/show-git-commits.sh || true - meson compile -C _build - meson test -C _build --print-errorlogs --suite=gobject-introspection --no-suite=glib except: @@ -116,6 +121,7 @@ PYENV_VERSION: "3.6.12" script: - meson setup ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _build . + - .gitlab-ci/show-git-commits.sh || true - meson compile -C _build - meson test -C _build --print-errorlogs --suite=gobject-introspection --no-suite=glib except: @@ -142,6 +148,7 @@ name: "gi-_${env:CI_COMMIT_REF_NAME}" paths: - _build/meson-logs + allow_failure: true msys2-clang64-meson: stage: build @@ -158,6 +165,7 @@ name: "gi-_${env:CI_COMMIT_REF_NAME}" paths: - _build/meson-logs + allow_failure: true vs2017-x64-meson: stage: build
View file
_service:tar_scm:gobject-introspection-1.76.1.tar.xz/.gitlab-ci/show-git-commits.sh
Added
@@ -0,0 +1,6 @@ +#!/bin/sh + +for dir in ./ subprojects/*/; do + echo "git commit in $dir:" + ( cd "$dir" && git describe --always --broken --dirty --long --tags ) || true +done
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/.gitlab-ci/test-msys2-meson.sh -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/.gitlab-ci/test-msys2-meson.sh
Changed
@@ -35,6 +35,8 @@ --buildtype debug \ _build +.gitlab-ci/show-git-commits.sh || true + meson compile -C _build meson test \
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/NEWS -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/NEWS
Changed
@@ -1,3 +1,37 @@ +1.76.1 - 2023-03-22 +------------------- + +* Handle null default values #457 +* Documentation fixes + +1.76.0 - 2023-03-13 +------------------- + +* Documentation fixes +* Update the GIR data for GLib + +1.75.6 - 2023-02-13 +------------------- + +* Documentation fixes +* Fix build when using GLib as a subproject +* Update the GIR data for GLib + +1.75.4 - 2023-01-09 +------------------- + +* Brown-paper bag release to fix the GLib dependency. + +1.75.2 - 2023-01-09 +------------------- + +* Split 'disguised' attribute into two separate attributes #101 +* Add copy/free function annotations for plain-old data types #14 +* Include the default value of GObject properties in the GIR data #4 +* Drop wrap files for recursive dependencies +* Add more marshalling tests Marco Trevisan +* Update the GIR data for GLib, GObject, GModule, and GIO Sebastian Dröge, Rico Tzschichholz + 1.74.0 - 2022-09-17 -------------------
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/docs/gir-1.2.rnc -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/docs/gir-1.2.rnc
Changed
@@ -215,9 +215,16 @@ attribute name { xsd:string }, ## Corresponding C type of the record attribute c:type { xsd:string }?, - ## Binary attribute to tell if the record is disguised, i.e. whether the c:type is a typedef that doesn't look like a pointer, but is one internally - ## Its second meaning is "private" and is set when any typedef struct is parsed which doesn't also include a full struct with fields (https://gitlab.gnome.org/GNOME/gobject-introspection/issues/101) + ## Deprecated. Binary attribute to tell if the record is disguised, i.e. whether the c:type + ## is a typedef that doesn't look like a pointer, but is one internally. Its second meaning + ## is "private" and is set when any typedef struct is parsed which doesn't also include a + ## full struct with fields (https://gitlab.gnome.org/GNOME/gobject-introspection/issues/101) + ## Replaced by "opaque" and "pointer". attribute disguised { "0" | "1" }?, + ## Binary attribute for a typedef struct that does not have a corresponding public structure definition + attribute opaque { "0" | "1" }?, + ## Binary attribute for a typedef struct pointer, e.g. typedef struct Foo* FooPtr + attribute pointer { "0" | "1" }?, ## GObject compatible C type of the record attribute glib:type-name { xsd:string }?, ## Function to get the GObject compatible type of the record @@ -228,6 +235,10 @@ attribute foreign { "0" | "1" }?, ## Name of the GObject compatible gtype this record represents. If empty, this record will be hidden from generated public APIs. attribute glib:is-gtype-struct-for { xsd:string }?, + ## Name of the function used to copy the record + attribute copy-function { xsd:string }?, + ## Name of the function used to free the record + attribute free-function { xsd:string }?, # Other elements a record can contain # mandatory @@ -244,7 +255,7 @@ ## Binary attribute which is "0" (false) if the element is not introspectable. It doesn't exist in the bindings, due in general to missing information in the annotations in the original C code attribute introspectable { "0" | "1" }?, ## Binary attribute which is "1" (true) if the element has been deprecated - attribute deprecated { xsd:string }?, + attribute deprecated { "0" | "1" }?, ## Version number from which this element is deprecated attribute deprecated-version { xsd:string }?, ## version number of an element @@ -350,6 +361,8 @@ attribute setter { xsd:string }?, ## The getter function for this property attribute getter { xsd:string }?, + ## The default value of the property, as a string; if missing, the default value is zero for integer types, and null for pointer types + attribute default-value { xsd:string }?, # Define the transfer of ownership of the property element TransferOwnership?, @@ -525,7 +538,7 @@ attribute closure { xsd:integer }?, ## the parameter is a destroy_data for callbacks. The value points to a different parameter that is the actual callback attribute destroy { xsd:integer }?, - ## the parameter is a callback, the value indicates the lifetime of the call. For language bindings which want to know when the resources required to do the call can be freed. "notified" valid until a GDestroyNotify argument is called, "async" only valid for the duration of the first callback invocationi (can only be called once), "call" only valid for the duration of the call, can be called multiple times during the call, "forever" valid until the process terminates. + ## the parameter is a callback, the value indicates the lifetime of the call. For language bindings which want to know when the resources required to do the call can be freed. "notified" valid until a GDestroyNotify argument is called, "async" only valid for the duration of the first callback invocation (can only be called once), "call" only valid for the duration of the call, can be called multiple times during the call, "forever" valid until the process terminates. attribute scope { "notified" | "async" | "call" | "forever" }?, ## direction of the parameter. "in" goes into the callable, "out" for output parameters from the callable (reference in C++, var in Pascal, etc...), "inout" for both (like a pre-allocated structure which will be filled-in by the callable) attribute direction { "out" | "in" | "inout" }?, @@ -569,7 +582,7 @@ attribute nullable { "0" | "1" }?, ## the parameter is a user_data for callbacks. The value points to a different parameter that is the actual callback attribute closure { xsd:integer }?, - ## the parameter is a callback, the value indicates the lifetime of the call. For language bindings which want to know when the resources required to do the call can be freed. "notified" valid until a GDestroyNotify argument is called, "async" only valid for the duration of the first callback invocationi (can only be called once), "call" only valid for the duration of the call, can be called multiple times during the call, "forever" valid until the process terminates. + ## the parameter is a callback, the value indicates the lifetime of the call. For language bindings which want to know when the resources required to do the call can be freed. "notified" valid until a GDestroyNotify argument is called, "async" only valid for the duration of the first callback invocation (can only be called once), "call" only valid for the duration of the call, can be called multiple times during the call, "forever" valid until the process terminates. attribute scope { "notified" | "async" | "call" | "forever" }?, ## the parameter is a destroy_data for callbacks. The value points to a different parameter that is the actual callback attribute destroy { xsd:integer }?, @@ -634,6 +647,10 @@ attribute glib:type-name { xsd:string }?, ## function to retrieve the GObject compatible type of the element attribute glib:get-type { xsd:string }?, + ## Name of the function used to copy the union + attribute copy-function { xsd:string }?, + ## Name of the function used to free the union + attribute free-function { xsd:string }?, (Info.elements & Field*
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/docs/website/annotations/giannotations.rst -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/docs/website/annotations/giannotations.rst
Changed
@@ -129,6 +129,10 @@ - identifier (only applies to methods) - This signal is emitted by the given method - + * - ``(default-value VALUE)`` + - identifier (only applies to properties) + - The default value of a GObject property, as a freeform string + - :issue:`4` Support for GObject closures @@ -144,24 +148,22 @@ - Since * - ``(destroy)`` - parameters - - The parameter is a "``destroy_data``" for callbacks. + - The parameter is part of a callback type and containing the ``destroy_data``. - :commit:`v0.6.3 <cf7621f3>` :bzbug:`574284` * - ``(destroy DESTROY)`` - parameters - - The parameter is a "``destroy_data``" for callbacks, the - ``DESTROY`` option points to a paramter name other than - ``destroy_data``. + - The parameter defines the ``destroy_data`` for a given callback. The + ``DESTROY`` option points to the parameter that is the actual callback. - * - ``(closure)`` - parameters - - The parameter is a "``user_data``" for callbacks. - Many bindings can pass ``NULL`` here. + - The parameter is part of a callback type and containing the ``user_data``. - * - ``(closure CLOSURE)`` - parameters - - The parameter is a "``user_data``" for callbacks, the ``CLOSURE`` option - points to a different parameter that is the actual callback. + - The parameter defines the ``user_data`` for a given callback. The ``CLOSURE`` option + points to the parameter that is the actual callback. Many bindings can pass ``NULL`` here. - @@ -195,6 +197,14 @@ - ``FUNC`` is the function used to convert from a struct to a GValue, must be a GTypeInstance - + * - ``(copy-func FUNC)`` + - identifier + - ``FUNC`` is the function used to copy a struct or a union + - 1.76 + * - ``(free-func FUNC)`` + - identifier + - ``FUNC`` is the function used to free a struct or a union + - 1.76 Type signature @@ -211,7 +221,7 @@ * - ``(nullable)`` - parameters, return value - Indicates that ``NULL`` may be a valid value for a parameter - (in, out, inout), or return value (though note that return values which + (in, out, inout), or return value (though note that return and out values which are only ``NULL`` when throwing an error should not be annotated as ``(nullable)``). - :commit:`1.42 <1459ff3e>` @@ -669,6 +679,8 @@ An example which demonstrates an (optional) parameter: an (out) parameter where the caller can pass NULL if they don’t want to receive the (out) value. +Note that if the GError is returned set, the value of contents and length might +be unspecified and should therefore not be used or freed. ::
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/docs/website/writingbindableapis.rst -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/docs/website/writingbindableapis.rst
Changed
@@ -29,8 +29,8 @@ guint flags; -Functionality only accessible through a C macro -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Functionality only accessible through a C macro or inline function +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The scanner does not support C macros as API. Solution - add a function accessor rather than a macro. This also has the side effect of making @@ -44,6 +44,9 @@ GtkWidgetFlags gtk_widget_get_flags (GtkWidget *widget); /* Actually, see http://bugzilla.gnome.org/show_bug.cgi?id=69872 */ +Likewise, inline functions cannot be loaded from a dynamic library. Make sure to +provide a non-inline equivalent. + Direct C structure access for objects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -89,6 +92,9 @@ using the ``rename-to`` annotation: ``gtk_list_store_newv: (rename-to gtk_list_store_new)`` +Also consider using C99's compound literals and designated initializers to avoid +``va_list`` even in the C API, which is more type-safe. + Multiple out parameters ~~~~~~~~~~~~~~~~~~~~~~~ @@ -107,12 +113,66 @@ gint *y); +In-out parameters +~~~~~~~~~~~~~~~~~ + +Don't use in-out arguments, especially not for non-scalar values. It's difficult +to enforce or validate the conventions for in-out arguments, which can easily +lead to crashes. + +Instead, pass the input as an in argument, and receive the output as either a +return value or an out argument. + +.. code-block:: c + + FooBoxed *foo_bar_scale_boxed(FooBar *self, + FooBoxed *boxed); + + void foo_bar_scale_boxed(FooBar *self, + FooBoxed *boxed_in, + FooBoxed **boxed_out); + +In particular, do not require the caller to pass an initialized ``GValue`` to +avoid the in-out annotation; instead, pass a ``GValue`` as an out argument, and +have the function initialize it. + + Arrays ~~~~~~ For reference types, zero-terminated arrays are the easiest to work with. Arrays of primitive type such as "int" will require length metadata. +In a general-purpose library, it's best not to expose GLib array and hash types +such as ``GArray``, ``GPtrArray``, ``GByteArray``, ``GList``, ``GSList``, +``GQueue``, and ``GHashTable`` in the public API. They are fine for internal +libraries, but difficult in general for consumers of introspected libraries to +deal with. + + +Strings +~~~~~~~ + +C treats strings as zero-terminated arrays of bytes, but many other languages do not. So don't +write APIs that treat ``const char *`` parameters as arrays that need an +``array length`` annotation. + +Treat all ``const char *`` parameters as zero-terminated strings. Don't use the +same entry point for zero-terminated strings as for byte arrays which may +contain embedded zeroes. + +.. code-block:: c + + void foo_bar_snarf_string(FooBar *self, + const char *str); + + void foo_bar_snarf_bytes(FooBar *self, + const uint8_t *bytes, + size_t length); + +In particular, avoid functions taking a ``const char *`` with a signed length +that can be set to a negative value to let the function compute the string +length in bytes. These functions are hard to bind, and require manual overrides. Callbacks ~~~~~~~~~ @@ -168,3 +228,31 @@ Instead, put initialization code in the ``foo_bar_init()`` function or the ``foo_bar_constructed()`` virtual function. + + +Transfer-none return values from the binding +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If your library expects to call a function from C which may be implemented in +another language and exposed through the binding (for example, a signal handler, +or a GObject vfunc), it's best not to return transfer-none values, because what +you assume about storage lifetime in C may not apply in other languages. + +For example, + +.. code-block:: c + + typedef struct { + GTypeInterface iface; + + const char * (*my_vfunc) (FooBaz *self); /* Don't do this! */ + char * (*my_better_vfunc) (FooBaz *self); /* Do this instead! */ + } FooBazIface; + +A class that implements ``FooBazIface`` in another programming language may not +be able to return a static string here, because the language may not have a +concept of static storage lifetime, or it may not store strings as +zero-terminated UTF-8 bytes as C code would expect. This can cause memory leaks. +Instead, duplicate the string before returning it, and use transfer-full. This +recommendation applies to any data type with an ownership, including boxed and +object types.
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/gir/freetype2-2.0.gir -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/gir/freetype2-2.0.gir
Changed
@@ -11,12 +11,5 @@ <alias name="Int32" c:type="FT_Int32"> <type name="int32"/> </alias> - <function name="library_version" c:identifier="FT_Library_Version"> - <return-value transfer-ownership="none"> - <type name="none" c:type="void"/> - </return-value> - <parameters> - </parameters> - </function> </namespace> </repository>
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/gir/gio-2.0.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/gir/gio-2.0.c
Changed
@@ -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. */ @@ -9527,6 +9532,10 @@ * #GTask was constructed to be running at least until the task has completed * and its data has been freed. * + * If a #GTask has been constructed and its callback set, it is an error to + * not call `g_task_return_*()` on it. GLib will warn at runtime if this happens + * (since 2.76). + * * Here is an example for using GTask as a GAsyncResult: * |<!-- language="C" --> * typedef struct { @@ -10001,6 +10010,24 @@ * having come from the `_async()` wrapper * function (for "short-circuit" results, such as when passing * 0 to g_input_stream_read_async()). + * + * ## Thread-safety considerations + * + * Due to some infelicities in the API design, there is a + * thread-safety concern that users of GTask have to be aware of: + * + * If the `main` thread drops its last reference to the source object + * or the task data before the task is finalized, then the finalizers + * of these objects may be called on the worker thread. + * + * This is a problem if the finalizers use non-threadsafe API, and + * can lead to hard-to-debug crashes. Possible workarounds include: + * + * - Clear task data in a signal handler for `notify::completed` + * + * - Keep iterating a main context in the main thread and defer + * dropping the reference to the source object to that main + * context when the task is finalized */ @@ -11590,8 +11617,9 @@ /** * g_action_parse_detailed_name: * @detailed_name: a detailed action name - * @action_name: (out): the action name - * @target_value: (out): the target value, or %NULL for no target + * @action_name: (out) (optional) (not nullable) (transfer full): the action name + * @target_value: (out) (optional) (nullable) (transfer full): the target value, + * or %NULL for no target * @error: a pointer to a %NULL #GError, or %NULL * * Parses a detailed action name into its separate name and target @@ -11601,23 +11629,29 @@ * * The first format is used to represent an action name with no target * value and consists of just an action name containing no whitespace - * nor the characters ':', '(' or ')'. For example: "app.action". + * nor the characters `:`, `(` or `)`. For example: `app.action`. * * The second format is used to represent an action with a target value - * that is a non-empty string consisting only of alphanumerics, plus '-' - * and '.'. In that case, the action name and target value are - * separated by a double colon ("::"). For example: - * "app.action::target". + * that is a non-empty string consisting only of alphanumerics, plus `-` + * and `.`. In that case, the action name and target value are + * separated by a double colon (`::`). For example: + * `app.action::target`. * * The third format is used to represent an action with any type of * target value, including strings. The target value follows the action - * name, surrounded in parens. For example: "app.action(42)". The + * name, surrounded in parens. For example: `app.action(42)`. The * target value is parsed using g_variant_parse(). If a tuple-typed * value is desired, it must be specified in the same way, resulting in - * two sets of parens, for example: "app.action((1,2,3))". A string - * target can be specified this way as well: "app.action('target')". - * For strings, this third format must be used if * target value is - * empty or contains characters other than alphanumerics, '-' and '.'. + * two sets of parens, for example: `app.action((1,2,3))`. A string + * target can be specified this way as well: `app.action('target')`. + * For strings, this third format must be used if target value is + * empty or contains characters other than alphanumerics, `-` and `.`. + * + * If this function returns %TRUE, a non-%NULL value is guaranteed to be returned + * in @action_name (if a pointer is passed in). A %NULL value may still be + * returned in @target_value, as the @detailed_name may not contain a target. + * + * If returned, the #GVariant in @target_value is guaranteed to not be floating. * * Returns: %TRUE if successful, else %FALSE with @error set * Since: 2.38 @@ -11903,6 +11937,10 @@ * * Gets the executable's name for the installed application. * + * This is intended to be used for debugging or labelling what program is going + * to be run. To launch the executable, use g_app_info_launch() and related + * functions, rather than spawning the return value from this function. + * * Returns: (type filename): a string containing the @appinfo's application * binaries name */ @@ -12024,9 +12062,9 @@ * environment variable with the path of the launched desktop file and * `GIO_LAUNCHED_DESKTOP_FILE_PID` to the process id of the launched * process. This can be used to ignore `GIO_LAUNCHED_DESKTOP_FILE`, - * should it be inherited by further processes. The `DISPLAY` and - * `DESKTOP_STARTUP_ID` environment variables are also set, based - * on information provided in @context. + * should it be inherited by further processes. The `DISPLAY`, + * `XDG_ACTIVATION_TOKEN` and `DESKTOP_STARTUP_ID` environment + * variables are also set, based on information provided in @context. * * Returns: %TRUE on successful launch, %FALSE otherwise. */ @@ -12294,10 +12332,18 @@ * @files: (element-type GFile): a #GList of of #GFile objects * * Initiates startup notification for the application and returns the - * `DESKTOP_STARTUP_ID` for the launched operation, if supported. + * `XDG_ACTIVATION_TOKEN` or `DESKTOP_STARTUP_ID` for the launched operation, + * if supported. * - * Startup notification IDs are defined in the - * FreeDesktop.Org Startup Notifications standard(http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt). + * The returned token may be referred to equivalently as an ‘activation token’ + * (using Wayland terminology) or a ‘startup sequence ID’ (using X11 terminology). + * The two are interoperable(https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/xdg-activation/x11-interoperation.rst). + * + * Activation tokens are defined in the XDG Activation Protocol(https://wayland.app/protocols/xdg-activation-v1), + * and startup notification IDs are defined in the + * freedesktop.org Startup Notification Protocol(http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt). + * + * Support for the XDG Activation Protocol was added in GLib 2.76. * * Returns: (nullable): a startup notification ID for the application, or %NULL if * not supported. @@ -12415,6 +12461,8 @@ * inspected and modified. If %G_APPLICATION_HANDLES_COMMAND_LINE is * set, then the resulting dictionary is sent to the primary instance, * where g_application_command_line_get_options_dict() will return it. + * As it has been passed outside the process at this point, the types of all + * values in the options dict must be checked before being used. * This "packing" is done according to the type of the argument -- * booleans for normal flags, strings for strings, bytestrings for * filenames, etc. The packing only occurs if the flag is given (ie: we @@ -12621,7 +12669,7 @@ * g_application_command_line_get_options_dict: * @cmdline: a #GApplicationCommandLine * - * Gets the options there were passed to g_application_command_line(). + * Gets the options that were passed to g_application_command_line(). * * If you did not override local_command_line() then these are the same * options that were parsed according to the #GOptionEntrys added to the @@ -12631,6 +12679,9 @@ * If no options were sent then an empty dictionary is returned so that * you don't need to check for %NULL. * + * The data has been passed via an untrusted external process, so the types of + * all values must be checked before being used. + * * Returns: (transfer none): a #GVariantDict with the options * Since: 2.40 */ @@ -12647,9 +12698,12 @@ * information like the current working directory and the startup * notification ID. * + * It comes from an untrusted external process and hence the types of all + * values must be validated before being used. + * * For local invocation, it will be %NULL. * - * Returns: (nullable): the platform data, or %NULL + * Returns: (nullable) (transfer full): the platform data, or %NULL * Since: 2.28 */ @@ -14837,12 +14891,14 @@ * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer * containing the data to convert. * @inbuf_size: the number of bytes in @inbuf - * @outbuf: (element-type guint8) (array length=outbuf_size): a buffer to write - * converted data in. + * @outbuf: (element-type guint8) (array length=outbuf_size) (not nullable): a + * buffer to write converted data in. * @outbuf_size: the number of bytes in @outbuf, must be at least one * @flags: a #GConverterFlags controlling the conversion details - * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success - * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success + * @bytes_read: (out) (not nullable): will be set to the number of bytes read + * from @inbuf on success + * @bytes_written: (out) (not nullable): will be set to the number of bytes + * written to @outbuf on success * @error: location to store the error occurring, or %NULL to ignore * * This is the main operation used when converting data. It is to be called @@ -16582,6 +16638,10 @@ * constraint is violated, the export will fail and 0 will be * returned (with @error set accordingly). * + * Exporting menus with sections containing more than + * %G_MENU_EXPORTER_MAX_SECTION_SIZE items is not supported and results in + * undefined behavior. + * * You can unexport the menu model using * g_dbus_connection_unexport_menu_model() with the return value of * this function. @@ -17278,7 +17338,7 @@ * @user_data_free_func: (nullable): function to free @user_data with when * subscription is removed or %NULL * - * Subscribes to signals on @connection and invokes @callback with a whenever + * Subscribes to signals on @connection and invokes @callback whenever * the signal is received. Note that @callback will be invoked in the * thread-default main contextg-main-context-push-thread-default * of the thread you are calling this method from. @@ -20819,11 +20879,11 @@ * @uris: (element-type utf8): List of URIs * @launch_context: (nullable): a #GAppLaunchContext * @spawn_flags: #GSpawnFlags, used for each process - * @user_setup: (scope async) (nullable): a #GSpawnChildSetupFunc, used once + * @user_setup: (scope async) (nullable) (closure user_setup_data): a #GSpawnChildSetupFunc, used once * for each process. - * @user_setup_data: (closure user_setup) (nullable): User data for @user_setup - * @pid_callback: (scope call) (nullable): Callback for child processes - * @pid_callback_data: (closure pid_callback) (nullable): User data for @callback + * @user_setup_data: User data for @user_setup + * @pid_callback: (scope call) (nullable) (closure pid_callback_data): Callback for child processes + * @pid_callback_data: User data for @callback * @stdin_fd: file descriptor to use for child's stdin, or -1 * @stdout_fd: file descriptor to use for child's stdout, or -1 * @stderr_fd: file descriptor to use for child's stderr, or -1 @@ -22229,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. @@ -22367,9 +22427,9 @@ * @flags: set of #GFileCopyFlags * @cancellable: (nullable): optional #GCancellable object, * %NULL to ignore - * @progress_callback: (nullable) (scope call): function to callback with + * @progress_callback: (nullable) (scope call) (closure progress_callback_data): function to callback with * progress information, or %NULL if progress information is not needed - * @progress_callback_data: (closure): user data to pass to @progress_callback + * @progress_callback_data: user data to pass to @progress_callback * @error: #GError to set on error, or %NULL * * Copies the file @source to the location specified by @destination. @@ -23500,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(). @@ -23517,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. * @@ -23690,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. */ @@ -23702,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(). @@ -23719,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 @@ -23733,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. */ @@ -23743,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. */ @@ -23754,6 +23825,9 @@ * Gets the entity taggfile-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. */ @@ -23765,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. */ @@ -23775,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. */ @@ -23785,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. */ @@ -23795,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. */ @@ -23805,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. */ @@ -23816,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(). @@ -23836,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. */ @@ -23847,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. */ @@ -23859,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). */ @@ -23870,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. */ @@ -23880,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 */ @@ -23891,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. */ @@ -25051,9 +25160,9 @@ * @flags: set of #GFileCopyFlags * @cancellable: (nullable): optional #GCancellable object, * %NULL to ignore - * @progress_callback: (nullable) (scope call): #GFileProgressCallback + * @progress_callback: (nullable) (scope call) (closure progress_callback_data): #GFileProgressCallback * function for updates - * @progress_callback_data: (closure): gpointer to user data for + * @progress_callback_data: gpointer to user data for * the callback function * @error: #GError for returning error conditions, or %NULL * @@ -26831,7 +26940,7 @@ /** - * g_icon_equal: + * g_icon_equal: (virtual equal) * @icon1: (nullable): pointer to the first #GIcon. * @icon2: (nullable): pointer to the second #GIcon. * @@ -26843,7 +26952,7 @@ /** * g_icon_hash: (virtual hash) - * @icon: (not nullable): #gconstpointer to an icon object. + * @icon: (not nullable) (type Gio.Icon): #gconstpointer to an icon object. * * Gets a hash for an icon. * @@ -26871,7 +26980,7 @@ /** - * g_icon_serialize: + * g_icon_serialize: (virtual serialize) * @icon: a #GIcon * * Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved @@ -26886,7 +26995,7 @@ /** - * g_icon_to_string: (virtual to_tokens) + * g_icon_to_string: * @icon: a #GIcon. * * Generates a textual representation of @icon that can be used for @@ -28657,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. * @@ -28666,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 @@ -28675,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. @@ -28683,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 @@ -31222,7 +31339,7 @@ * application-wide action (start with "app."). * * If @target is non-%NULL, @action will be activated with @target as - * its parameter. + * its parameter. If @target is floating, it will be consumed. * * When no default action is set, the application that the notification * was sent on is activated. @@ -32760,7 +32877,7 @@ * * Looks into the system proxy configuration to determine what proxy, * if any, to use to connect to @uri. The returned proxy URIs are of - * the form `<protocol>://user:password@host:port` or + * the form `<protocol>://user:password@host:port` or * `direct://`, where <protocol> could be http, rtsp, socks * or other proxying protocol. * @@ -37015,7 +37132,7 @@ * If there is no implementation for this kind of control message, %NULL * will be returned. * - * Returns: (transfer full): the deserialized message or %NULL + * Returns: (nullable) (transfer full): the deserialized message or %NULL * Since: 2.22 */ @@ -39069,7 +39186,7 @@ /** * g_subprocess_launcher_set_child_setup: (skip) * @self: a #GSubprocessLauncher - * @child_setup: a #GSpawnChildSetupFunc to use as the child setup function + * @child_setup: (closure user_data): a #GSpawnChildSetupFunc to use as the child setup function * @user_data: user data for @child_setup * @destroy_notify: a #GDestroyNotify for @user_data * @@ -39548,7 +39665,8 @@ * callback to @callback, with @task as the callback's `user_data`. * * It will set the @source’s name to the task’s name (as set with - * g_task_set_name()), if one has been set. + * g_task_set_name()), if one has been set on the task and the source doesn’t + * yet have a name. * * This takes a reference on @task until @source is destroyed. * @@ -39562,7 +39680,7 @@ * * Gets @task's #GCancellable * - * Returns: (transfer none): @task's #GCancellable + * Returns: (nullable) (transfer none): @task's #GCancellable * Since: 2.36 */ @@ -40160,6 +40278,19 @@ */ +/** + * g_task_set_static_name: + * @task: a #GTask + * @name: (nullable): a human readable name for the task. Must be a string literal + * + * Sets @task’s name, used in debugging and profiling. + * + * This is a variant of g_task_set_name() that avoids copying @name. + * + * Since: 2.76 + */ + + /** * g_task_set_task_data: * @task: the #GTask
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/gir/glib-2.0.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/gir/glib-2.0.c
Changed
@@ -682,7 +682,7 @@ /** * GHookCheckMarshaller: * @hook: a #GHook - * @user_data: user data + * @marshal_data: user data * * Defines the type of function used by g_hook_list_marshal_check(). * @@ -715,7 +715,7 @@ /** * GHookFindFunc: * @hook: a #GHook - * @user_data: user data passed to g_hook_find_func() + * @data: user data passed to g_hook_find_func() * * Defines the type of the function passed to g_hook_find(). * @@ -761,7 +761,7 @@ /** * GHookMarshaller: * @hook: a #GHook - * @user_data: user data + * @marshal_data: user data * * Defines the type of function used by g_hook_list_marshal(). */ @@ -1026,7 +1026,7 @@ * GIOFunc: * @source: the #GIOChannel event source * @condition: the condition which has been satisfied - * @user_data: user data set in g_io_add_watch() or g_io_add_watch_full() + * @data: user data set in g_io_add_watch() or g_io_add_watch_full() * * Specifies the type of function passed to g_io_add_watch() or * g_io_add_watch_full(), which is called when the requested condition @@ -1387,7 +1387,7 @@ /** * GNodeForeachFunc: * @node: a #GNode. - * @user_data: user data passed to g_node_children_foreach(). + * @data: user data passed to g_node_children_foreach(). * * Specifies the type of function passed to g_node_children_foreach(). * The function is called with each child node, together with the user @@ -1398,7 +1398,7 @@ /** * GNodeTraverseFunc: * @node: a #GNode. - * @user_data: user data passed to g_node_traverse(). + * @data: user data passed to g_node_traverse(). * * Specifies the type of function passed to g_node_traverse(). The * function is called with each of the nodes visited, together with the @@ -1858,7 +1858,7 @@ * GSequenceIterCompareFunc: * @a: a #GSequenceIter * @b: a #GSequenceIter - * @user_data: user data + * @data: user data * * A #GSequenceIterCompareFunc is a function used to compare iterators. * It must return zero if the iterators compare equal, a negative value @@ -2051,7 +2051,7 @@ /** * GThreadFunc: - * @user_data: data passed to the thread + * @data: data passed to the thread * * Specifies the type of the @func functions passed to g_thread_new() * or g_thread_try_new(). @@ -2224,7 +2224,7 @@ * GTraverseFunc: * @key: a key of a #GTree node * @value: the value corresponding to the key - * @user_data: user data passed to g_tree_traverse() + * @data: user data passed to g_tree_traverse() * * Specifies the type of function passed to g_tree_traverse(). It is * passed the key and value of each node, together with the @user_data @@ -2943,6 +2943,89 @@ /** + * G_CXX_STD_CHECK_VERSION: + * @version: The C++ version to be checked for compatibility + * + * Macro to check if the current compiler supports a specified @version + * of the C++ standard. Such value must be numeric and can be provided both + * in the short form for the well-known versions (e.g. `11`, `17`...) or in + * the complete form otherwise (e.g. `201103L`, `201703L`, `205503L`...). + * + * When a C compiler is used, the macro is defined and returns always %FALSE. + * + * This value is compared against %G_CXX_STD_VERSION. + * + * |<!-- language="C" --> + * #if G_CXX_STD_CHECK_VERSION(20) + * #endif + * | + * + * See also: %G_C_STD_CHECK_VERSION + * + * Returns: %TRUE if @version is supported by the compiler, %FALSE otherwise + * Since: 2.76 + */ + + +/** + * G_CXX_STD_VERSION: + * + * The C++ standard version the code is compiling against, it's defined + * with the same value of `__cplusplus` for C++ standard compatible + * compilers, while it uses `_MSVC_LANG` in MSVC, given that the + * standard definition depends on a compilation flag in such compiler. + * + * This is granted to be undefined when not compiling with a C++ compiler. + * + * See also: %G_CXX_STD_CHECK_VERSION and %G_C_STD_VERSION + * + * Since: 2.76 + */ + + +/** + * G_C_STD_CHECK_VERSION: + * @version: The C version to be checked for compatibility + * + * Macro to check if the current compiler supports a specified @version + * of the C standard. Such value must be numeric and can be provided both + * in the short form for the well-known versions (e.g. `90`, `99`...) or in + * the complete form otherwise (e.g. `199000L`, `199901L`, `205503L`...). + * + * When a C++ compiler is used, the macro is defined and returns always %FALSE. + * + * This value is compared against %G_C_STD_VERSION. + * + * |<!-- language="C" --> + * #if G_C_STD_CHECK_VERSION(17) + * #endif + * | + * + * See also: %G_CXX_STD_CHECK_VERSION + * + * Returns: %TRUE if @version is supported by the compiler, %FALSE otherwise + * Since: 2.76 + */ + + +/** + * G_C_STD_VERSION: + * + * The C standard version the code is compiling against, it's normally + * defined with the same value of `__STDC_VERSION__` for C standard + * compatible compilers, while it uses the lowest standard version + * in pure MSVC, given that in such compiler the definition depends on + * a compilation flag. + * + * This is granted to be undefined when compiling with a C++ compiler. + * + * See also: %G_C_STD_CHECK_VERSION and %G_CXX_STD_VERSION + * + * Since: 2.76 + */ + + +/** * G_DATE_BAD_DAY: * * Represents an invalid #GDateDay. @@ -3068,7 +3151,7 @@ * meant to be portable across different compilers and must be placed * before the function declaration. * - * |<!-- language="C" -- + * |<!-- language="C" --> * G_DEPRECATED * int my_mistake (void); * | @@ -3086,7 +3169,7 @@ * is meant to be portable across different compilers and must be placed * before the function declaration. * - * |<!-- language="C" -- + * |<!-- language="C" --> * G_DEPRECATED_FOR(my_replacement) * int my_mistake (void); * | @@ -3150,6 +3233,10 @@ * sscanf ("42", "%" G_GINT16_FORMAT, &in) * out = in * 1000; * g_print ("%" G_GINT32_FORMAT, out); + * + * This is not necessarily the correct format for printing and scanning + * `int16_t` values, even though the in-memory representation is the same. + * Standard C macros like `PRId16` and `SCNd16` should be used for `int16_t`. * | */ @@ -3169,6 +3256,10 @@ * g_print ("%#" G_GINT16_MODIFIER "x", value); * | * + * This is not necessarily the correct modifier for printing and scanning + * `int16_t` values, even though the in-memory representation is the same. + * Standard C macros like `PRId16` and `SCNd16` should be used for `int16_t`. + * * Since: 2.4 */ @@ -3178,6 +3269,10 @@ * * This is the platform dependent conversion specifier for scanning * and printing values of type #gint32. See also %G_GINT16_FORMAT. + * + * This is not necessarily the correct modifier for printing and scanning + * `int32_t` values, even though the in-memory representation is the same. + * Standard C macros like `PRId32` and `SCNd32` should be used for `int32_t`. */ @@ -3188,6 +3283,10 @@ * for scanning and printing values of type #gint32 or #guint32. It * is a string literal. See also %G_GINT16_MODIFIER. * + * This is not necessarily the correct modifier for printing and scanning + * `int32_t` values, even though the in-memory representation is the same. + * Standard C macros like `PRId32` and `SCNd32` should be used for `int32_t`. + * * Since: 2.4 */ @@ -3198,6 +3297,9 @@ * * This macro is used to insert 64-bit integer literals * into the source code. + * + * It is similar to the standard C `INT64_C` macro, + * which should be preferred in new code. */ @@ -3213,6 +3315,10 @@ * if %G_GINT64_FORMAT is defined. Due to its weak error handling, scanf() * is not recommended for parsing anyway; consider using g_ascii_strtoull() * instead. + * + * This is not necessarily the correct format for printing and scanning + * `int64_t` values, even though the in-memory representation is the same. + * Standard C macros like `PRId64` and `SCNd64` should be used for `int64_t`. */ @@ -3227,6 +3333,10 @@ * though the types are supported. On such platforms %G_GINT64_MODIFIER * is not defined. * + * This is not necessarily the correct modifier for printing and scanning + * `int64_t` values, even though the in-memory representation is the same. + * Standard C macros like `PRId64` and `SCNd64` should be used for `int64_t`. + * * Since: 2.4 */ @@ -3237,6 +3347,12 @@ * This is the platform dependent conversion specifier for scanning * and printing values of type #gintptr. * + * Note that this is not necessarily the correct format to scan or + * print an `intptr_t`, even though the in-memory representation is the + * same. + * Standard C macros like `PRIdPTR` and `SCNdPTR` should be used for + * `intptr_t`. + * * Since: 2.22 */ @@ -3248,6 +3364,12 @@ * for scanning and printing values of type #gintptr or #guintptr. * It is a string literal. * + * Note that this is not necessarily the correct modifier to scan or + * print an `intptr_t`, even though the in-memory representation is the + * same. + * Standard C macros like `PRIdPTR` and `SCNdPTR` should be used for + * `intptr_t`. + * * Since: 2.22 */ @@ -3305,7 +3427,7 @@ * G_GNUC_END_IGNORE_DEPRECATIONS * | * - * |<!-- language="C" -- + * |<!-- language="C" --> * static void * test_deprecated_function (void) * { @@ -3408,6 +3530,9 @@ * This is the platform dependent conversion specifier for scanning * and printing values of type #goffset. See also %G_GINT64_FORMAT. * + * This format should only be used with #goffset values, and not + * with `off_t`, which is not necessarily the same type or even the same size. + * * Since: 2.20 */ @@ -3419,6 +3544,9 @@ * for scanning and printing values of type #goffset. It is a string * literal. See also %G_GINT64_MODIFIER. * + * This modifier should only be used with #goffset values, and not + * with `off_t`, which is not necessarily the same type or even the same size. + * * Since: 2.20 */ @@ -3429,6 +3557,11 @@ * This is the platform dependent conversion specifier for scanning * and printing values of type #gsize. See also %G_GINT16_FORMAT. * + * Note that this is not necessarily the correct format to scan or + * print a `size_t`, even though the in-memory representation is the + * same. The standard C `"zu"` format should be used for `size_t`, + * assuming a C99-compliant `printf` implementation is available. + * * Since: 2.6 */ @@ -3440,6 +3573,11 @@ * for scanning and printing values of type #gsize. It * is a string literal. * + * Note that this is not necessarily the correct modifier to scan or + * print a `size_t`, even though the in-memory representation is the + * same. The Standard C `"z"` modifier should be used for `size_t`, + * assuming a C99-compliant `printf` implementation is available. + * * Since: 2.6 */ @@ -3450,6 +3588,11 @@ * This is the platform dependent conversion specifier for scanning * and printing values of type #gssize. See also %G_GINT16_FORMAT. * + * Note that this is not necessarily the correct format to scan or print + * a POSIX `ssize_t` or a Windows `SSIZE_T`, even though the in-memory + * representation is the same. + * On POSIX platforms, the `"zd"` format should be used for `ssize_t`. + * * Since: 2.6 */ @@ -3461,6 +3604,11 @@ * for scanning and printing values of type #gssize. It * is a string literal. * + * Note that this is not necessarily the correct modifier to scan or print + * a POSIX `ssize_t` or a Windows `SSIZE_T`, even though the in-memory + * representation is the same. + * On POSIX platforms, the `"z"` modifier should be used for `ssize_t`. + * * Since: 2.6 */ @@ -3470,6 +3618,10 @@ * * This is the platform dependent conversion specifier for scanning * and printing values of type #guint16. See also %G_GINT16_FORMAT + * + * This is not necessarily the correct modifier for printing and scanning + * `uint16_t` values, even though the in-memory representation is the same. + * Standard C macros like `PRIu16` and `SCNu16` should be used for `uint16_t`. */ @@ -3478,6 +3630,10 @@ * * This is the platform dependent conversion specifier for scanning * and printing values of type #guint32. See also %G_GINT16_FORMAT. + * + * This is not necessarily the correct modifier for printing and scanning + * `uint32_t` values, even though the in-memory representation is the same. + * Standard C macros like `PRIu32` and `SCNu32` should be used for `uint32_t`. */ @@ -3488,6 +3644,9 @@ * This macro is used to insert 64-bit unsigned integer * literals into the source code. * + * It is similar to the standard C `UINT64_C` macro, + * which should be preferred in new code. + * * Since: 2.10 */ @@ -3504,6 +3663,10 @@ * if %G_GINT64_FORMAT is defined. Due to its weak error handling, scanf() * is not recommended for parsing anyway; consider using g_ascii_strtoull() * instead. + * + * This is not necessarily the correct modifier for printing and scanning + * `uint64_t` values, even though the in-memory representation is the same. + * Standard C macros like `PRIu64` and `SCNu64` should be used for `uint64_t`. */ @@ -3513,6 +3676,12 @@ * This is the platform dependent conversion specifier * for scanning and printing values of type #guintptr. * + * Note that this is not necessarily the correct format to scan or + * print a `uintptr_t`, even though the in-memory representation is the + * same. + * Standard C macros like `PRIuPTR` and `SCNuPTR` should be used for + * `uintptr_t`. + * * Since: 2.22 */ @@ -4065,6 +4234,9 @@ * G_MAXDOUBLE: * * The maximum value which can be held in a #gdouble. + * + * This is the same as standard C `DBL_MAX`, which is available since C99 + * and should be preferred in new code. */ @@ -4072,6 +4244,9 @@ * G_MAXFLOAT: * * The maximum value which can be held in a #gfloat. + * + * This is the same as standard C `FLT_MAX`, which is available since C99 + * and should be preferred in new code. */ @@ -4079,6 +4254,9 @@ * G_MAXINT: * * The maximum value which can be held in a #gint. + * + * This is the same as standard C `INT_MAX`, which is available since C99 + * and should be preferred in new code. */ @@ -4087,6 +4265,9 @@ * * The maximum value which can be held in a #gint16. * + * This is the same as standard C `INT16_MAX`, which should be + * preferred in new code. + * * Since: 2.4 */ @@ -4096,6 +4277,9 @@ * * The maximum value which can be held in a #gint32. * + * This is the same as standard C `INT32_MAX`, which should be + * preferred in new code. + * * Since: 2.4 */ @@ -4112,6 +4296,9 @@ * * The maximum value which can be held in a #gint8. * + * This is the same as standard C `INT8_MAX`, which should be + * preferred in new code. + * * Since: 2.4 */ @@ -4120,6 +4307,9 @@ * G_MAXLONG: * * The maximum value which can be held in a #glong. + * + * This is the same as standard C `ULONG_MAX`, which is available since C99 + * and should be preferred in new code. */ @@ -4134,6 +4324,9 @@ * G_MAXSHORT: * * The maximum value which can be held in a #gshort. + * + * This is the same as standard C `SHRT_MAX`, which is available since C99 + * and should be preferred in new code. */ @@ -4142,6 +4335,9 @@ * * The maximum value which can be held in a #gsize. * + * This is the same as standard C `SIZE_MAX` (available since C99), + * which should be preferred in new code. + * * Since: 2.4 */ @@ -4159,6 +4355,9 @@ * G_MAXUINT: * * The maximum value which can be held in a #guint. + * + * This is the same as standard C `UINT_MAX`, which is available since C99 + * and should be preferred in new code. */ @@ -4167,6 +4366,9 @@ * * The maximum value which can be held in a #guint16. * + * This is the same as standard C `UINT16_MAX`, which should be + * preferred in new code. + * * Since: 2.4 */ @@ -4176,6 +4378,9 @@ * * The maximum value which can be held in a #guint32. * + * This is the same as standard C `UINT32_MAX`, which should be + * preferred in new code. + * * Since: 2.4 */ @@ -4184,6 +4389,9 @@ * G_MAXUINT64: * * The maximum value which can be held in a #guint64. + * + * This is the same as standard C `UINT64_MAX`, which should be + * preferred in new code. */ @@ -4192,6 +4400,9 @@ * * The maximum value which can be held in a #guint8. * + * This is the same as standard C `UINT8_MAX`, which should be + * preferred in new code. + * * Since: 2.4 */ @@ -4200,6 +4411,9 @@ * G_MAXULONG: * * The maximum value which can be held in a #gulong. + * + * This is the same as standard C `ULONG_MAX`, which is available since C99 + * and should be preferred in new code. */ @@ -4207,6 +4421,9 @@ * G_MAXUSHORT: * * The maximum value which can be held in a #gushort. + * + * This is the same as standard C `USHRT_MAX`, which is available since C99 + * and should be preferred in new code. */ @@ -4217,6 +4434,9 @@ * * If you are interested in the smallest value which can be held * in a #gdouble, use -%G_MAXDOUBLE. + * + * This is the same as standard C `DBL_MIN`, which is available since C99 + * and should be preferred in new code. */ @@ -4227,6 +4447,9 @@ * * If you are interested in the smallest value which can be held * in a #gfloat, use -%G_MAXFLOAT. + * + * This is the same as standard C `FLT_MIN`, which is available since C99 + * and should be preferred in new code. */ @@ -4234,6 +4457,9 @@ * G_MININT: * * The minimum value which can be held in a #gint. + * + * This is the same as standard C `INT_MIN`, which is available since C99 + * and should be preferred in new code. */ @@ -4241,6 +4467,9 @@ * G_MINLONG: * * The minimum value which can be held in a #glong. + * + * This is the same as standard C `LONG_MIN`, which is available since C99 + * and should be preferred in new code. */ @@ -4255,6 +4484,9 @@ * G_MINSHORT: * * The minimum value which can be held in a #gshort. + * + * This is the same as standard C `SHRT_MIN`, which is available since C99 + * and should be preferred in new code. */ @@ -4296,6 +4528,19 @@ * * This macro is defined only on UNIX. So you can bracket * UNIX-specific code in "\#ifdef G_OS_UNIX". + * + * To detect whether to compile features that require a specific kernel + * or operating system, check for the appropriate OS-specific predefined + * macros instead, for example: + * + * - Linux kernel (any libc, including glibc, musl or Android): `\#ifdef __linux__` + * - Linux kernel and GNU user-space: `\#if defined(__linux__) && defined(__GLIBC__)` + * - FreeBSD kernel (any libc, including glibc): `\#ifdef __FreeBSD_kernel__` + * - FreeBSD kernel and user-space: `\#ifdef __FreeBSD__` + * - Apple operating systems (macOS, iOS, tvOS), regardless of whether + * Cocoa/Carbon toolkits are available: `\#ifdef __APPLE__` + * + * See <https://sourceforge.net/p/predef/wiki/OperatingSystems/> for more. */ @@ -4576,7 +4821,12 @@ * * Returns the offset, in bytes, of a member of a struct. * - * Returns: the offset of @member from the start of @struct_type + * Consider using standard C `offsetof()`, available since at least C89 + * and C++98, in new code (but note that `offsetof()` returns a `size_t` + * rather than a `long`). + * + * Returns: the offset of @member from the start of @struct_type, + * as a value of type #glong. */ @@ -4674,6 +4924,9 @@ * * Each invocation of `G_VA_COPY (ap1, ap2)` must be matched with a * corresponding `va_end (ap1)` call in the same function. + * + * This is equivalent to standard C `va_copy()`, available since C99 + * and C++11, which should be preferred in new code. */ @@ -6150,6 +6403,46 @@ /** + * SECTION:gpathbuf + * @Title: GPathBuf + * @Short_description: A mutable path builder + * + * `GPathBuf` is a helper type that allows you to easily build paths from + * individual elements, using the platform specific conventions for path + * separators. + * + * |<!-- language="C" --> + * g_auto (GPathBuf) path; + * + * g_path_buf_init (&path); + * + * g_path_buf_push (&path, "usr"); + * g_path_buf_push (&path, "bin"); + * g_path_buf_push (&path, "echo"); + * + * g_autofree char *echo = g_path_buf_to_path (&path); + * g_assert_cmpstr (echo, ==, "/usr/bin/echo"); + * | + * + * You can also load a full path and then operate on its components: + * + * |<!-- language="C" --> + * g_auto (GPathBuf) path; + * + * g_path_buf_init_from_path (&path, "/usr/bin/echo"); + * + * g_path_buf_pop (&path); + * g_path_buf_push (&path, "sh"); + * + * g_autofree char *sh = g_path_buf_to_path (&path); + * g_assert_cmpstr (sh, ==, "/usr/bin/sh"); + * | + * + * `GPathBuf` is available since GLib 2.76. + */ + + +/** * SECTION:gregex * @title: Perl-compatible regular expressions * @short_description: matches strings against regular expressions @@ -6199,18 +6492,6 @@ * unescaped "#" outside a character class is encountered. This indicates * a comment that lasts until after the next newline. * - * When setting the %G_REGEX_JAVASCRIPT_COMPAT flag, pattern syntax and pattern - * matching is changed to be compatible with the way that regular expressions - * work in JavaScript. More precisely, a lonely '' character in the pattern - * is a syntax error; the '\x' escape only allows 0 to 2 hexadecimal digits, and - * you must use the '\u' escape sequence with 4 hex digits to specify a unicode - * codepoint instead of '\x' or 'x{....}'. If '\x' or '\u' are not followed by - * the specified number of hex digits, they match 'x' and 'u' literally; also - * '\U' always matches 'U' instead of being an error in the pattern. Finally, - * pattern matching is modified so that back references to an unset subpattern - * group produces a match with the empty string instead of an error. See - * pcreapi(3) for more information. - * * Creating and manipulating the same #GRegex structure from different * threads is not a problem as #GRegex does not modify its internal * state between creation and destruction, on the other hand #GMatchInfo @@ -7484,37 +7765,18 @@ * @short_description: efficient way to allocate groups of equal-sized * chunks of memory * - * Memory slices provide a space-efficient and multi-processing scalable - * way to allocate equal-sized pieces of memory, just like the original - * #GMemChunks (from GLib 2.8), while avoiding their excessive - * memory-waste, scalability and performance problems. - * - * To achieve these goals, the slice allocator uses a sophisticated, - * layered design that has been inspired by Bonwick's slab allocator - * (Bonwick94(http://citeseer.ist.psu.edu/bonwick94slab.html) - * Jeff Bonwick, The slab allocator: An object-caching kernel - * memory allocator. USENIX 1994, and - * Bonwick01(http://citeseer.ist.psu.edu/bonwick01magazines.html) - * Bonwick and Jonathan Adams, Magazines and vmem: Extending the - * slab allocator to many cpu's and arbitrary resources. USENIX 2001) - * - * It uses posix_memalign() to optimize allocations of many equally-sized - * chunks, and has per-thread free lists (the so-called magazine layer) - * to quickly satisfy allocation requests of already known structure sizes. - * This is accompanied by extra caching logic to keep freed memory around - * for some time before returning it to the system. Memory that is unused - * due to alignment constraints is used for cache colorization (random - * distribution of chunk addresses) to improve CPU cache utilization. The - * caching layer of the slice allocator adapts itself to high lock contention - * to improve scalability. - * - * The slice allocator can allocate blocks as small as two pointers, and - * unlike malloc(), it does not reserve extra space per block. For large block - * sizes, g_slice_new() and g_slice_alloc() will automatically delegate to the - * system malloc() implementation. For newly written code it is recommended - * to use the new `g_slice` API instead of g_malloc() and - * friends, as long as objects are not resized during their lifetime and the - * object size used at allocation time is still available when freeing. + * GSlice was a space-efficient and multi-processing scalable way to allocate + * equal sized pieces of memory. Since GLib 2.76, its implementation has been + * removed and it calls g_malloc() and g_free_sized(), because the performance + * of the system-default allocators has improved on all platforms since GSlice + * was written. + * + * The GSlice APIs have not been deprecated, as they are widely in use and doing + * so would be very disruptive for little benefit. + * + * New code should be written using g_new()/g_malloc() and g_free_sized() or + * g_free(). There is no particular benefit in porting existing code away from + * g_slice_new()/g_slice_free() unless it’s being rewritten anyway. * * Here is an example for using the slice allocator: * |<!-- language="C" --> @@ -9133,11 +9395,18 @@ * } * | * - * g_print(), g_printerr() and g_set_print_handler() are intended to be used for + * g_print() and g_printerr() are intended to be used for * output from command line applications, since they output to standard output * and standard error by default — whereas functions like g_message() and * g_log() may be redirected to special purpose message windows, files, or the * system journal. + * + * If the console encoding is not UTF-8 (as specified by g_get_console_charset()) + * then these functions convert the message first. Any Unicode + * characters not defined by that charset are replaced by `'?'`. On Linux, + * setlocale() must be called early in main() to load the encoding. This behaviour + * can be changed by providing custom handlers to g_set_print_handler(), + * g_set_printerr_handler() and g_log_set_handler(). */ @@ -9237,7 +9506,7 @@ * the program is terminated. * * Aligned memory allocations returned by this function can only be - * freed using g_aligned_free(). + * freed using g_aligned_free_sized() or g_aligned_free(). * * Returns: (transfer full): the allocated memory * Since: 2.72 @@ -9270,6 +9539,26 @@ /** + * g_aligned_free_sized: + * @mem: (nullable): the memory to free + * @alignment: alignment of @mem + * @size: size of @mem, in bytes + * + * Frees the memory pointed to by @mem, assuming it is has the given @size and + * @alignment. + * + * If @mem is %NULL this is a no-op (and @size is ignored). + * + * It is an error if @size doesn’t match the size, or @alignment doesn’t match + * the alignment, passed when @mem was allocated. @size and @alignment are + * passed to this function to allow optimizations in the allocator. If you + * don’t know either of them, use g_aligned_free() instead. + * + * Since: 2.76 + */ + + +/** * g_array_append_val: * @a: a #GArray * @v: the value to append to the #GArray @@ -9317,7 +9606,7 @@ * * This example defines a comparison function and search an element in a #GArray: * |<!-- language="C" --> - * static gint* + * static gint * cmpint (gconstpointer a, gconstpointer b) * { * const gint *_a = a; @@ -9477,6 +9766,65 @@ /** + * g_array_new_take: (skip) + * @data: (array length=len) (transfer full) (nullable): an array of + * elements of @element_size, or %NULL for an empty array + * @len: the number of elements in @data + * @clear: %TRUE if #GArray elements should be automatically cleared + * to 0 when they are allocated + * @element_size: the size of each element in bytes + * + * Creates a new #GArray with @data as array data, @len as length and a + * reference count of 1. + * + * This avoids having to copy the data manually, when it can just be + * inherited. @data will eventually be freed using g_free(), so must + * have been allocated with a suitable allocator. + * + * In case the elements need to be cleared when the array is freed, use + * g_array_set_clear_func() to set a #GDestroyNotify function to perform + * such task. + * + * Do not use it if @len or @element_size are greater than %G_MAXUINT. + * #GArray stores the length of its data in #guint, which may be shorter + * than #gsize. + * + * Returns: (transfer full): A new #GArray + * Since: 2.76 + */ + + +/** + * g_array_new_take_zero_terminated: (skip) + * @data: (array zero-terminated=1): an array of elements of @element_size + * @clear: %TRUE if #GArray elements should be automatically cleared + * to 0 when they are allocated + * @element_size: the size of each element in bytes + * + * Creates a new #GArray with @data as array data, computing the length of it + * and setting the reference count to 1. + * + * This avoids having to copy the data manually, when it can just be + * inherited. @data will eventually be freed using g_free(), so must + * have been allocated with a suitable allocator. + * + * The length is calculated by iterating through @data until the first %NULL + * element is found. + * + * In case the elements need to be cleared when the array is freed, use + * g_array_set_clear_func() to set a #GDestroyNotify function to perform + * such task. + * + * Do not use it if @data length or @element_size are greater than %G_MAXUINT. + * #GArray stores the length of its data in #guint, which may be shorter + * than #gsize. + * + * Returns: (transfer full): A new #GArray + * Since: 2.76 + */ + + +/** * g_array_prepend_val: * @a: a #GArray * @v: the value to prepend to the #GArray @@ -10717,16 +11065,18 @@ /** * g_async_queue_push: * @queue: a #GAsyncQueue - * @data: @data to push into the @queue + * @data: (not nullable): data to push onto the @queue * - * Pushes the @data into the @queue. @data must not be %NULL. + * Pushes the @data into the @queue. + * + * The @data parameter must not be %NULL. */ /** * g_async_queue_push_front: * @queue: a #GAsyncQueue - * @item: data to push into the @queue + * @item: (not nullable): data to push into the @queue * * Pushes the @item into the @queue. @item must not be %NULL. * In contrast to g_async_queue_push(), this function @@ -10740,7 +11090,7 @@ /** * g_async_queue_push_front_unlocked: * @queue: a #GAsyncQueue - * @item: data to push into the @queue + * @item: (not nullable): data to push into the @queue * * Pushes the @item into the @queue. @item must not be %NULL. * In contrast to g_async_queue_push_unlocked(), this function @@ -10756,7 +11106,7 @@ /** * g_async_queue_push_sorted: * @queue: a #GAsyncQueue - * @data: the @data to push into the @queue + * @data: (not nullable): the @data to push into the @queue * @func: the #GCompareDataFunc is used to sort @queue * @user_data: user data passed to @func. * @@ -10778,7 +11128,7 @@ /** * g_async_queue_push_sorted_unlocked: * @queue: a #GAsyncQueue - * @data: the @data to push into the @queue + * @data: the data to push into the @queue * @func: the #GCompareDataFunc is used to sort @queue * @user_data: user data passed to @func. * @@ -10805,9 +11155,11 @@ /** * g_async_queue_push_unlocked: * @queue: a #GAsyncQueue - * @data: @data to push into the @queue + * @data: (not nullable): data to push onto the @queue + * + * Pushes the @data into the @queue. * - * Pushes the @data into the @queue. @data must not be %NULL. + * The @data parameter must not be %NULL. * * This function must be called while holding the @queue's lock. */ @@ -10839,7 +11191,7 @@ /** * g_async_queue_remove: * @queue: a #GAsyncQueue - * @item: the data to remove from the @queue + * @item: (not nullable): the data to remove from the @queue * * Remove an item from the queue. * @@ -10929,7 +11281,7 @@ * and g_time_val_add() can be used. * * Returns: (nullable): data from the queue or %NULL, when no data is - * received before @end_time. + * received before @end_time. * Deprecated: use g_async_queue_timeout_pop(). */ @@ -10950,7 +11302,7 @@ * This function must be called while holding the @queue's lock. * * Returns: (nullable): data from the queue or %NULL, when no data is - * received before @end_time. + * received before @end_time. * Deprecated: use g_async_queue_timeout_pop_unlocked(). */ @@ -10966,7 +11318,7 @@ * If no data is received before the timeout, %NULL is returned. * * Returns: (nullable): data from the queue or %NULL, when no data is - * received before the timeout. + * received before the timeout. */ @@ -10983,7 +11335,7 @@ * This function must be called while holding the @queue's lock. * * Returns: (nullable): data from the queue or %NULL, when no data is - * received before the timeout. + * received before the timeout. */ @@ -10995,7 +11347,7 @@ * %NULL is returned. * * Returns: (nullable): data from the queue or %NULL, when no data is - * available immediately. + * available immediately. */ @@ -11009,7 +11361,7 @@ * This function must be called while holding the @queue's lock. * * Returns: (nullable): data from the queue or %NULL, when no data is - * available immediately. + * available immediately. */ @@ -11761,6 +12113,60 @@ /** + * g_autofd: (skip) + * + * Macro to add an attribute to a file descriptor variable to ensure + * automatic cleanup using g_clear_fd(). + * + * This macro behaves like #g_autofree rather than g_autoptr(): it is + * an attribute supplied before the type name, rather than wrapping the + * type definition. + * + * Otherwise, this macro has similar constraints as g_autoptr(): it is + * only supported on GCC and clang, and the variable must be initialized + * (to either a valid file descriptor or a negative number). + * + * Using this macro is async-signal-safe if the constraints described above + * are met, so it can be used in a signal handler or after `fork()`. + * + * Any error from closing the file descriptor when it goes out of scope + * is ignored. Use g_clear_fd() if error-checking is required. + * + * | + * gboolean + * operate_on_fds (GError **error) + * { + * g_autofd int fd1 = open_a_fd (..., error); + * g_autofd int fd2 = -1; + * + * // it is safe to return early here, nothing will be closed + * if (fd1 < 0) + * return FALSE; + * + * fd2 = open_a_fd (..., error); + * + * // fd1 will be closed automatically if we return here + * if (fd2 < 0) + * return FALSE; + * + * // fd1 and fd2 will be closed automatically if we return here + * if (!do_something_useful (fd1, fd2, error)) + * return FALSE; + * + * // fd2 will be closed automatically if we return here + * if (!g_clear_fd (&fd1, error)) + * return FALSE; + * + * // fd2 will be automatically closed here if still open + * return TRUE; + * } + * | + * + * Since: 2.76 + */ + + +/** * g_autofree: * * Macro to add an attribute to pointer variable to ensure automatic @@ -12076,11 +12482,11 @@ * string. * * Returns: (type filename): the name of the file without any leading - * directory components + * directory components * Deprecated: 2.2: Use g_path_get_basename() instead, but notice - * that g_path_get_basename() allocates new memory for the - * returned string, unlike this function which returns a pointer - * into the argument. + * that g_path_get_basename() allocates new memory for the + * returned string, unlike this function which returns a pointer + * into the argument. */ @@ -12243,6 +12649,18 @@ /** + * g_bookmark_file_copy: + * @bookmark: A #GBookmarkFile + * + * Deeply copies a @bookmark #GBookmarkFile object to a new one. + * + * Returns: (transfer full): the copy of @bookmark. Use + * g_bookmark_free() when finished using it. + * Since: 2.76 + */ + + +/** * g_bookmark_file_free: * @bookmark: a #GBookmarkFile * @@ -13092,7 +13510,7 @@ * @...: remaining elements in path, terminated by %NULL * * Creates a filename from a series of elements using the correct - * separator for filenames. + * separator for the current platform. * * On Unix, this function behaves identically to `g_build_path * (G_DIR_SEPARATOR_S, first_element, ....)`. @@ -13107,8 +13525,10 @@ * path. If the first element is a relative path, the result will * be a relative path. * - * Returns: (type filename) (transfer full): a newly-allocated string that - * must be freed with g_free(). + * If you are building a path programmatically you may want to use + * #GPathBuf instead. + * + * Returns: (type filename) (transfer full): the newly allocated path */ @@ -13117,11 +13537,16 @@ * @first_element: (type filename): the first element in the path * @args: va_list of remaining elements in path * + * Creates a filename from a list of elements using the correct + * separator for the current platform. + * * Behaves exactly like g_build_filename(), but takes the path elements - * as a va_list. This function is mainly meant for language bindings. + * as a va_list. * - * Returns: (type filename) (transfer full): a newly-allocated string that - * must be freed with g_free(). + * This function is mainly meant for implementing other variadic arguments + * functions. + * + * Returns: (type filename) (transfer full): the newly allocated path * Since: 2.56 */ @@ -13129,14 +13554,19 @@ /** * g_build_filenamev: * @args: (array zero-terminated=1) (element-type filename): %NULL-terminated - * array of strings containing the path elements. + * array of strings containing the path elements. * - * Behaves exactly like g_build_filename(), but takes the path elements - * as a string array, instead of varargs. This function is mainly + * Creates a filename from a vector of elements using the correct + * separator for the current platform. + * + * This function behaves exactly like g_build_filename(), but takes the path + * elements as a string array, instead of varargs. This function is mainly * meant for language bindings. * - * Returns: (type filename) (transfer full): a newly-allocated string that - * must be freed with g_free(). + * If you are building a path programmatically you may want to use + * #GPathBuf instead. + * + * Returns: (type filename) (transfer full): the newly allocated path * Since: 2.8 */ @@ -13148,10 +13578,12 @@ * @...: remaining elements in path, terminated by %NULL * * Creates a path from a series of elements using @separator as the - * separator between elements. At the boundary between two elements, - * any trailing occurrences of separator in the first element, or - * leading occurrences of separator in the second element are removed - * and exactly one copy of the separator is inserted. + * separator between elements. + * + * At the boundary between two elements, any trailing occurrences of + * separator in the first element, or leading occurrences of separator + * in the second element are removed and exactly one copy of the + * separator is inserted. * * Empty elements are ignored. * @@ -13174,8 +13606,7 @@ * copies of the separator, elements consisting only of copies * of the separator are ignored. * - * Returns: (type filename) (transfer full): a newly-allocated string that - * must be freed with g_free(). + * Returns: (type filename) (transfer full): the newly allocated path */ @@ -13183,11 +13614,12 @@ * g_build_pathv: * @separator: a string used to separator the elements of the path. * @args: (array zero-terminated=1) (element-type filename): %NULL-terminated - * array of strings containing the path elements. + * array of strings containing the path elements. * * Behaves exactly like g_build_path(), but takes the path elements - * as a string array, instead of varargs. This function is mainly - * meant for language bindings. + * as a string array, instead of variadic arguments. + * + * This function is mainly meant for language bindings. * * Returns: (type filename) (transfer full): a newly-allocated string that * must be freed with g_free(). @@ -13717,7 +14149,7 @@ * No file system I/O is done. * * Returns: (type filename) (transfer full): a newly allocated string with the - * canonical file path + * canonical file path * Since: 2.58 */ @@ -14005,6 +14437,64 @@ /** + * g_clear_fd: (skip) + * @fd_ptr: (not optional) (inout) (transfer full): a pointer to a file descriptor + * @error: Used to return an error on failure + * + * If @fd_ptr points to a file descriptor, close it and return + * whether closing it was successful, like g_close(). + * If @fd_ptr points to a negative number, return %TRUE without closing + * anything. + * In both cases, set @fd_ptr to `-1` before returning. + * + * Like g_close(), if closing the file descriptor fails, the error is + * stored in both %errno and @error. If this function succeeds, + * %errno is undefined. + * + * This function is async-signal-safe if @error is %NULL and @fd_ptr + * points to either a negative number or a valid file descriptor. + * + * It is a programming error for @fd_ptr to point to a non-negative + * number that is not a valid file descriptor. + * + * A typical use of this function is to clean up a file descriptor at + * the end of its scope, whether it has been set successfully or not: + * + * | + * gboolean + * operate_on_fd (GError **error) + * { + * gboolean ret = FALSE; + * int fd = -1; + * + * fd = open_a_fd (error); + * + * if (fd < 0) + * goto out; + * + * if (!do_something (fd, error)) + * goto out; + * + * if (!g_clear_fd (&fd, error)) + * goto out; + * + * ret = TRUE; + * + * out: + * // OK to call even if fd was never opened or was already closed + * g_clear_fd (&fd, NULL); + * return ret; + * } + * | + * + * This function is also useful in conjunction with #g_autofd. + * + * Returns: %TRUE on success + * Since: 2.76 + */ + + +/** * g_clear_handle_id: (skip) * @tag_ptr: (not nullable): a pointer to the handler ID * @clear_func: (not nullable): the function to call to clear the handler @@ -14039,8 +14529,8 @@ /** * g_clear_pointer: (skip) - * @pp: (not nullable): a pointer to a variable, struct member etc. holding a - * pointer + * @pp: (nullable) (not optional) (inout) (transfer full): a pointer to a + * variable, struct member etc. holding a pointer * @destroy: a function to which a gpointer can be passed, to destroy *@pp * * Clears a reference to a variable. @@ -14080,14 +14570,20 @@ * @fd: A file descriptor * @error: a #GError * - * This wraps the close() call; in case of error, %errno will be + * This wraps the close() call. In case of error, %errno will be * preserved, but the error will also be stored as a #GError in @error. + * In case of success, %errno is undefined. * * Besides using #GError, there is another major reason to prefer this * function over the call provided by the system; on Unix, it will * attempt to correctly handle %EINTR, which has platform-specific * semantics. * + * It is a bug to call this function with an invalid file descriptor. + * + * Since 2.76, this function is guaranteed to be async-signal-safe if (and only + * if) @error is %NULL and @fd is a valid open file descriptor. + * * Returns: %TRUE on success, %FALSE if there was an error. * Since: 2.36 */ @@ -16671,7 +17167,7 @@ /** * g_dir_make_tmp: * @tmpl: (type filename) (nullable): Template for directory name, - * as in g_mkdtemp(), basename only, or %NULL for a default template + * as in g_mkdtemp(), basename only, or %NULL for a default template * @error: return location for a #GError * * Creates a subdirectory in the preferred directory for temporary @@ -16687,9 +17183,9 @@ * modified, and might thus be a read-only literal string. * * Returns: (type filename) (transfer full): The actual name used. This string - * should be freed with g_free() when not needed any longer and is - * is in the GLib file name encoding. In case of errors, %NULL is - * returned and @error will be set. + * should be freed with g_free() when not needed any longer and is + * is in the GLib file name encoding. In case of errors, %NULL is + * returned and @error will be set. * Since: 2.30 */ @@ -17151,9 +17647,9 @@ /** * g_file_open_tmp: * @tmpl: (type filename) (nullable): Template for file name, as in - * g_mkstemp(), basename only, or %NULL for a default template + * g_mkstemp(), basename only, or %NULL for a default template * @name_used: (out) (type filename): location to store actual name used, - * or %NULL + * or %NULL * @error: return location for a #GError * * Opens a file for writing in the preferred directory for temporary @@ -17174,9 +17670,9 @@ * name encoding. * * Returns: A file handle (as from open()) to the file opened for - * reading and writing. The file is opened in binary mode on platforms - * where there is a difference. The file handle should be closed with - * close(). In case of errors, -1 is returned and @error will be set. + * reading and writing. The file is opened in binary mode on platforms + * where there is a difference. The file handle should be closed with + * close(). In case of errors, -1 is returned and @error will be set. */ @@ -17186,11 +17682,31 @@ * @error: return location for a #GError * * Reads the contents of the symbolic link @filename like the POSIX - * readlink() function. The returned string is in the encoding used - * for filenames. Use g_filename_to_utf8() to convert it to UTF-8. + * `readlink()` function. + * + * The returned string is in the encoding used for filenames. Use + * g_filename_to_utf8() to convert it to UTF-8. + * + * The returned string may also be a relative path. Use g_build_filename() + * to convert it to an absolute path: + * + * |<!-- language="C" --> + * g_autoptr(GError) local_error = NULL; + * g_autofree gchar *link_target = g_file_read_link ("/etc/localtime", &local_error); + * + * if (local_error != NULL) + * g_error ("Error reading link: %s", local_error->message); + * + * if (!g_path_is_absolute (link_target)) + * { + * g_autofree gchar *absolute_link_target = g_build_filename ("/etc", link_target, NULL); + * g_free (link_target); + * link_target = g_steal_pointer (&absolute_link_target); + * } + * | * * Returns: (type filename) (transfer full): A newly-allocated string with - * the contents of the symbolic link, or %NULL if an error occurred. + * the contents of the symbolic link, or %NULL if an error occurred. * Since: 2.4 */ @@ -17305,10 +17821,13 @@ * * You should never use g_file_test() to test whether it is safe * to perform an operation, because there is always the possibility - * of the condition changing before you actually perform the operation. + * of the condition changing before you actually perform the operation, + * see TOCTOU(https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use). + * * For example, you might think you could use %G_FILE_TEST_IS_SYMLINK * to know whether it is safe to write to a file without being * tricked into writing into a different location. It doesn't work! + * * |<!-- language="C" --> * // DON'T DO THIS * if (!g_file_test (filename, G_FILE_TEST_IS_SYMLINK)) @@ -17316,6 +17835,21 @@ * fd = g_open (filename, O_WRONLY); * // write to fd * } + * + * // DO THIS INSTEAD + * fd = g_open (filename, O_WRONLY | O_NOFOLLOW | O_CLOEXEC); + * if (fd == -1) + * { + * // check error + * if (errno == ELOOP) + * // file is a symlink and can be ignored + * else + * // handle errors as before + * } + * else + * { + * // write to fd + * } * | * * Another thing to note is that %G_FILE_TEST_EXISTS and @@ -17496,6 +18030,34 @@ /** + * g_find_program_for_path: + * @program: (type filename): a program name in the GLib file name encoding + * @path: (type filename) (nullable): the current dir where to search program + * @working_dir: (type filename) (nullable): the working dir where to search + * program + * + * Locates the first executable named @program in @path, in the + * same way that execvp() would locate it. Returns an allocated string + * with the absolute path name (taking in account the @working_dir), or + * %NULL if the program is not found in @path. If @program is already an + * absolute path, returns a copy of @program if @program exists and is + * executable, and %NULL otherwise. + * + * On Windows, if @path is %NULL, it looks for the file in the same way as + * CreateProcess() would. This means first in the directory where the + * executing program was loaded from, then in the current directory, then in + * the Windows 32-bit system directory, then in the Windows directory, and + * finally in the directories in the `PATH` environment variable. If + * the program is found, the return value contains the full name + * including the type suffix. + * + * Returns: (type filename) (transfer full) (nullable): a newly-allocated + * string with the absolute path, or %NULL + * Since: 2.76 + */ + + +/** * g_find_program_in_path: * @program: (type filename): a program name in the GLib file name encoding * @@ -17636,12 +18198,32 @@ * * Frees the memory pointed to by @mem. * + * If you know the allocated size of @mem, calling g_free_sized() may be faster, + * depending on the libc implementation in use. + * * If @mem is %NULL it simply returns, so there is no need to check @mem * against %NULL before calling this function. */ /** + * g_free_sized: + * @mem: (nullable): the memory to free + * @size: size of @mem, in bytes + * + * Frees the memory pointed to by @mem, assuming it is has the given @size. + * + * If @mem is %NULL this is a no-op (and @size is ignored). + * + * It is an error if @size doesn’t match the size passed when @mem was + * allocated. @size is passed to this function to allow optimizations in the + * allocator. If you don’t know the allocation size, use g_free() instead. + * + * Since: 2.76 + */ + + +/** * g_freopen: * @filename: (type filename): a pathname in the GLib file name encoding * (UTF-8 on Windows) @@ -17713,7 +18295,8 @@ * * On Linux, the character set is found by consulting nl_langinfo() if * available. If not, the environment variables `LC_ALL`, `LC_CTYPE`, `LANG` - * and `CHARSET` are queried in order. + * and `CHARSET` are queried in order. nl_langinfo() returns the C locale if + * no locale has been loaded by setlocale(). * * The return value is %TRUE if the locale's encoding is UTF-8, in that * case you can perhaps avoid calling g_convert(). @@ -18545,6 +19128,25 @@ /** + * g_hash_table_get_keys_as_ptr_array: (skip) + * @hash_table: a #GHashTable + * + * Retrieves every key inside @hash_table, as a #GPtrArray. + * The returned data is valid until changes to the hash release those keys. + * + * This iterates over every entry in the hash table to build its return value. + * To iterate over the entries in a #GHashTable more efficiently, use a + * #GHashTableIter. + * + * You should always unref the returned array with g_ptr_array_unref(). + * + * Returns: (transfer container): a #GPtrArray containing each key from + * the table. Unref with with g_ptr_array_unref() when done. + * Since: 2.76 + */ + + +/** * g_hash_table_get_values: * @hash_table: a #GHashTable * @@ -18564,6 +19166,25 @@ /** + * g_hash_table_get_values_as_ptr_array: (skip) + * @hash_table: a #GHashTable + * + * Retrieves every value inside @hash_table, as a #GPtrArray. + * The returned data is valid until changes to the hash release those values. + * + * This iterates over every entry in the hash table to build its return value. + * To iterate over the entries in a #GHashTable more efficiently, use a + * #GHashTableIter. + * + * You should always unref the returned array with g_ptr_array_unref(). + * + * Returns: (transfer container): a #GPtrArray containing each value from + * the table. Unref with with g_ptr_array_unref() when done. + * Since: 2.76 + */ + + +/** * g_hash_table_insert: * @hash_table: a #GHashTable * @key: a key to insert @@ -18901,6 +19522,36 @@ /** + * g_hash_table_steal_all_keys: (skip) + * @hash_table: a #GHashTable + * + * Removes all keys and their associated values from a #GHashTable + * without calling the key destroy functions, returning the keys + * as a #GPtrArray with the free func set to the @hash_table key + * destroy function. + * + * Returns: (transfer container): a #GPtrArray containing each key of + * the table. Unref with with g_ptr_array_unref() when done. + * Since: 2.76 + */ + + +/** + * g_hash_table_steal_all_values: (skip) + * @hash_table: a #GHashTable + * + * Removes all keys and their associated values from a #GHashTable + * without calling the value destroy functions, returning the values + * as a #GPtrArray with the free func set to the @hash_table value + * destroy function. + * + * Returns: (transfer container): a #GPtrArray containing each value of + * the table. Unref with with g_ptr_array_unref() when done. + * Since: 2.76 + */ + + +/** * g_hash_table_steal_extended: * @hash_table: a #GHashTable * @lookup_key: the key to look up @@ -18915,11 +19566,17 @@ * * If found, the stolen key and value are removed from the hash table without * calling the key and value destroy functions, and ownership is transferred to - * the caller of this method; as with g_hash_table_steal(). + * the caller of this method, as with g_hash_table_steal(). That is the case + * regardless whether @stolen_key or @stolen_value output parameters are + * requested. * * You can pass %NULL for @lookup_key, provided the hash and equal functions * of @hash_table are %NULL-safe. * + * The dictionary implementation optimizes for having all values identical to + * their keys, for example by using g_hash_table_add(). When stealing both the + * key and the value from such a dictionary, the value will be %NULL. + * * Returns: %TRUE if the key was found in the #GHashTable * Since: 2.58 */ @@ -19883,7 +20540,7 @@ /** * g_io_channel_get_line_term: * @channel: a #GIOChannel - * @length: a location to return the length of the line terminator + * @length: (out) (optional): a location to return the length of the line terminator * * This returns the string that #GIOChannel uses to determine * where in the file a line break occurs. A value of %NULL @@ -22228,6 +22885,12 @@ * the code which sets them. For example, custom keys from GLib all have a * `GLIB_` prefix. * + * Note that keys that expect UTF-8 strings (specifically `"MESSAGE"` and + * `"GLIB_DOMAIN"`) must be passed as NUL-terminated UTF-8 strings until GLib + * version 2.74.1 because the default log handler did not consider the length of + * the `GLogField`. Starting with GLib 2.74.1 this is fixed and + * non-NUL-terminated UTF-8 strings can be passed with their correct length. + * * The @log_domain will be converted into a `GLIB_DOMAIN` field. @log_level will * be converted into a * `PRIORITY`(https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html#PRIORITY=) @@ -22598,7 +23261,8 @@ /** * g_main_context_acquire: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * * Tries to become the owner of the specified context. * If some other thread is the owner of the context, @@ -22611,6 +23275,9 @@ * can call g_main_context_prepare(), g_main_context_query(), * g_main_context_check(), g_main_context_dispatch(). * + * Since 2.76 @context can be %NULL to use the global-default + * main context. + * * Returns: %TRUE if the operation succeeded, and * this thread is now the owner of @context. */ @@ -22618,7 +23285,8 @@ /** * g_main_context_add_poll: - * @context: (nullable): a #GMainContext (or %NULL for the default context) + * @context: (nullable): a #GMainContext (or %NULL for the global-default + * main context) * @fd: a #GPollFD structure holding information about a file * descriptor to watch. * @priority: the priority for this file descriptor which should be @@ -22633,7 +23301,8 @@ /** * g_main_context_check: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * @max_priority: the maximum numerical priority of sources to check * @fds: (array length=n_fds): array of #GPollFD's that was passed to * the last call to g_main_context_query() @@ -22647,6 +23316,9 @@ * You must have successfully acquired the context with * g_main_context_acquire() before you may call this function. * + * Since 2.76 @context can be %NULL to use the global-default + * main context. + * * Returns: %TRUE if some sources are ready to be dispatched. */ @@ -22654,29 +23326,34 @@ /** * g_main_context_default: * - * Returns the global default main context. This is the main context + * Returns the global-default main context. This is the main context * used for main loop functions when a main loop is not explicitly * specified, and corresponds to the "main" main loop. See also * g_main_context_get_thread_default(). * - * Returns: (transfer none): the global default main context. + * Returns: (transfer none): the global-default main context. */ /** * g_main_context_dispatch: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * * Dispatches all pending sources. * * You must have successfully acquired the context with * g_main_context_acquire() before you may call this function. + * + * Since 2.76 @context can be %NULL to use the global-default + * main context. */ /** * g_main_context_find_source_by_funcs_user_data: - * @context: (nullable): a #GMainContext (if %NULL, the default context will be used). + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used). * @funcs: the @source_funcs passed to g_source_new(). * @user_data: the user data from the callback. * @@ -22690,7 +23367,8 @@ /** * g_main_context_find_source_by_id: - * @context: (nullable): a #GMainContext (if %NULL, the default context will be used) + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * @source_id: the source ID, as returned by g_source_get_id(). * * Finds a #GSource given a pair of context and ID. @@ -22712,7 +23390,8 @@ /** * g_main_context_find_source_by_user_data: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * @user_data: the user_data for the callback. * * Finds a source with the given user data for the callback. If @@ -22725,7 +23404,8 @@ /** * g_main_context_get_poll_func: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * * Gets the poll function set by g_main_context_set_poll_func(). * @@ -22749,21 +23429,22 @@ * g_main_context_ref_thread_default() instead. * * Returns: (transfer none) (nullable): the thread-default #GMainContext, or - * %NULL if the thread-default context is the global default context. + * %NULL if the thread-default context is the global-default main context. * Since: 2.22 */ /** * g_main_context_invoke: - * @context: (nullable): a #GMainContext, or %NULL + * @context: (nullable): a #GMainContext, or %NULL for the global-default + * main context * @function: function to call * @data: data to pass to @function * * Invokes a function in such a way that @context is owned during the * invocation of @function. * - * If @context is %NULL then the global default main context — as + * If @context is %NULL then the global-default main context — as * returned by g_main_context_default() — is used. * * If @context is owned by the current thread, @function is called @@ -22788,7 +23469,8 @@ /** * g_main_context_invoke_full: - * @context: (nullable): a #GMainContext, or %NULL + * @context: (nullable): a #GMainContext, or %NULL for the global-default + * main context * @priority: the priority at which to run @function * @function: function to call * @data: data to pass to @function @@ -22810,7 +23492,8 @@ /** * g_main_context_is_owner: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * * Determines whether this thread holds the (recursive) * ownership of this #GMainContext. This is useful to @@ -22824,7 +23507,8 @@ /** * g_main_context_iteration: - * @context: (nullable): a #GMainContext (if %NULL, the default context will be used) + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * @may_block: whether the call may block. * * Runs a single iteration for the given main loop. This involves @@ -22867,7 +23551,8 @@ /** * g_main_context_pending: - * @context: (nullable): a #GMainContext (if %NULL, the default context will be used) + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * * Checks if any sources have pending events for the given context. * @@ -22877,7 +23562,8 @@ /** * g_main_context_pop_thread_default: - * @context: (nullable): a #GMainContext object, or %NULL + * @context: (nullable): a #GMainContext, or %NULL for the global-default + * main context * * Pops @context off the thread-default context stack (verifying that * it was on the top of the stack). @@ -22888,7 +23574,8 @@ /** * g_main_context_prepare: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * @priority: (out) (optional): location to store priority of highest priority * source already ready. * @@ -22905,14 +23592,15 @@ /** * g_main_context_push_thread_default: - * @context: (nullable): a #GMainContext, or %NULL for the global default context + * @context: (nullable): a #GMainContext, or %NULL for the global-default + * main context * * Acquires @context and sets it as the thread-default context for the * current thread. This will cause certain asynchronous operations * (such as most giogio-based I/O) which are * started in this thread to run under @context and deliver their * results to its main loop, rather than running under the global - * default context in the main thread. Note that calling this function + * default main context in the main thread. Note that calling this function * changes the context returned by g_main_context_get_thread_default(), * not the one returned by g_main_context_default(), so it does not affect * the context used by functions like g_idle_add(). @@ -22952,7 +23640,8 @@ /** * g_main_context_query: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * @max_priority: maximum priority source to check * @timeout_: (out): location to store timeout to be used in polling * @fds: (out caller-allocates) (array length=n_fds): location to @@ -22975,7 +23664,7 @@ /** * g_main_context_ref: - * @context: a #GMainContext + * @context: (not nullable): a #GMainContext * * Increases the reference count on a #GMainContext object by one. * @@ -22990,7 +23679,7 @@ * g_main_context_get_thread_default(), but also adds a reference to * it with g_main_context_ref(). In addition, unlike * g_main_context_get_thread_default(), if the thread-default context - * is the global default context, this will return that #GMainContext + * is the global-default context, this will return that #GMainContext * (with a ref added to it) rather than returning %NULL. * * Returns: (transfer full): the thread-default #GMainContext. Unref @@ -23001,7 +23690,8 @@ /** * g_main_context_release: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * * Releases ownership of a context previously acquired by this thread * with g_main_context_acquire(). If the context was acquired multiple @@ -23012,7 +23702,8 @@ /** * g_main_context_remove_poll: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * @fd: a #GPollFD descriptor previously added with g_main_context_add_poll() * * Removes file descriptor from the set of file descriptors to be @@ -23022,7 +23713,8 @@ /** * g_main_context_set_poll_func: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * @func: the function to call to poll all file descriptors * * Sets the function to use to handle polling of file descriptors. It @@ -23037,7 +23729,7 @@ /** * g_main_context_unref: - * @context: a #GMainContext + * @context: (not nullable): a #GMainContext * * Decreases the reference count on a #GMainContext object by one. If * the result is zero, free the context and free all associated memory. @@ -23046,7 +23738,8 @@ /** * g_main_context_wait: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * @cond: a condition variable * @mutex: a mutex, currently held * @@ -23064,7 +23757,8 @@ /** * g_main_context_wakeup: - * @context: a #GMainContext + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * * If @context is currently blocking in g_main_context_iteration() * waiting for a source to become ready, cause it to stop blocking @@ -23238,7 +23932,8 @@ /** * g_main_loop_new: - * @context: (nullable): a #GMainContext (if %NULL, the default context will be used). + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used). * @is_running: set to %TRUE to indicate that the loop is running. This * is not very important since calling g_main_loop_run() will set this to * %TRUE anyway. @@ -24374,8 +25069,8 @@ * g_dir_make_tmp() instead. * * Returns: (nullable) (type filename): A pointer to @tmpl, which has been - * modified to hold the directory name. In case of errors, %NULL is - * returned and %errno will be set. + * modified to hold the directory name. In case of errors, %NULL is + * returned and %errno will be set. * Since: 2.30 */ @@ -24402,8 +25097,8 @@ * g_dir_make_tmp() instead. * * Returns: (nullable) (type filename): A pointer to @tmpl, which has been - * modified to hold the directory name. In case of errors, %NULL is - * returned, and %errno will be set. + * modified to hold the directory name. In case of errors, %NULL is + * returned, and %errno will be set. * Since: 2.30 */ @@ -24424,10 +25119,10 @@ * Most importantly, on Windows it should be in UTF-8. * * Returns: A file handle (as from open()) to the file - * opened for reading and writing. The file is opened in binary - * mode on platforms where there is a difference. The file handle - * should be closed with close(). In case of errors, -1 is - * returned and %errno will be set. + * opened for reading and writing. The file is opened in binary + * mode on platforms where there is a difference. The file handle + * should be closed with close(). In case of errors, -1 is + * returned and %errno will be set. */ @@ -24435,7 +25130,7 @@ * g_mkstemp_full: (skip) * @tmpl: (type filename): template filename * @flags: flags to pass to an open() call in addition to O_EXCL - * and O_CREAT, which are passed automatically + * and O_CREAT, which are passed automatically * @mode: permissions to create the temporary file with * * Opens a temporary file. See the mkstemp() documentation @@ -24451,9 +25146,9 @@ * on Windows it should be in UTF-8. * * Returns: A file handle (as from open()) to the file - * opened for reading and writing. The file handle should be - * closed with close(). In case of errors, -1 is returned - * and %errno will be set. + * opened for reading and writing. The file handle should be + * closed with close(). In case of errors, -1 is returned + * and %errno will be set. * Since: 2.22 */ @@ -25637,6 +26332,282 @@ /** + * g_path_buf_clear: + * @buf: a path buffer + * + * Clears the contents of the path buffer. + * + * This function should be use to free the resources in a stack-allocated + * `GPathBuf` initialized using g_path_buf_init() or + * g_path_buf_init_from_path(). + * + * Since: 2.76 + */ + + +/** + * g_path_buf_clear_to_path: + * @buf: a path buffer + * + * Clears the contents of the path buffer and returns the built path. + * + * This function returns `NULL` if the `GPathBuf` is empty. + * + * See also: g_path_buf_to_path() + * + * Returns: (transfer full) (nullable) (type filename): the built path + * Since: 2.76 + */ + + +/** + * g_path_buf_copy: + * @buf: (not nullable): a path buffer + * + * Copies the contents of a path buffer into a new `GPathBuf`. + * + * Returns: (transfer full): the newly allocated path buffer + * Since: 2.76 + */ + + +/** + * g_path_buf_equal: + * @v1: (not nullable): a path buffer to compare + * @v2: (not nullable): a path buffer to compare + * + * Compares two path buffers for equality and returns `TRUE` + * if they are equal. + * + * The path inside the paths buffers are not going to be normalized, + * so `X/Y/Z/A/..`, `X/./Y/Z` and `X/Y/Z` are not going to be considered + * equal. + * + * This function can be passed to g_hash_table_new() as the + * `key_equal_func` parameter. + * + * Returns: `TRUE` if the two path buffers are equal, + * and `FALSE` otherwise + * Since: 2.76 + */ + + +/** + * g_path_buf_free: + * @buf: (transfer full) (not nullable): a path buffer + * + * Frees a `GPathBuf` allocated by g_path_buf_new(). + * + * Since: 2.76 + */ + + +/** + * g_path_buf_free_to_path: + * @buf: (transfer full) (not nullable): a path buffer + * + * Frees a `GPathBuf` allocated by g_path_buf_new(), and + * returns the path inside the buffer. + * + * This function returns `NULL` if the `GPathBuf` is empty. + * + * See also: g_path_buf_to_path() + * + * Returns: (transfer full) (nullable) (type filename): the path + * Since: 2.76 + */ + + +/** + * g_path_buf_init: + * @buf: a path buffer + * + * Initializes a `GPathBuf` instance. + * + * Returns: (transfer none): the initialized path builder + * Since: 2.76 + */ + + +/** + * g_path_buf_init_from_path: + * @buf: a path buffer + * @path: (type filename) (nullable): a file system path + * + * Initializes a `GPathBuf` instance with the given path. + * + * Returns: (transfer none): the initialized path builder + * Since: 2.76 + */ + + +/** + * g_path_buf_new: + * + * Allocates a new `GPathBuf`. + * + * Returns: (transfer full): the newly allocated path buffer + * Since: 2.76 + */ + + +/** + * g_path_buf_new_from_path: + * @path: (type filename) (nullable): the path used to initialize the buffer + * + * Allocates a new `GPathBuf` with the given @path. + * + * Returns: (transfer full): the newly allocated path buffer + * Since: 2.76 + */ + + +/** + * g_path_buf_pop: + * @buf: a path buffer + * + * Removes the last element of the path buffer. + * + * If there is only one element in the path buffer (for example, `/` on + * Unix-like operating systems or the drive on Windows systems), it will + * not be removed and %FALSE will be returned instead. + * + * |<!-- language="C" --> + * GPathBuf buf, cmp; + * + * g_path_buf_init_from_path (&buf, "/bin/sh"); + * + * g_path_buf_pop (&buf); + * g_path_buf_init_from_path (&cmp, "/bin"); + * g_assert_true (g_path_buf_equal (&buf, &cmp)); + * g_path_buf_clear (&cmp); + * + * g_path_buf_pop (&buf); + * g_path_buf_init_from_path (&cmp, "/"); + * g_assert_true (g_path_buf_equal (&buf, &cmp)); + * g_path_buf_clear (&cmp); + * + * g_path_buf_clear (&buf); + * | + * + * Returns: `TRUE` if the buffer was modified and `FALSE` otherwise + * Since: 2.76 + */ + + +/** + * g_path_buf_push: + * @buf: a path buffer + * @path: (type filename): a path + * + * Extends the given path buffer with @path. + * + * If @path is absolute, it replaces the current path. + * + * If @path contains a directory separator, the buffer is extended by + * as many elements the path provides. + * + * On Windows, both forward slashes and backslashes are treated as + * directory separators. On other platforms, %G_DIR_SEPARATOR_S is the + * only directory separator. + * + * |<!-- language="C" --> + * GPathBuf buf, cmp; + * + * g_path_buf_init_from_path (&buf, "/tmp"); + * g_path_buf_push (&buf, ".X11-unix/X0"); + * g_path_buf_init_from_path (&cmp, "/tmp/.X11-unix/X0"); + * g_assert_true (g_path_buf_equal (&buf, &cmp)); + * g_path_buf_clear (&cmp); + * + * g_path_buf_push (&buf, "/etc/locale.conf"); + * g_path_buf_init_from_path (&cmp, "/etc/locale.conf"); + * g_assert_true (g_path_buf_equal (&buf, &cmp)); + * g_path_buf_clear (&cmp); + * + * g_path_buf_clear (&buf); + * | + * + * Returns: (transfer none): the same pointer to @buf, for convenience + * Since: 2.76 + */ + + +/** + * g_path_buf_set_extension: + * @buf: a path buffer + * @extension: (type filename) (nullable): the file extension + * + * Adds an extension to the file name in the path buffer. + * + * If @extension is `NULL`, the extension will be unset. + * + * If the path buffer does not have a file name set, this function returns + * `FALSE` and leaves the path buffer unmodified. + * + * Returns: `TRUE` if the extension was replaced, and `FALSE` otherwise + * Since: 2.76 + */ + + +/** + * g_path_buf_set_filename: + * @buf: a path buffer + * @file_name: (type filename) (not nullable): the file name in the path + * + * Sets the file name of the path. + * + * If the path buffer is empty, the filename is left unset and this + * function returns `FALSE`. + * + * If the path buffer only contains the root element (on Unix-like operating + * systems) or the drive (on Windows), this is the equivalent of pushing + * the new @file_name. + * + * If the path buffer contains a path, this is the equivalent of + * popping the path buffer and pushing @file_name, creating a + * sibling of the original path. + * + * |<!-- language="C" --> + * GPathBuf buf, cmp; + * + * g_path_buf_init_from_path (&buf, "/"); + * + * g_path_buf_set_filename (&buf, "bar"); + * g_path_buf_init_from_path (&cmp, "/bar"); + * g_assert_true (g_path_buf_equal (&buf, &cmp)); + * g_path_buf_clear (&cmp); + * + * g_path_buf_set_filename (&buf, "baz.txt"); + * g_path_buf_init_from_path (&cmp, "/baz.txt"); + * g_assert_true (g_path_buf_equal (&buf, &cmp); + * g_path_buf_clear (&cmp); + * + * g_path_buf_clear (&buf); + * | + * + * Returns: `TRUE` if the file name was replaced, and `FALSE` otherwise + * Since: 2.76 + */ + + +/** + * g_path_buf_to_path: + * @buf: a path buffer + * + * Retrieves the built path from the path buffer. + * + * On Windows, the result contains backslashes as directory separators, + * even if forward slashes were used in input. + * + * If the path buffer is empty, this function returns `NULL`. + * + * Returns: (transfer full) (type filename) (nullable): the path + * Since: 2.76 + */ + + +/** * g_path_get_basename: * @file_name: (type filename): the name of the file * @@ -25648,7 +26619,7 @@ * separator is returned. If @file_name is empty, it gets ".". * * Returns: (type filename) (transfer full): a newly allocated string - * containing the last component of the filename + * containing the last component of the filename */ @@ -25979,7 +26950,7 @@ * @...: the parameters to insert into the format string * * Outputs a formatted message via the print handler. - * The default print handler simply outputs the message to stdout, without + * The default print handler outputs the encoded message to stdout, without * appending a trailing new-line character. Typically, @format should end with * its own new-line character. * @@ -25997,7 +26968,7 @@ * @...: the parameters to insert into the format string * * Outputs a formatted message via the error message handler. - * The default handler simply outputs the message to stderr, without appending + * The default handler outputs the encoded message to stderr, without appending * a trailing new-line character. Typically, @format should end with its own * new-line character. * @@ -26333,6 +27304,67 @@ /** + * g_ptr_array_new_from_array: (skip) + * @data: (array length=len) (transfer none) (nullable): an array of pointers, + * or %NULL for an empty array + * @len: the number of pointers in @data + * @copy_func: (nullable): a copy function used to copy every element in the + * array or %NULL. + * @copy_func_user_data: user data passed to @copy_func, or %NULL + * @element_free_func: (nullable): a function to free elements on @array + * destruction or %NULL + * + * Creates a new #GPtrArray, copying @len pointers from @data, and setting + * the array’s reference count to 1. + * + * This avoids having to manually add each element one by one. + * + * If @copy_func is provided, then it is used to copy each element before + * adding them to the new array. If it is %NULL then the pointers are copied + * directly. + * + * It also sets @element_free_func for freeing each element when the array is + * destroyed either via g_ptr_array_unref(), when g_ptr_array_free() is called + * with @free_segment set to %TRUE or when removing elements. + * + * Do not use it if @len is greater than %G_MAXUINT. #GPtrArray + * stores the length of its data in #guint, which may be shorter than + * #gsize. + * + * Returns: (transfer full): A new #GPtrArray + * Since: 2.76 + */ + + +/** + * g_ptr_array_new_from_null_terminated_array: (skip) + * @data: (array zero-terminated=1) (transfer none) (nullable): an array of + * pointers, %NULL terminated; or %NULL for an empty array + * @copy_func: (nullable): a copy function used to copy every element in the + * array or %NULL. + * @copy_func_user_data: user data passed to @copy_func, or %NULL + * @element_free_func: (nullable): a function to free elements on @array + * destruction or %NULL + * + * Creates a new #GPtrArray copying the pointers from @data after having + * computed the length of it and with a reference count of 1. + * This avoids having to manually add each element one by one. + * If @copy_func is provided, then it is used to copy the data in the new + * array. + * It also set @element_free_func for freeing each element when the array is + * destroyed either via g_ptr_array_unref(), when g_ptr_array_free() is called + * with @free_segment set to %TRUE or when removing elements. + * + * Do not use it if the @data has more than %G_MAXUINT elements. #GPtrArray + * stores the length of its data in #guint, which may be shorter than + * #gsize. + * + * Returns: (transfer full): A new #GPtrArray + * Since: 2.76 + */ + + +/** * g_ptr_array_new_full: * @reserved_size: number of pointers preallocated * @element_free_func: (nullable): A function to free elements with @@ -26383,6 +27415,62 @@ /** + * g_ptr_array_new_take: (skip) + * @data: (array length=len) (transfer full) (nullable): an array of pointers, + * or %NULL for an empty array + * @len: the number of pointers in @data + * @element_free_func: (nullable): A function to free elements on @array + * destruction or %NULL + * + * Creates a new #GPtrArray with @data as pointers, @len as length and a + * reference count of 1. + * + * This avoids having to copy such data manually. @data will eventually be + * freed using g_free(), so must have been allocated with a suitable allocator. + * + * It also sets @element_free_func for freeing each element when the array is + * destroyed either via g_ptr_array_unref(), when g_ptr_array_free() is called + * with @free_segment set to %TRUE or when removing elements. + * + * Do not use it if @len is greater than %G_MAXUINT. #GPtrArray + * stores the length of its data in #guint, which may be shorter than + * #gsize. + * + * Returns: (transfer full): A new #GPtrArray + * Since: 2.76 + */ + + +/** + * g_ptr_array_new_take_null_terminated: (skip) + * @data: (array zero-terminated=1) (transfer full) (nullable): an array + * of pointers, %NULL terminated, or %NULL for an empty array + * @element_free_func: (nullable): a function to free elements on @array + * destruction or %NULL + * + * Creates a new #GPtrArray with @data as pointers, computing the length of it + * and setting the reference count to 1. + * + * This avoids having to copy such data manually. @data will eventually be + * freed using g_free(), so must have been allocated with a suitable allocator. + * + * The length is calculated by iterating through @data until the first %NULL + * element is found. + * + * It also sets @element_free_func for freeing each element when the array is + * destroyed either via g_ptr_array_unref(), when g_ptr_array_free() is called + * with @free_segment set to %TRUE or when removing elements. + * + * Do not use it if the @data length is greater than %G_MAXUINT. #GPtrArray + * stores the length of its data in #guint, which may be shorter than + * #gsize. + * + * Returns: (transfer full): A new #GPtrArray + * Since: 2.76 + */ + + +/** * g_ptr_array_new_with_free_func: * @element_free_func: (nullable): A function to free elements with * destroy @array or %NULL @@ -26539,12 +27627,15 @@ * * Sorts the array, using @compare_func which should be a qsort()-style * comparison function (returns less than zero for first arg is less - * than second arg, zero for equal, greater than zero if irst arg is + * than second arg, zero for equal, greater than zero if first arg is * greater than second arg). * * Note that the comparison function for g_ptr_array_sort() doesn't * take the pointers from the array as arguments, it takes pointers to - * the pointers in the array. Here is a full example of usage: + * the pointers in the array. + * + * Use g_ptr_array_sort_with_data() if you want to use normal + * #GCompareFuncs, otherwise here is a full example of use: * * |<!-- language="C" --> * typedef struct @@ -26576,6 +27667,37 @@ /** + * g_ptr_array_sort_values: + * @array: a #GPtrArray + * @compare_func: a #GCompareFunc comparison function + * + * Sorts the array, using @compare_func which should be a qsort()-style + * comparison function (returns less than zero for first arg is less + * than second arg, zero for equal, greater than zero if first arg is + * greater than second arg). + * + * This is guaranteed to be a stable sort. + * + * Since: 2.76 + */ + + +/** + * g_ptr_array_sort_values_with_data: + * @array: a #GPtrArray + * @compare_func: a #GCompareDataFunc comparison function + * @user_data: data to pass to @compare_func + * + * Like g_ptr_array_sort_values(), but the comparison function has an extra + * user data argument. + * + * This is guaranteed to be a stable sort. + * + * Since: 2.76 + */ + + +/** * g_ptr_array_sort_with_data: * @array: a #GPtrArray * @compare_func: comparison function @@ -26586,7 +27708,10 @@ * * Note that the comparison function for g_ptr_array_sort_with_data() * doesn't take the pointers from the array as arguments, it takes - * pointers to the pointers in the array. Here is a full example of use: + * pointers to the pointers in the array. + * + * Use g_ptr_array_sort_with_data() if you want to use normal + * #GCompareDataFuncs, otherwise here is a full example of use: * * |<!-- language="C" --> * typedef enum { SORT_NAME, SORT_SIZE } SortMode; @@ -27997,7 +29122,7 @@ /** * g_regex_escape_string: - * @string: (array length=length): the string to escape + * @string: the string to escape * @length: the length of @string, in bytes, or -1 if @string is nul-terminated * * Escapes the special characters used for regular expressions @@ -29843,33 +30968,51 @@ /** * g_set_print_handler: - * @func: the new print handler + * @func: (nullable): the new print handler or %NULL to + * reset to the default * - * Sets the print handler. + * Sets the print handler to @func, or resets it to the + * default GLib handler if %NULL. * * Any messages passed to g_print() will be output via - * the new handler. The default handler simply outputs - * the message to stdout. By providing your own handler + * the new handler. The default handler outputs + * the encoded message to stdout. By providing your own handler * you can redirect the output, to a GTK+ widget or a * log file for example. * - * Returns: the old print handler + * Since 2.76 this functions always returns a valid + * #GPrintFunc, and never returns %NULL. If no custom + * print handler was set, it will return the GLib + * default print handler and that can be re-used to + * decorate its output and/or to write to stderr + * in all platforms. Before GLib 2.76, this was %NULL. + * + * Returns: (not nullable): the old print handler */ /** * g_set_printerr_handler: - * @func: the new error message handler + * @func: (nullable): he new error message handler or %NULL + * to reset to the default * - * Sets the handler for printing error messages. + * Sets the handler for printing error messages to @func, + * or resets it to the default GLib handler if %NULL. * * Any messages passed to g_printerr() will be output via - * the new handler. The default handler simply outputs the + * the new handler. The default handler outputs the encoded * message to stderr. By providing your own handler you can * redirect the output, to a GTK+ widget or a log file for * example. * - * Returns: the old error message handler + * Since 2.76 this functions always returns a valid + * #GPrintFunc, and never returns %NULL. If no custom error + * print handler was set, it will return the GLib default + * error print handler and that can be re-used to decorate + * its output and/or to write to stderr in all platforms. + * Before GLib 2.76, this was %NULL. + * + * Returns: (not nullable): the old error message handler */ @@ -30032,19 +31175,15 @@ * g_slice_alloc: * @block_size: the number of bytes to allocate * - * Allocates a block of memory from the slice allocator. + * Allocates a block of memory from the libc allocator. * * The block address handed out can be expected to be aligned - * to at least `1 * sizeof (void*)`, though in general slices - * are `2 * sizeof (void*)` bytes aligned; if a `malloc()` - * fallback implementation is used instead, the alignment may - * be reduced in a libc dependent fashion. + * to at least `1 * sizeof (void*)`. * - * Note that the underlying slice allocation mechanism can - * be changed with the `G_SLICE=always-malloc`G_SLICE - * environment variable. + * Since GLib 2.76 this always uses the system malloc() implementation + * internally. * - * Returns: a pointer to the allocated memory block, which will + * Returns: (nullable): a pointer to the allocated memory block, which will * be %NULL if and only if @mem_size is 0 * Since: 2.10 */ @@ -30055,12 +31194,13 @@ * @block_size: the number of bytes to allocate * * Allocates a block of memory via g_slice_alloc() and initializes - * the returned memory to 0. Note that the underlying slice allocation - * mechanism can be changed with the `G_SLICE=always-malloc`G_SLICE - * environment variable. + * the returned memory to 0. * - * Returns: a pointer to the allocated block, which will be %NULL if and only - * if @mem_size is 0 + * Since GLib 2.76 this always uses the system malloc() implementation + * internally. + * + * Returns: (nullable): a pointer to the allocated block, which will be %NULL + * if and only if @mem_size is 0 * Since: 2.10 */ @@ -30075,8 +31215,11 @@ * * @mem_block must be non-%NULL if @block_size is non-zero. * - * Returns: a pointer to the allocated memory block, which will be %NULL if and - * only if @mem_size is 0 + * Since GLib 2.76 this always uses the system malloc() implementation + * internally. + * + * Returns: (nullable): a pointer to the allocated memory block, + * which will be %NULL if and only if @mem_size is 0 * Since: 2.14 */ @@ -30092,12 +31235,12 @@ * It calls g_slice_copy() with `sizeof (@type)` * and casts the returned pointer to a pointer of the given type, * avoiding a type cast in the source code. - * Note that the underlying slice allocation mechanism can - * be changed with the `G_SLICE=always-malloc`G_SLICE - * environment variable. * * This can never return %NULL. * + * Since GLib 2.76 this always uses the system malloc() implementation + * internally. + * * Returns: (not nullable): a pointer to the allocated block, cast to a pointer * to @type * Since: 2.14 @@ -30107,7 +31250,7 @@ /** * g_slice_free: * @type: the type of the block to free, typically a structure name - * @mem: a pointer to the block to free + * @mem: (nullable): a pointer to the block to free * * A convenience macro to free a block of memory that has * been allocated from the slice allocator. @@ -30115,11 +31258,12 @@ * It calls g_slice_free1() using `sizeof (type)` * as the block size. * Note that the exact release behaviour can be changed with the - * `G_DEBUG=gc-friendly`G_DEBUG environment variable, also see - * `G_SLICE`G_SLICE for related debugging options. + * `G_DEBUG=gc-friendly`G_DEBUG environment variable. * * If @mem is %NULL, this macro does nothing. * + * Since GLib 2.76 this always uses the system free() implementation internally. + * * Since: 2.10 */ @@ -30127,7 +31271,7 @@ /** * g_slice_free1: * @block_size: the size of the block - * @mem_block: a pointer to the block to free + * @mem_block: (nullable): a pointer to the block to free * * Frees a block of memory. * @@ -30135,10 +31279,13 @@ * g_slice_alloc0() and the @block_size has to match the size * specified upon allocation. Note that the exact release behaviour * can be changed with the `G_DEBUG=gc-friendly`G_DEBUG environment - * variable, also see `G_SLICE`G_SLICE for related debugging options. + * variable. * * If @mem_block is %NULL, this function does nothing. * + * Since GLib 2.76 this always uses the system free_sized() implementation + * internally. + * * Since: 2.10 */ @@ -30146,7 +31293,7 @@ /** * g_slice_free_chain: * @type: the type of the @mem_chain blocks - * @mem_chain: a pointer to the first block of the chain + * @mem_chain: (nullable): a pointer to the first block of the chain * @next: the field name of the next pointer in @type * * Frees a linked list of memory blocks of structure type @type. @@ -30156,11 +31303,12 @@ * a @next pointer (similar to #GSList). The name of the * @next field in @type is passed as third argument. * Note that the exact release behaviour can be changed with the - * `G_DEBUG=gc-friendly`G_DEBUG environment variable, also see - * `G_SLICE`G_SLICE for related debugging options. + * `G_DEBUG=gc-friendly`G_DEBUG environment variable. * * If @mem_chain is %NULL, this function does nothing. * + * Since GLib 2.76 this always uses the system free() implementation internally. + * * Since: 2.10 */ @@ -30168,7 +31316,7 @@ /** * g_slice_free_chain_with_offset: * @block_size: the size of the blocks - * @mem_chain: a pointer to the first block of the chain + * @mem_chain: (nullable): a pointer to the first block of the chain * @next_offset: the offset of the @next field in the blocks * * Frees a linked list of memory blocks of structure type @type. @@ -30178,11 +31326,13 @@ * @next pointer (similar to #GSList). The offset of the @next * field in each block is passed as third argument. * Note that the exact release behaviour can be changed with the - * `G_DEBUG=gc-friendly`G_DEBUG environment variable, also see - * `G_SLICE`G_SLICE for related debugging options. + * `G_DEBUG=gc-friendly`G_DEBUG environment variable. * * If @mem_chain is %NULL, this function does nothing. * + * Since GLib 2.76 this always uses the system free_sized() implementation + * internally. + * * Since: 2.10 */ @@ -30196,13 +31346,14 @@ * * It calls g_slice_alloc() with `sizeof (@type)` and casts the * returned pointer to a pointer of the given type, avoiding a type - * cast in the source code. Note that the underlying slice allocation - * mechanism can be changed with the `G_SLICE=always-malloc`G_SLICE - * environment variable. + * cast in the source code. * * This can never return %NULL as the minimum allocation size from * `sizeof (@type)` is 1 byte. * + * Since GLib 2.76 this always uses the system malloc() implementation + * internally. + * * Returns: (not nullable): a pointer to the allocated block, cast to a pointer * to @type * Since: 2.10 @@ -30219,13 +31370,13 @@ * It calls g_slice_alloc0() with `sizeof (@type)` * and casts the returned pointer to a pointer of the given type, * avoiding a type cast in the source code. - * Note that the underlying slice allocation mechanism can - * be changed with the `G_SLICE=always-malloc`G_SLICE - * environment variable. * * This can never return %NULL as the minimum allocation size from * `sizeof (@type)` is 1 byte. * + * Since GLib 2.76 this always uses the system malloc() implementation + * internally. + * * Returns: (not nullable): a pointer to the allocated block, cast to a pointer * to @type * Since: 2.10 @@ -30822,7 +31973,8 @@ /** * g_source_attach: * @source: a #GSource - * @context: (nullable): a #GMainContext (if %NULL, the default context will be used) + * @context: (nullable): a #GMainContext (if %NULL, the global-default + * main context will be used) * * Adds a #GSource to a @context so that it will be executed within * that context. Remove it by calling g_source_destroy(). @@ -32056,12 +33208,12 @@ * @dest: destination buffer. * @src: source string. * - * Copies a nul-terminated string into the dest buffer, include the - * trailing nul, and return a pointer to the trailing nul byte. - * This is useful for concatenating multiple strings together - * without having to repeatedly scan for the end. + * Copies a nul-terminated string into the destination buffer, including + * the trailing nul byte, and returns a pointer to the trailing nul byte + * in `dest`. The return value is useful for concatenating multiple + * strings without having to repeatedly scan for the end. * - * Returns: a pointer to trailing nul byte. + * Returns: a pointer to the trailing nul byte in `dest`. */ @@ -32820,12 +33972,29 @@ * it's %FALSE, the caller gains ownership of the buffer and must * free it after use with g_free(). * + * Instead of passing %FALSE to this function, consider using + * g_string_free_and_steal(). + * * Returns: (nullable): the character data of @string * (i.e. %NULL if @free_segment is %TRUE) */ /** + * g_string_free_and_steal: + * @string: (transfer full): a #GString + * + * Frees the memory allocated for the #GString. + * + * The caller gains ownership of the buffer and + * must free it after use with g_free(). + * + * Returns: (transfer full): the character data of @string + * Since: 2.76 + */ + + +/** * g_string_free_to_bytes: * @string: (transfer full): a #GString * @@ -33990,6 +35159,8 @@ * * This function returns a valid string only within a test function. * + * Note that this is a test path, not a file system path. + * * Returns: the test path for the test currently being run * Since: 2.68 */ @@ -34714,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. */ @@ -35052,6 +36224,11 @@ * since their threads are never considered idle and returned to the * global pool. * + * Note that the threads used by exclusive threadpools will all inherit the + * scheduler settings of the current thread while the threads used by + * non-exclusive threadpools will inherit the scheduler settings from the + * first thread that created such a threadpool. + * * @error can be %NULL to ignore errors, or non-%NULL to report * errors. An error can only occur when @exclusive is set to %TRUE * and not all @max_threads threads could be created. @@ -35394,7 +36571,7 @@ * g_time_zone_adjust_time: * @tz: a #GTimeZone * @type: the #GTimeType of @time_ - * @time_: a pointer to a number of seconds since January 1, 1970 + * @time_: (inout): a pointer to a number of seconds since January 1, 1970 * * Finds an interval within @tz that corresponds to the given @time_, * possibly adjusting @time_ if required to fit into an interval. @@ -36611,7 +37788,7 @@ /** * g_ucs4_to_utf16: - * @str: a UCS-4 encoded string + * @str: (array length=len) (element-type gunichar): a UCS-4 encoded string * @len: the maximum length (number of characters) of @str to use. * If @len < 0, then the string is nul-terminated. * @items_read: (out) (optional): location to store number of @@ -36635,7 +37812,7 @@ /** * g_ucs4_to_utf8: - * @str: a UCS-4 encoded string + * @str: (array length=len) (element-type gunichar): a UCS-4 encoded string * @len: the maximum length (number of characters) of @str to use. * If @len < 0, then the string is nul-terminated. * @items_read: (out) (optional): location to store number of @@ -37228,7 +38405,7 @@ /** * g_unicode_canonical_ordering: - * @string: a UCS-4 encoded string. + * @string: (array length=len) (element-type gunichar): a UCS-4 encoded string. * @len: the maximum length of @string to use. * * Computes the canonical ordering of a string in-place. @@ -38326,7 +39503,7 @@ /** * g_utf16_to_ucs4: - * @str: a UTF-16 encoded string + * @str: (array length=len) (element-type guint16): a UTF-16 encoded string * @len: the maximum length (number of #gunichar2) of @str to use. * If @len < 0, then the string is nul-terminated. * @items_read: (out) (optional): location to store number of @@ -38351,7 +39528,7 @@ /** * g_utf16_to_utf8: - * @str: a UTF-16 encoded string + * @str: (array length=len) (element-type guint16): a UTF-16 encoded string * @len: the maximum length (number of #gunichar2) of @str to use. * If @len < 0, then the string is nul-terminated. * @items_read: (out) (optional): location to store number of @@ -39274,7 +40451,13 @@ * 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. + * A full, not floating, reference is returned. * * Returns: (transfer full): the byteswapped form of @value * Since: 2.24 @@ -40028,7 +41211,9 @@ * 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 serialized @@ -40683,6 +41868,31 @@ /** + * 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.74 + */ + + +/** * g_variant_n_children: * @value: a container #GVariant * @@ -42678,49 +43888,72 @@ /** * gchar: * - * Corresponds to the standard C char type. + * Equivalent to the standard C `char` type. + * + * This type only exists for symmetry with `guchar`. + * The standard C `char` type should be preferred in new code. */ /** * gconstpointer: * - * An untyped pointer to constant data. + * An untyped pointer to constant data, exactly equivalent to `const void *`. + * * The data pointed to should not be changed. * * This is typically used in function prototypes to indicate * that the data pointed to will not be altered by the function. + * + * The standard C `const void *` type should usually be preferred in + * new code, but `gconstpointer` can be used in contexts where a type name + * must be a single word. */ /** * gdouble: * - * Corresponds to the standard C double type. - * Values of this type can range from -%G_MAXDOUBLE to %G_MAXDOUBLE. + * Equivalent to the standard C `double` type. + * + * Values of this type can range from `-DBL_MAX` to `DBL_MAX`, + * or equivalently from -%G_MAXDOUBLE to %G_MAXDOUBLE. */ /** * gfloat: * - * Corresponds to the standard C float type. - * Values of this type can range from -%G_MAXFLOAT to %G_MAXFLOAT. + * Equivalent to the standard C `float` type. + * + * Values of this type can range from `-FLT_MAX` to `FLT_MAX`, + * or equivalently from -%G_MAXFLOAT to %G_MAXFLOAT. */ /** * gint: * - * Corresponds to the standard C int type. - * Values of this type can range from %G_MININT to %G_MAXINT. + * Equivalent to the standard C `int` type. + * + * Values of this type can range from `INT_MIN` to `INT_MAX`, + * or equivalently from %G_MININT to %G_MAXINT. + * + * This type only exists for symmetry with `guint`. + * The standard C `int` type should be preferred in new code. */ /** * gint16: * - * A signed integer guaranteed to be 16 bits on all platforms. + * A signed integer guaranteed to be 16 bits on all platforms, + * similar to the standard C `int16_t`. + * + * The `int16_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires use of `gint16` + * (see #gsize for more details). + * * Values of this type can range from %G_MININT16 (= -32,768) to * %G_MAXINT16 (= 32,767). * @@ -42733,31 +43966,64 @@ * gint32: * * A signed integer guaranteed to be 32 bits on all platforms. + * + * The `int32_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires use of `gint16` + * (see #gsize for more details). + * * Values of this type can range from %G_MININT32 (= -2,147,483,648) * to %G_MAXINT32 (= 2,147,483,647). * * To print or scan values of this type, use * %G_GINT32_MODIFIER and/or %G_GINT32_FORMAT. + * + * Note that on platforms with more than one 32-bit standard integer type, + * `gint32` and `int32_t` are not necessarily implemented by the same + * 32-bit integer type. + * For example, on an ILP32 platform where `int` and `long` are both 32-bit, + * it might be the case that one of these types is `int` and the other + * is `long`. + * See #gsize for more details of what this implies. */ /** * gint64: * - * A signed integer guaranteed to be 64 bits on all platforms. + * A signed integer guaranteed to be 64 bits on all platforms, + * similar to the standard C `int64_t`. + * + * The `int64_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires use of `gint64` + * (see #gsize for more details). + * * Values of this type can range from %G_MININT64 * (= -9,223,372,036,854,775,808) to %G_MAXINT64 * (= 9,223,372,036,854,775,807). * * To print or scan values of this type, use * %G_GINT64_MODIFIER and/or %G_GINT64_FORMAT. + * + * Note that on platforms with more than one 64-bit standard integer type, + * `gint64` and `int64_t` are not necessarily implemented by the same + * 64-bit integer type. + * For example, on a platform where both `long` and `long long` are 64-bit, + * it might be the case that one of those types is used for `gint64` + * and the other is used for `int64_t`. + * See #gsize for more details of what this implies. */ /** * gint8: * - * A signed integer guaranteed to be 8 bits on all platforms. + * A signed integer guaranteed to be 8 bits on all platforms, + * similar to the standard C `int8_t`. + * + * The `int8_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires use of `gint8` + * (see #gsize for more details). + * * Values of this type can range from %G_MININT8 (= -128) to * %G_MAXINT8 (= 127). */ @@ -42769,6 +44035,14 @@ * Corresponds to the C99 type intptr_t, * a signed integer type that can hold any pointer. * + * The standard `intptr_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires `gintptr`. + * Note that `intptr_t` and `gintptr` might be implemented by different + * standard integer types of the same size. See #gsize for more details. + * + * #gintptr is not guaranteed to be the same type or the same size as #gssize, + * even though they are the same on many CPU architectures. + * * To print or scan values of this type, use * %G_GINTPTR_MODIFIER and/or %G_GINTPTR_FORMAT. * @@ -42909,8 +44183,13 @@ /** * glong: * - * Corresponds to the standard C long type. - * Values of this type can range from %G_MINLONG to %G_MAXLONG. + * Equivalent to the standard C `long` type. + * + * Values of this type can range from `LONG_MIN` to `LONG_MAX`, + * or equivalently %G_MINLONG to %G_MAXLONG. + * + * This type only exists for symmetry with `gulong`. + * The standard C `long` type should be preferred in new code. */ @@ -42920,13 +44199,18 @@ * A signed integer type that is used for file offsets, * corresponding to the POSIX type `off_t` as if compiling with * `_FILE_OFFSET_BITS` set to 64. #goffset is always 64 bits wide, even on - * 32-bit architectures. + * 32-bit architectures, and even if `off_t` is only 32 bits. * Values of this type can range from %G_MINOFFSET to * %G_MAXOFFSET. * * To print or scan values of this type, use * %G_GOFFSET_MODIFIER and/or %G_GOFFSET_FORMAT. * + * On platforms with more than one 64-bit standard integer type, + * even if `off_t` is also 64 bits in size, `goffset` and `off_t` are not + * necessarily implemented by the same 64-bit integer type. + * See #gsize for more details of what this implies. + * * Since: 2.14 */ @@ -42934,8 +44218,13 @@ /** * gpointer: * - * An untyped pointer. - * #gpointer looks better and is easier to use than void*. + * An untyped pointer, exactly equivalent to `void *`. + * + * The standard C `void *` type should usually be preferred in + * new code, but `gpointer` can be used in contexts where a type name + * must be a single word, such as in the g_type_name() of %G_TYPE_POINTER + * or when generating a family of function names for multiple types + * using macros. */ @@ -42961,23 +44250,62 @@ /** * gshort: * - * Corresponds to the standard C short type. - * Values of this type can range from %G_MINSHORT to %G_MAXSHORT. + * Equivalent to the standard C `short` type. + * + * Values of this type can range from `SHRT_MIN` to `SHRT_MAX`, + * or equivalently %G_MINSHORT to %G_MAXSHORT. + * + * This type only exists for symmetry with `gushort`. + * The standard C `short` type should be preferred in new code. */ /** * gsize: * - * An unsigned integer type of the result of the sizeof operator, - * corresponding to the size_t type defined in C99. - * This type is wide enough to hold the numeric value of a pointer, - * so it is usually 32 bit wide on a 32-bit platform and 64 bit wide + * An unsigned integer type of the result of the `sizeof` operator, + * corresponding to the `size_t` type defined in C99. + * + * The standard `size_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires `gsize` + * (see below for more details). + * + * `gsize` is usually 32 bit wide on a 32-bit platform and 64 bit wide * on a 64-bit platform. Values of this type can range from 0 to * %G_MAXSIZE. * + * This type is wide enough to hold the size of the largest possible + * memory allocation, but is not guaranteed to be wide enough to hold + * the numeric value of a pointer: on platforms that use tagged pointers, + * such as CHERI(https://cheri-cpu.org/), pointers can be numerically + * larger than the size of the address space. + * If the numeric value of a pointer needs to be stored in an integer + * without information loss, use the standard C types `intptr_t` or + * `uintptr_t`, or the similar GLib types #gintptr or #guintptr. + * * To print or scan values of this type, use * %G_GSIZE_MODIFIER and/or %G_GSIZE_FORMAT. + * + * Note that on platforms where more than one standard integer type is + * the same size, `size_t` and `gsize` are always the same size but are + * not necessarily implemented by the same standard integer type. + * For example, on an ILP32 platform where `int`, `long` and pointers + * are all 32-bit, `size_t` might be `unsigned long` while `gsize` + * might be `unsigned int`. + * This can result in compiler warnings or unexpected C++ name-mangling + * if the two types are used inconsistently. + * + * As a result, changing a type from `gsize` to `size_t` in existing APIs + * might be an incompatible API or ABI change, especially if C++ + * is involved. The safe option is to leave existing APIs using the same type + * that they have historically used, and only use the standard C types in + * new APIs. + * + * Similar considerations apply to all the fixed-size types + * (#gint8, #guint8, #gint16, #guint16, #gint32, #guint32, #gint64, + * #guint64 and #goffset), as well as #gintptr and #guintptr. + * Types that are 32 bits or larger are particularly likely to be + * affected by this. */ @@ -42985,10 +44313,23 @@ * gssize: * * A signed variant of #gsize, corresponding to the - * ssize_t defined on most platforms. + * `ssize_t` defined in POSIX or the similar `SSIZE_T` in Windows. + * + * In new platform-specific code, consider using `ssize_t` or `SSIZE_T` + * directly. + * * Values of this type can range from %G_MINSSIZE * to %G_MAXSSIZE. * + * Note that on platforms where `ssize_t` is implemented, `ssize_t` and + * `gssize` might be implemented by different standard integer types + * of the same size. Similarly, on Windows, `SSIZE_T` and `gssize` + * might be implemented by different standard integer types of the same + * size. See #gsize for more details. + * + * This type is also not guaranteed to be the same as standard C + * `ptrdiff_t`, although they are the same on many platforms. + * * To print or scan values of this type, use * %G_GSSIZE_MODIFIER and/or %G_GSSIZE_FORMAT. */ @@ -42997,22 +44338,42 @@ /** * guchar: * - * Corresponds to the standard C unsigned char type. + * Equivalent to the standard C `unsigned char` type. + * + * The standard C `unsigned char` type should usually be preferred in + * new code, but `guchar` can be used in contexts where a type name + * must be a single word, such as in the g_type_name() of %G_TYPE_UCHAR + * or when generating a family of function names for multiple types + * using macros. */ /** * guint: * - * Corresponds to the standard C unsigned int type. - * Values of this type can range from 0 to %G_MAXUINT. + * Equivalent to the standard C `unsigned int` type. + * + * Values of this type can range from 0 to `UINT_MAX`, + * or equivalently 0 to %G_MAXUINT. + * + * The standard C `unsigned int` type should usually be preferred in + * new code, but `guint` can be used in contexts where a type name + * must be a single word, such as in the g_type_name() of %G_TYPE_UINT + * or when generating a family of function names for multiple types + * using macros. */ /** * guint16: * - * An unsigned integer guaranteed to be 16 bits on all platforms. + * An unsigned integer guaranteed to be 16 bits on all platforms, + * similar to the standard C `uint16_t`. + * + * The `uint16_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires use of `guint16` + * (see #gsize for more details). + * * Values of this type can range from 0 to %G_MAXUINT16 (= 65,535). * * To print or scan values of this type, use @@ -43023,30 +44384,58 @@ /** * guint32: * - * An unsigned integer guaranteed to be 32 bits on all platforms. + * An unsigned integer guaranteed to be 32 bits on all platforms, + * similar to the standard C `uint32_t`. + * + * The `uint32_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires use of `guint32` + * (see #gsize for more details). + * * Values of this type can range from 0 to %G_MAXUINT32 (= 4,294,967,295). * * To print or scan values of this type, use * %G_GINT32_MODIFIER and/or %G_GUINT32_FORMAT. + * + * Note that on platforms with more than one 32-bit standard integer type, + * `guint32` and `uint32_t` are not necessarily implemented by the same + * 32-bit integer type. + * See #gsize for more details of what this implies. */ /** * guint64: * - * An unsigned integer guaranteed to be 64-bits on all platforms. + * An unsigned integer guaranteed to be 64-bits on all platforms, + * similar to the standard C `uint64_t` type. + * + * The `uint64_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires use of `guint64` + * (see #gsize for more details). + * * Values of this type can range from 0 to %G_MAXUINT64 * (= 18,446,744,073,709,551,615). * * To print or scan values of this type, use * %G_GINT64_MODIFIER and/or %G_GUINT64_FORMAT. + * + * Note that on platforms with more than one 64-bit standard integer type, + * `guint64` and `uint64_t` are not necessarily implemented by the same + * 64-bit integer type. + * See #gsize for more details of what this implies. */ /** * guint8: * - * An unsigned integer guaranteed to be 8 bits on all platforms. + * An unsigned integer guaranteed to be 8 bits on all platforms, + * similar to the standard C `uint8_t`. + * + * The `uint8_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires use of `guint8` + * (see #gsize for more details). + * * Values of this type can range from 0 to %G_MAXUINT8 (= 255). */ @@ -43057,6 +44446,14 @@ * Corresponds to the C99 type uintptr_t, * an unsigned integer type that can hold any pointer. * + * The standard `uintptr_t` type should be preferred in new code, unless + * consistency with pre-existing APIs requires `guintptr`. + * Note that `uintptr_t` and `guintptr` might be implemented by different + * standard integer types of the same size. See #gsize for more details. + * + * #guintptr is not guaranteed to be the same type or the same size as #gsize, + * even though they are the same on many CPU architectures. + * * To print or scan values of this type, use * %G_GINTPTR_MODIFIER and/or %G_GUINTPTR_FORMAT. * @@ -43067,16 +44464,30 @@ /** * gulong: * - * Corresponds to the standard C unsigned long type. + * Equivalent to the standard C `unsigned long` type. + * * Values of this type can range from 0 to %G_MAXULONG. + * + * The standard C `unsigned long` type should usually be preferred in + * new code, but `gulong` can be used in contexts where a type name + * must be a single word, such as in the g_type_name() of %G_TYPE_ULONG + * or when generating a family of function names for multiple types + * using macros. */ /** * gushort: * - * Corresponds to the standard C unsigned short type. - * Values of this type can range from 0 to %G_MAXUSHORT. + * Equivalent to the standard C `unsigned short` type. + * + * Values of this type can range from 0 to `USHRT_MAX`, + * or equivalently from 0 to %G_MAXUSHORT. + * + * The standard C `unsigned short` type should usually be preferred in + * new code, but `gushort` can be used in contexts where a type name + * must be a single word, such as when generating a family of function + * names for multiple types using macros. */
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/gir/gmodule-2.0.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/gir/gmodule-2.0.c
Changed
@@ -57,6 +57,11 @@ * non-default * visibility flag(https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fvisibility-1260) * such as `hidden`. + * + * This macro must only be used when compiling a shared module. Modules that + * support both shared and static linking should define their own macro that + * expands to %G_MODULE_EXPORT when compiling the shared module, but is empty + * when compiling the static module on Windows. */ @@ -70,9 +75,24 @@ /** * G_MODULE_SUFFIX: * - * Expands to the proper shared library suffix for the current platform - * without the leading dot. For most Unices and Linux this is "so", and - * for Windows this is "dll". + * Expands to a shared library suffix for the current platform without the + * leading dot. On Unixes this is "so", and on Windows this is "dll". + * + * Deprecated: 2.76: Use g_module_open() instead with @module_name as the + * basename of the file_name argument. You will get the wrong results using + * this macro most of the time: + * + * 1. The suffix on macOS is usually 'dylib', but it's 'so' when using + * Autotools, so there's no way to get the suffix correct using + * a pre-processor macro. + * 2. Prefixes also vary in a platform-specific way. You may or may not have + * a 'lib' prefix for the name on Windows and on Cygwin the prefix is + * 'cyg'. + * 3. The library name itself can vary per platform. For instance, you may + * want to load foo-1.dll on Windows and libfoo.1.dylib on macOS. + * + * g_module_open() takes care of all this by searching the filesystem for + * combinations of possible suffixes and prefixes. */ @@ -179,6 +199,8 @@ * * Returns: the complete path of the module, including the standard library * prefix and suffix. This should be freed when no longer needed + * Deprecated: 2.76: Use g_module_open() instead with @module_name as the + * basename of the file_name argument. See %G_MODULE_SUFFIX for why. */ @@ -224,8 +246,8 @@ /** * g_module_open: - * @file_name: (nullable): the name of the file containing the module, or %NULL - * to obtain a #GModule representing the main program itself + * @file_name: (nullable): the name or path to the file containing the module, + * or %NULL to obtain a #GModule representing the main program itself * @flags: the flags used for opening the module. This can be the * logical OR of any of the #GModuleFlags. * @@ -237,24 +259,28 @@ /** * g_module_open_full: - * @file_name: (nullable): the name of the file containing the module, or %NULL - * to obtain a #GModule representing the main program itself + * @file_name: (nullable): the name or path to the file containing the module, + * or %NULL to obtain a #GModule representing the main program itself * @flags: the flags used for opening the module. This can be the * logical OR of any of the #GModuleFlags * @error: #GError. * - * Opens a module. If the module has already been opened, - * its reference count is incremented. - * - * First of all g_module_open_full() tries to open @file_name as a module. - * If that fails and @file_name has the ".la"-suffix (and is a libtool - * archive) it tries to open the corresponding module. If that fails - * and it doesn't have the proper module suffix for the platform - * (%G_MODULE_SUFFIX), this suffix will be appended and the corresponding - * module will be opened. If that fails and @file_name doesn't have the - * ".la"-suffix, this suffix is appended and g_module_open_full() tries to open - * the corresponding module. If eventually that fails as well, %NULL is - * returned. + * Opens a module. If the module has already been opened, its reference count + * is incremented. If not, the module is searched in the following order: + * + * 1. If @file_name exists as a regular file, it is used as-is; else + * 2. If @file_name doesn't have the correct suffix and/or prefix for the + * platform, then possible suffixes and prefixes will be added to the + * basename till a file is found and whatever is found will be used; else + * 3. If @file_name doesn't have the ".la"-suffix, ".la" is appended. Either + * way, if a matching .la file exists (and is a libtool archive) the + * libtool archive is parsed to find the actual file name, and that is + * used. + * + * At the end of all this, we would have a file path that we can access on + * disk, and it is opened as a module. If not, @file_name is opened as + * a module verbatim in the hopes that the system implementation will somehow + * be able to access it. * * Returns: a #GModule on success, or %NULL on failure * Since: 2.70
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/gir/gobject-2.0.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/gir/gobject-2.0.c
Changed
@@ -2088,7 +2088,7 @@ * * @destroy_data will be called as a finalize notifier on the #GClosure. * - * Returns: (transfer none): a floating reference to a new #GCClosure + * Returns: (transfer floating): a floating reference to a new #GCClosure */ @@ -2133,7 +2133,7 @@ * * @destroy_data will be called as a finalize notifier on the #GClosure. * - * Returns: (transfer none): a floating reference to a new #GCClosure + * Returns: (transfer floating): a floating reference to a new #GCClosure */ @@ -2322,7 +2322,7 @@ * } * | * - * Returns: (transfer none): a floating reference to a new #GClosure + * Returns: (transfer floating): a floating reference to a new #GClosure */ @@ -3331,7 +3331,7 @@ * @object_type: the type id of the #GObject subtype to instantiate * @first_property_name: the name of the first property * @...: the value of the first property, followed optionally by more - * name/value pairs, followed by %NULL + * name/value pairs, followed by %NULL * * Creates a new instance of a #GObject subtype and sets its properties. * @@ -3341,22 +3341,22 @@ * per g_type_create_instance(). * * Note that in C, small integer types in variable argument lists are promoted - * up to #gint or #guint as appropriate, and read back accordingly. #gint is 32 - * bits on every platform on which GLib is currently supported. This means that - * you can use C expressions of type #gint with g_object_new() and properties of - * type #gint or #guint or smaller. Specifically, you can use integer literals + * up to `gint` or `guint` as appropriate, and read back accordingly. `gint` is + * 32 bits on every platform on which GLib is currently supported. This means that + * you can use C expressions of type `gint` with g_object_new() and properties of + * type `gint` or `guint` or smaller. Specifically, you can use integer literals * with these property types. * - * When using property types of #gint64 or #guint64, you must ensure that the + * When using property types of `gint64` or `guint64`, you must ensure that the * value that you provide is 64 bit. This means that you should use a cast or * make use of the %G_GINT64_CONSTANT or %G_GUINT64_CONSTANT macros. * - * Similarly, #gfloat is promoted to #gdouble, so you must ensure that the value - * you provide is a #gdouble, even for a property of type #gfloat. + * Similarly, `gfloat` is promoted to `gdouble`, so you must ensure that the value + * you provide is a `gdouble`, even for a property of type `gfloat`. * * Since GLib 2.72, all #GObjects are guaranteed to be aligned to at least the - * alignment of the largest basic GLib type (typically this is #guint64 or - * #gdouble). If you need larger alignment for an element in a #GObject, you + * alignment of the largest basic GLib type (typically this is `guint64` or + * `gdouble`). If you need larger alignment for an element in a #GObject, you * should allocate it on the heap (aligned), or arrange for your #GObject to be * appropriately padded. * @@ -4842,6 +4842,9 @@ * * Connects a closure to a signal for a particular object. * + * If @closure is a floating reference (see g_closure_sink()), this function + * takes ownership of @closure. + * * Returns: the handler ID (always greater than 0 for successful connections) */ @@ -4857,6 +4860,9 @@ * * Connects a closure to a signal for a particular object. * + * If @closure is a floating reference (see g_closure_sink()), this function + * takes ownership of @closure. + * * Returns: the handler ID (always greater than 0 for successful connections) */ @@ -5694,7 +5700,7 @@ * @struct_offset in the class structure of the interface or classed type * identified by @itype. * - * Returns: (transfer none): a floating reference to a new #GCClosure + * Returns: (transfer floating): a floating reference to a new #GCClosure */ @@ -6522,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 */ @@ -6899,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 */ @@ -6911,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. */ @@ -6934,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 */ @@ -6978,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 */ @@ -7083,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 */ @@ -7124,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 */ @@ -7590,7 +7596,7 @@ /** * g_value_take_string: * @value: a valid #GValue of type %G_TYPE_STRING - * @v_string: (nullable): string to take ownership of + * @v_string: (nullable) (transfer full): string to take ownership of * * Sets the contents of a %G_TYPE_STRING #GValue to @v_string. *
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/gir/meson.build -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/gir/meson.build
Changed
@@ -107,6 +107,7 @@ glib_libdir = get_option('gi_cross_pkgconfig_sysroot_path') + glib_dep.get_variable(pkgconfig: 'libdir') glib_incdir = get_option('gi_cross_pkgconfig_sysroot_path') + join_paths(glib_dep.get_variable(pkgconfig: 'includedir'), 'glib-2.0') glib_libincdir = join_paths(glib_libdir, 'glib-2.0', 'include') + glib_files += join_paths(glib_incdir, 'gobject', 'gobject-visibility.h') glib_files += join_paths(glib_incdir, 'gobject', 'glib-types.h') glib_files += join_paths(glib_libincdir, 'glibconfig.h') if giounix_dep.found() @@ -238,9 +239,11 @@ depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, + env: g_ir_scanner_env, command: glib_command + '--cflags-begin' + glib_includes + extra_giscanner_cflags + '-DGLIB_COMPILATION', + '-DGOBJECT_COMPILATION', '-D__G_I18N_LIB_H__', '-DGETTEXT_PACKAGE=Dummy', '--cflags-end', @@ -305,9 +308,11 @@ depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, + env: g_ir_scanner_env, command: gobject_command + '--include-uninstalled=' + glib_gir.full_path(), '--cflags-begin' + glib_includes + extra_giscanner_cflags + + '-DGLIB_COMPILATION', '-DGOBJECT_COMPILATION', '--cflags-end', '@INPUT@', @@ -357,9 +362,11 @@ depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, + env: g_ir_scanner_env, command: gmodule_command + '--include-uninstalled=' + glib_gir.full_path(), '--cflags-begin' + glib_includes + extra_giscanner_cflags + + '-DGMODULE_COMPILATION', '--cflags-end', '@INPUT@', @@ -452,6 +459,7 @@ depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, + env: g_ir_scanner_env, command: gio_command + '--include-uninstalled=' + gobject_gir.full_path(), '--cflags-begin' + glib_includes + extra_giscanner_cflags + @@ -489,6 +497,7 @@ depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, + env: g_ir_scanner_env, command: girepository_command + '--include-uninstalled=' + gobject_gir.full_path(), '--cflags-begin' + glib_includes + extra_giscanner_cflags +
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/cmph/chd_ph.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/cmph/chd_ph.c
Changed
@@ -579,7 +579,7 @@ { register cmph_uint32 bucket_size, i, j; register cmph_uint32 position, probe0_num, probe1_num; - register cmph_uint32 m = 0; + G_GNUC_UNUSED register cmph_uint32 m = 0; register chd_ph_item_t * item; if(chd_ph->keys_per_bin > 1) memset(chd_ph->occup_table, 0, chd_ph->n); @@ -596,7 +596,9 @@ probe1_num = disp_tablebucketsi.bucket_id / chd_ph->n; for(; j > 0; j--) { +#ifdef DEBUG m++; +#endif position = (cmph_uint32)((item->f + ((cmph_uint64 )item->h) * probe0_num + probe1_num) % chd_ph->n); if(chd_ph->keys_per_bin > 1) {
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/cmph/fch.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/cmph/fch.c
Changed
@@ -21,7 +21,7 @@ static void permut(cmph_uint32 * vector, cmph_uint32 n); static cmph_uint8 searching(fch_config_data_t *fch, fch_buckets_t *buckets, cmph_uint32 *sorted_indexes); -fch_config_data_t *fch_config_new() +fch_config_data_t *fch_config_new(void) { fch_config_data_t *fch; fch = (fch_config_data_t *)malloc(sizeof(fch_config_data_t));
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/gdump.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/gdump.c
Changed
@@ -119,6 +119,76 @@ return sym (); } +static char * +value_transform_to_string (const GValue *value) +{ + GValue tmp = G_VALUE_INIT; + char *s = NULL; + + g_value_init (&tmp, G_TYPE_STRING); + + if (g_value_transform (value, &tmp)) + { + const char *str = g_value_get_string (&tmp); + + if (str != NULL) + s = g_strescape (str, NULL); + } + + g_value_unset (&tmp); + + return s; +} + +/* A simpler version of g_strdup_value_contents(), but with stable + * output and less complex semantics + */ +static char * +value_to_string (const GValue *value) +{ + if (value == NULL) + return NULL; + + if (G_VALUE_HOLDS_STRING (value)) + { + const char *s = g_value_get_string (value); + + if (s == NULL) + return g_strdup ("NULL"); + + return g_strescape (s, NULL); + } + else + { + GType value_type = G_VALUE_TYPE (value); + + switch (G_TYPE_FUNDAMENTAL (value_type)) + { + case G_TYPE_BOXED: + if (g_value_get_boxed (value) == NULL) + return NULL; + else + return value_transform_to_string (value); + break; + + case G_TYPE_OBJECT: + if (g_value_get_object (value) == NULL) + return NULL; + else + return value_transform_to_string (value); + break; + + case G_TYPE_POINTER: + return NULL; + + default: + return value_transform_to_string (value); + } + } + + return NULL; +} + static void dump_properties (GType type, GOutputStream *out) { @@ -147,9 +217,28 @@ if (prop->owner_type != type) continue; - escaped_printf (out, " <property name=\"%s\" type=\"%s\" flags=\"%d\"/>\n", - prop->name, g_type_name (prop->value_type), prop->flags); + const GValue *v = g_param_spec_get_default_value (prop); + char *default_value = value_to_string (v); + + if (v != NULL && default_value != NULL) + { + escaped_printf (out, " <property name=\"%s\" type=\"%s\" flags=\"%d\" default-value=\"%s\"/>\n", + prop->name, + g_type_name (prop->value_type), + prop->flags, + default_value); + } + else + { + escaped_printf (out, " <property name=\"%s\" type=\"%s\" flags=\"%d\"/>\n", + prop->name, + g_type_name (prop->value_type), + prop->flags); + } + + g_free (default_value); } + g_free (props); }
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/girmodule.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/girmodule.c
Changed
@@ -74,6 +74,7 @@ g_list_free (module->include_modules); g_hash_table_destroy (module->aliases); + g_hash_table_destroy (module->pointer_structures); g_hash_table_destroy (module->disguised_structures); g_slice_free (GIrModule, module); @@ -142,6 +143,16 @@ } static void +add_pointer_structure_foreach (gpointer key, + gpointer value, + gpointer data) +{ + GIrModule *module = data; + + g_hash_table_replace (module->pointer_structures, g_strdup (key), value); +} + +static void add_disguised_structure_foreach (gpointer key, gpointer value, gpointer data) @@ -162,6 +173,9 @@ add_alias_foreach, module); + g_hash_table_foreach (include_module->pointer_structures, + add_pointer_structure_foreach, + module); g_hash_table_foreach (include_module->disguised_structures, add_disguised_structure_foreach, module);
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/girmodule.h -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/girmodule.h
Changed
@@ -55,8 +55,13 @@ /* Aliases defined in the module or in included modules */ GHashTable *aliases; - /* Structures with the 'disguised' flag (typedef struct _X *X) - * in the module or in included modules */ + /* Structures with the 'pointer' flag (typedef struct _X *X) + * in the module or in included modules + */ + GHashTable *pointer_structures; + /* Same as 'pointer' structures, but with the deprecated + * 'disguised' flag + */ GHashTable *disguised_structures; };
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/girnode.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/girnode.c
Changed
@@ -370,6 +370,8 @@ g_free (node->name); g_free (struct_->gtype_name); g_free (struct_->gtype_init); + g_free (struct_->copy_func); + g_free (struct_->free_func); for (l = struct_->members; l; l = l->next) _g_ir_node_free ((GIrNode *)l->data); @@ -403,6 +405,8 @@ g_free (node->name); g_free (union_->gtype_name); g_free (union_->gtype_init); + g_free (union_->copy_func); + g_free (union_->free_func); _g_ir_node_free ((GIrNode *)union_->discriminator_type); for (l = union_->members; l; l = l->next) @@ -755,6 +759,10 @@ size += ALIGN_VALUE (strlen (struct_->gtype_name) + 1, 4); if (struct_->gtype_init) size += ALIGN_VALUE (strlen (struct_->gtype_init) + 1, 4); + if (struct_->copy_func) + size += ALIGN_VALUE (strlen (struct_->copy_func) + 1, 4); + if (struct_->free_func) + size += ALIGN_VALUE (strlen (struct_->free_func) + 1, 4); for (l = struct_->members; l; l = l->next) size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); } @@ -855,6 +863,10 @@ size += ALIGN_VALUE (strlen (union_->gtype_name) + 1, 4); if (union_->gtype_init) size += ALIGN_VALUE (strlen (union_->gtype_init) + 1, 4); + if (union_->copy_func) + size += ALIGN_VALUE (strlen (union_->copy_func) + 1, 4); + if (union_->free_func) + size += ALIGN_VALUE (strlen (union_->free_func) + 1, 4); for (l = union_->members; l; l = l->next) size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); for (l = union_->discriminators; l; l = l->next) @@ -1956,6 +1968,11 @@ blob->gtype_init = 0; } + if (struct_->copy_func) + blob->copy_func = _g_ir_write_string (struct_->copy_func, strings, data, offset2); + if (struct_->free_func) + blob->free_func = _g_ir_write_string (struct_->free_func, strings, data, offset2); + blob->n_fields = 0; blob->n_methods = 0; @@ -2040,6 +2057,11 @@ blob->discriminator_offset = union_->discriminator_offset; + if (union_->copy_func) + blob->copy_func = _g_ir_write_string (union_->copy_func, strings, data, offset2); + if (union_->free_func) + blob->free_func = _g_ir_write_string (union_->free_func, strings, data, offset2); + /* We don't support Union discriminators right now. */ /* if (union_->discriminator_type)
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/girnode.h -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/girnode.h
Changed
@@ -322,12 +322,17 @@ gboolean deprecated; gboolean disguised; + gboolean opaque; + gboolean pointer; gboolean is_gtype_struct; gboolean foreign; gchar *gtype_name; gchar *gtype_init; + gchar *copy_func; + gchar *free_func; + gint alignment; gint size; @@ -346,6 +351,9 @@ gchar *gtype_name; gchar *gtype_init; + gchar *copy_func; + gchar *free_func; + gint alignment; gint size;
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/girparser.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/girparser.c
Changed
@@ -114,6 +114,7 @@ GList *dependencies; GHashTable *aliases; GHashTable *disguised_structures; + GHashTable *pointer_structures; const char *file_path; const char *namespace; @@ -235,11 +236,20 @@ { const gchar *name; const gchar *disguised; + const gchar *pointer; name = find_attribute ("name", attribute_names, attribute_values); disguised = find_attribute ("disguised", attribute_names, attribute_values); + pointer = find_attribute ("pointer", attribute_names, attribute_values); - if (disguised && strcmp (disguised, "1") == 0) + if (g_strcmp0 (pointer, "1") == 0) + { + char *key; + + key = g_strdup_printf ("%s.%s", ctx->namespace, name); + g_hash_table_replace (ctx->pointer_structures, key, GINT_TO_POINTER (1)); + } + else if (g_strcmp0 (disguised, "1") == 0) { char *key; @@ -477,7 +487,9 @@ static GIrNodeType * parse_type_internal (GIrModule *module, - const gchar *str, char **next, gboolean in_glib, + const gchar *str, + char **next, + gboolean in_glib, gboolean in_gobject) { const BasicTypeInfo *basic; @@ -658,12 +670,14 @@ return lookup; } -static gboolean -is_disguised_structure (ParseContext *ctx, const gchar *type) +static void +is_pointer_or_disguised_structure (ParseContext *ctx, + const gchar *type, + gboolean *is_pointer, + gboolean *is_disguised) { const gchar *lookup; gchar *prefixed; - gboolean result; if (strchr (type, '.') == NULL) { @@ -676,12 +690,12 @@ prefixed = NULL; } - result = g_hash_table_lookup (ctx->current_module->disguised_structures, - lookup) != NULL; + if (is_pointer != NULL) + *is_pointer = g_hash_table_lookup (ctx->current_module->pointer_structures, lookup) != NULL; + if (is_disguised != NULL) + *is_disguised = g_hash_table_lookup (ctx->current_module->disguised_structures, lookup) != NULL; g_free (prefixed); - - return result; } static GIrNodeType * @@ -2094,12 +2108,22 @@ typenode = parse_type (ctx, name); - /* A 'disguised' structure is one where the c:type is a typedef that - * doesn't look like a pointer, but is internally. + /* A "pointer" structure is one where the c:type is a typedef that + * to a pointer to a structure; we used to call them "disguised" + * structures as well. */ - if (typenode->tag == GI_TYPE_TAG_INTERFACE && - is_disguised_structure (ctx, typenode->giinterface)) - pointer_depth++; + if (typenode->tag == GI_TYPE_TAG_INTERFACE) + { + gboolean is_pointer = FALSE; + gboolean is_disguised = FALSE; + + is_pointer_or_disguised_structure (ctx, typenode->giinterface, + &is_pointer, + &is_disguised); + + if (is_pointer || is_disguised) + pointer_depth++; + } if (pointer_depth > 0) typenode->is_pointer = TRUE; @@ -2556,10 +2580,14 @@ const gchar *name; const gchar *deprecated; const gchar *disguised; + const gchar *opaque; + const gchar *pointer; const gchar *gtype_name; const gchar *gtype_init; const gchar *gtype_struct; const gchar *foreign; + const gchar *copy_func; + const gchar *free_func; GIrNodeStruct *struct_; if (!(strcmp (element_name, "record") == 0 && @@ -2575,10 +2603,14 @@ name = find_attribute ("name", attribute_names, attribute_values); deprecated = find_attribute ("deprecated", attribute_names, attribute_values); disguised = find_attribute ("disguised", attribute_names, attribute_values); + pointer = find_attribute ("pointer", attribute_names, attribute_values); + opaque = find_attribute ("opaque", attribute_names, attribute_values); gtype_name = find_attribute ("glib:type-name", attribute_names, attribute_values); gtype_init = find_attribute ("glib:get-type", attribute_names, attribute_values); gtype_struct = find_attribute ("glib:is-gtype-struct-for", attribute_names, attribute_values); foreign = find_attribute ("foreign", attribute_names, attribute_values); + copy_func = find_attribute ("copy-function", attribute_names, attribute_values); + free_func = find_attribute ("free-function", attribute_names, attribute_values); if (name == NULL && ctx->node_stack == NULL) { @@ -2605,9 +2637,15 @@ else struct_->deprecated = FALSE; - if (disguised && strcmp (disguised, "1") == 0) + if (g_strcmp0 (disguised, "1") == 0) struct_->disguised = TRUE; + if (g_strcmp0 (pointer, "1") == 0) + struct_->pointer = TRUE; + + if (g_strcmp0 (opaque, "1") == 0) + struct_->opaque = TRUE; + struct_->is_gtype_struct = gtype_struct != NULL; struct_->gtype_name = g_strdup (gtype_name); @@ -2615,6 +2653,9 @@ struct_->foreign = (g_strcmp0 (foreign, "1") == 0); + struct_->copy_func = g_strdup (copy_func); + struct_->free_func = g_strdup (free_func); + if (ctx->node_stack == NULL) ctx->current_module->entries = g_list_append (ctx->current_module->entries, struct_); @@ -2634,6 +2675,8 @@ const gchar *deprecated; const gchar *typename; const gchar *typeinit; + const gchar *copy_func; + const gchar *free_func; GIrNodeUnion *union_; if (!(strcmp (element_name, "union") == 0 && @@ -2650,6 +2693,8 @@ deprecated = find_attribute ("deprecated", attribute_names, attribute_values); typename = find_attribute ("glib:type-name", attribute_names, attribute_values); typeinit = find_attribute ("glib:get-type", attribute_names, attribute_values); + copy_func = find_attribute ("copy-function", attribute_names, attribute_values); + free_func = find_attribute ("free-function", attribute_names, attribute_values); if (name == NULL && ctx->node_stack == NULL) { @@ -2663,6 +2708,8 @@ ((GIrNode *)union_)->name = g_strdup (name ? name : ""); union_->gtype_name = g_strdup (typename); union_->gtype_init = g_strdup (typeinit); + union_->copy_func = g_strdup (copy_func); + union_->free_func = g_strdup (free_func); if (deprecated) union_->deprecated = TRUE; else @@ -3018,7 +3065,9 @@ ctx->current_module->aliases = ctx->aliases; ctx->aliases = NULL; ctx->current_module->disguised_structures = ctx->disguised_structures; + ctx->current_module->pointer_structures = ctx->pointer_structures; ctx->disguised_structures = NULL; + ctx->pointer_structures = NULL; for (l = ctx->include_modules; l; l = l->next) _g_ir_module_add_include_module (ctx->current_module, l->data); @@ -3607,6 +3656,7 @@ ctx.include_modules = NULL; ctx.aliases = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); ctx.disguised_structures = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + ctx.pointer_structures = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); ctx.type_depth = 0; ctx.dependencies = NULL; ctx.current_module = NULL; @@ -3639,10 +3689,9 @@ /* An error occurred before we created a module, so we haven't * transferred ownership of these hash tables to the module. */ - if (ctx.aliases != NULL) - g_hash_table_destroy (ctx.aliases); - if (ctx.disguised_structures != NULL) - g_hash_table_destroy (ctx.disguised_structures); + g_clear_pointer (&ctx.aliases, g_hash_table_unref); + g_clear_pointer (&ctx.disguised_structures, g_hash_table_unref); + g_clear_pointer (&ctx.pointer_structures, g_hash_table_unref); g_list_free (ctx.include_modules); }
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/girwriter.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/girwriter.c
Changed
@@ -642,6 +642,7 @@ const gchar *name; const gchar *type_name; const gchar *type_init; + const gchar *func; gboolean deprecated; gboolean is_gtype_struct; gboolean foreign; @@ -676,6 +677,14 @@ if (is_gtype_struct) xml_printf (file, " glib:is-gtype-struct=\"1\""); + func = g_struct_info_get_copy_function (info); + if (func) + xml_printf (file, " copy-function=\"%s\"", func); + + func = g_struct_info_get_free_function (info); + if (func) + xml_printf (file, " free-function=\"%s\"", func); + write_attributes (file, (GIBaseInfo*) info); size = g_struct_info_get_size (info); @@ -1237,6 +1246,7 @@ const gchar *name; const gchar *type_name; const gchar *type_init; + const gchar *func; gboolean deprecated; gint i; gint size; @@ -1260,6 +1270,14 @@ if (file->show_all && size >= 0) xml_printf (file, " size=\"%d\"", size); + func = g_union_info_get_copy_function (info); + if (func) + xml_printf (file, " copy-function=\"%s\"", func); + + func = g_union_info_get_free_function (info); + if (func) + xml_printf (file, " free-function=\"%s\"", func); + write_attributes (file, (GIBaseInfo*) info); if (g_union_info_is_discriminated (info))
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/gistructinfo.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/gistructinfo.c
Changed
@@ -281,3 +281,57 @@ return blob->is_gtype_struct; } + +/** + * g_struct_info_get_copy_function: + * @info: a struct information blob + * + * Retrieves the name of the copy function for @info, if any is set. + * + * Returns: (transfer none) (nullable): the name of the copy function + * + * Since: 1.76 + */ +const char * +g_struct_info_get_copy_function (GIStructInfo *info) +{ + GIRealInfo *rinfo = (GIRealInfo *)info; + StructBlob *blob; + + g_return_val_if_fail (info != NULL, NULL); + g_return_val_if_fail (GI_IS_STRUCT_INFO (info), NULL); + + blob = (StructBlob *)&rinfo->typelib->datarinfo->offset; + + if (blob->copy_func) + return g_typelib_get_string (rinfo->typelib, blob->copy_func); + + return NULL; +} + +/** + * g_struct_info_get_free_function: + * @info: a struct information blob + * + * Retrieves the name of the free function for @info, if any is set. + * + * Returns: (transfer none) (nullable): the name of the free function + * + * Since: 1.76 + */ +const char * +g_struct_info_get_free_function (GIStructInfo *info) +{ + GIRealInfo *rinfo = (GIRealInfo *)info; + StructBlob *blob; + + g_return_val_if_fail (info != NULL, NULL); + g_return_val_if_fail (GI_IS_STRUCT_INFO (info), NULL); + + blob = (StructBlob *)&rinfo->typelib->datarinfo->offset; + + if (blob->free_func) + return g_typelib_get_string (rinfo->typelib, blob->free_func); + + return NULL; +}
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/gistructinfo.h -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/gistructinfo.h
Changed
@@ -75,7 +75,12 @@ GI_AVAILABLE_IN_ALL gboolean g_struct_info_is_foreign (GIStructInfo *info); -G_END_DECLS +GI_AVAILABLE_IN_1_76 +const char * g_struct_info_get_copy_function (GIStructInfo *info); + +GI_AVAILABLE_IN_1_76 +const char * g_struct_info_get_free_function (GIStructInfo *info); +G_END_DECLS #endif /* __GISTRUCTINFO_H__ */
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/gitypelib-internal.h -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/gitypelib-internal.h
Changed
@@ -792,8 +792,10 @@ * @size: The size of the struct in bytes. * @n_fields: TODO * @n_methods: TODO - * @reserved2: Reserved for future use. - * @reserved3: Reserved for future use. + * @copy_func: String pointing to a function which can be called to copy + * the contents of this struct type + * @free_func: String pointing to a function which can be called to free + * the contents of this struct type * * TODO */ @@ -817,8 +819,8 @@ guint16 n_fields; guint16 n_methods; - guint32 reserved2; - guint32 reserved3; + guint32 copy_func; + guint32 free_func; } StructBlob; /** @@ -835,8 +837,10 @@ * @size: TODO * @n_fields: Length of the arrays * @n_functions: TODO - * @reserved2: Reserved for future use. - * @reserved3: Reserved for future use. + * @copy_func: String pointing to a function which can be called to copy + * the contents of this union type + * @free_func: String pointing to a function which can be called to free + * the contents of this union type * @discriminator_offset: Offset from the beginning of the union where the * discriminator of a discriminated union is located. The value 0xFFFF * indicates that the discriminator offset is unknown. @@ -861,8 +865,8 @@ guint16 n_fields; guint16 n_functions; - guint32 reserved2; - guint32 reserved3; + guint32 copy_func; + guint32 free_func; gint32 discriminator_offset; SimpleTypeBlob discriminator_type;
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/giunioninfo.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/giunioninfo.c
Changed
@@ -267,3 +267,57 @@ return blob->alignment; } + +/** + * g_union_info_get_copy_function: + * @info: a union information blob + * + * Retrieves the name of the copy function for @info, if any is set. + * + * Returns: (transfer none) (nullable): the name of the copy function + * + * Since: 1.76 + */ +const char * +g_union_info_get_copy_function (GIUnionInfo *info) +{ + GIRealInfo *rinfo = (GIRealInfo *)info; + UnionBlob *blob; + + g_return_val_if_fail (info != NULL, NULL); + g_return_val_if_fail (GI_IS_UNION_INFO (info), NULL); + + blob = (UnionBlob *)&rinfo->typelib->datarinfo->offset; + + if (blob->copy_func) + return g_typelib_get_string (rinfo->typelib, blob->copy_func); + + return NULL; +} + +/** + * g_union_info_get_free_function: + * @info: a union information blob + * + * Retrieves the name of the free function for @info, if any is set. + * + * Returns: (transfer none) (nullable): the name of the free function + * + * Since: 1.76 + */ +const char * +g_union_info_get_free_function (GIUnionInfo *info) +{ + GIRealInfo *rinfo = (GIRealInfo *)info; + UnionBlob *blob; + + g_return_val_if_fail (info != NULL, NULL); + g_return_val_if_fail (GI_IS_UNION_INFO (info), NULL); + + blob = (UnionBlob *)&rinfo->typelib->datarinfo->offset; + + if (blob->free_func) + return g_typelib_get_string (rinfo->typelib, blob->free_func); + + return NULL; +}
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/giunioninfo.h -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/giunioninfo.h
Changed
@@ -77,6 +77,12 @@ GI_AVAILABLE_IN_ALL gsize g_union_info_get_alignment (GIUnionInfo *info); +GI_AVAILABLE_IN_1_76 +const char * g_union_info_get_copy_function (GIUnionInfo *info); + +GI_AVAILABLE_IN_1_76 +const char * g_union_info_get_free_function (GIUnionInfo *info); + G_END_DECLS
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/girepository/giversionmacros.h -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/girepository/giversionmacros.h
Changed
@@ -195,4 +195,18 @@ # define GI_AVAILABLE_IN_1_72 _GI_EXTERN #endif +#if defined(GLIB_VERSION_2_76) && GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_76 +# define GI_DEPRECATED_IN_1_76 GI_DEPRECATED +# define GI_DEPRECATED_IN_1_76_FOR(f) GI_DEPRECATED_FOR(f) +#else +# define GI_DEPRECATED_IN_1_76 _GI_EXTERN +# define GI_DEPRECATED_IN_1_76_FOR(f) _GI_EXTERN +#endif + +#if defined(GLIB_VERSION_2_76) && GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_76 +# define GI_AVAILABLE_IN_1_76 GI_UNAVAILABLE(2, 76) +#else +# define GI_AVAILABLE_IN_1_76 _GI_EXTERN +#endif + #endif /* __GIVERSIONMACROS_H__ */
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/giscanner/annotationparser.py -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/giscanner/annotationparser.py
Changed
@@ -110,9 +110,9 @@ import re import operator -from typing import Tuple -from operator import ne, gt, lt from collections import namedtuple, Counter, OrderedDict +from operator import ne, gt, lt +from typing import Tuple # noqa from .message import Position, warn, error @@ -193,10 +193,13 @@ ANN_ATTRIBUTES = 'attributes' ANN_CLOSURE = 'closure' ANN_CONSTRUCTOR = 'constructor' +ANN_COPY_FUNC = 'copy-func' +ANN_DEFAULT_VALUE = 'default-value' ANN_DESTROY = 'destroy' ANN_ELEMENT_TYPE = 'element-type' ANN_EMITTER = 'emitter' ANN_FOREIGN = 'foreign' +ANN_FREE_FUNC = 'free-func' ANN_GET_PROPERTY = 'get-property' ANN_GET_VALUE_FUNC = 'get-value-func' ANN_GETTER = 'getter' @@ -228,6 +231,7 @@ ANN_ATTRIBUTES, ANN_CLOSURE, ANN_CONSTRUCTOR, + ANN_DEFAULT_VALUE, ANN_DESTROY, ANN_ELEMENT_TYPE, ANN_EMITTER, @@ -788,6 +792,31 @@ self._validate_annotation(position, ann_name, options, exact_n_options=0) + def _do_validate_copy_func(self, position, ann_name, options): + ''' + Validate the ``(copy-func)`` annotation. + + :param position: :class:`giscanner.message.Position` of the line in the source file + containing the annotation to be validated + :param ann_name: name of the annotation holding the options to validate + :param options: annotation options to validate + ''' + + self._validate_annotation(position, ann_name, options, exact_n_options=1) + + def _do_validate_default_value(self, position, ann_name, options): + ''' + Validate the ``(default-value)`` annotation. + + :param position: :class:`giscanner.message.Position` of the line in the source file + containing the annotation to be validated + :param ann_name: name of the annotation holding the options to validate + :param options: annotation options to validate + ''' + + # The 'default-value' annotation allows free form annotations. + pass + def _do_validate_destroy(self, position, ann_name, options): ''' Validate the ``(destroy)`` annotation. @@ -836,6 +865,18 @@ self._validate_annotation(position, ann_name, options, exact_n_options=0) + def _do_validate_free_func(self, position, ann_name, options): + ''' + Validate the ``(free-func)`` annotation. + + :param position: :class:`giscanner.message.Position` of the line in the source file + containing the annotation to be validated + :param ann_name: name of the annotation holding the options to validate + :param options: annotation options to validate + ''' + + self._validate_annotation(position, ann_name, options, exact_n_options=1) + def _do_validate_get_property(self, position, ann_name, options): ''' Validate the ``(get-property)`` annotation. @@ -1112,9 +1153,24 @@ __slots__ = ('name', 'description') - valid_annotations = (ANN_ALLOW_NONE, ANN_ARRAY, ANN_ATTRIBUTES, ANN_CLOSURE, ANN_DESTROY, - ANN_ELEMENT_TYPE, ANN_IN, ANN_INOUT, ANN_OUT, ANN_SCOPE, ANN_SKIP, - ANN_TRANSFER, ANN_TYPE, ANN_OPTIONAL, ANN_NULLABLE, ANN_NOT) + valid_annotations = ( + ANN_ALLOW_NONE, + ANN_ARRAY, + ANN_ATTRIBUTES, + ANN_CLOSURE, + ANN_DESTROY, + ANN_ELEMENT_TYPE, + ANN_IN, + ANN_INOUT, + ANN_OUT, + ANN_SCOPE, + ANN_SKIP, + ANN_TRANSFER, + ANN_TYPE, + ANN_OPTIONAL, + ANN_NULLABLE, + ANN_NOT, + ) def __init__(self, name, position=None): GtkDocAnnotatable.__init__(self, position) @@ -1136,8 +1192,18 @@ __slots__ = ('name', 'value', 'description') - valid_annotations = (ANN_ALLOW_NONE, ANN_ARRAY, ANN_ATTRIBUTES, ANN_ELEMENT_TYPE, ANN_SKIP, - ANN_TRANSFER, ANN_TYPE, ANN_NULLABLE, ANN_OPTIONAL, ANN_NOT) + valid_annotations = ( + ANN_ALLOW_NONE, + ANN_ARRAY, + ANN_ATTRIBUTES, + ANN_ELEMENT_TYPE, + ANN_SKIP, + ANN_TRANSFER, + ANN_TYPE, + ANN_NULLABLE, + ANN_OPTIONAL, + ANN_NOT, + ) def __init__(self, name, position=None): GtkDocAnnotatable.__init__(self, position) @@ -1167,8 +1233,11 @@ valid_annotations = ( ANN_ATTRIBUTES, ANN_CONSTRUCTOR, + ANN_COPY_FUNC, + ANN_DEFAULT_VALUE, ANN_EMITTER, ANN_FOREIGN, + ANN_FREE_FUNC, ANN_GET_PROPERTY, ANN_GET_VALUE_FUNC, ANN_GETTER,
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/giscanner/ast.py -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/giscanner/ast.py
Changed
@@ -1021,6 +1021,8 @@ get_type=None, c_symbol_prefix=None, disguised=False, + opaque=False, + pointer=False, tag_name=None): Node.__init__(self, name) Registered.__init__(self, gtype_name, get_type) @@ -1030,6 +1032,8 @@ self.fields = self.constructors = self.disguised = disguised + self.opaque = opaque + self.pointer = pointer self.gtype_name = gtype_name self.get_type = get_type self.c_symbol_prefix = c_symbol_prefix @@ -1116,6 +1120,8 @@ get_type=None, c_symbol_prefix=None, disguised=False, + opaque=False, + pointer=False, tag_name=None): Compound.__init__(self, name, ctype=ctype, @@ -1123,10 +1129,18 @@ get_type=get_type, c_symbol_prefix=c_symbol_prefix, disguised=disguised, + opaque=opaque, + pointer=pointer, tag_name=tag_name) # If non-None, this record defines the FooClass C structure # for some Foo GObject (or similar for GInterface) self.is_gtype_struct_for = None + # If non-None, this record has a copy function for heap + # allocated instances + self.copy_func = None + # If non-None, this record has a free function for heap + # allocated instances + self.free_func = None class Union(Compound): @@ -1137,6 +1151,8 @@ get_type=None, c_symbol_prefix=None, disguised=False, + opaque=False, + pointer=False, tag_name=None): Compound.__init__(self, name, ctype=ctype, @@ -1144,7 +1160,15 @@ get_type=get_type, c_symbol_prefix=c_symbol_prefix, disguised=disguised, + opaque=opaque, + pointer=pointer, tag_name=tag_name) + # If non-None, this union has a copy function for heap + # allocated instances + self.copy_func = None + # If non-None, this union has a free function for heap + # allocated instances + self.free_func = None class Boxed(Node, Registered): @@ -1304,6 +1328,7 @@ self.transfer = transfer self.setter = None self.getter = None + self.default_value = None self.parent = None # A Class or Interface
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/giscanner/gdumpparser.py -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/giscanner/gdumpparser.py
Changed
@@ -229,7 +229,10 @@ get_type='intern', c_symbol_prefix='variant') elif record.name == 'InitiallyUnownedClass': + # InitiallyUnowned is just GObject with extra steps, so we alias + # it in the introspection data record.fields = self._namespace.get('ObjectClass').fields + record.opaque = False record.disguised = False # Introspection over the data we get from the dynamic @@ -414,10 +417,13 @@ writable = (flags & G_PARAM_WRITABLE) != 0 construct = (flags & G_PARAM_CONSTRUCT) != 0 construct_only = (flags & G_PARAM_CONSTRUCT_ONLY) != 0 - node.properties.append(ast.Property( + default_value = pspec.attrib.get('default-value') + prop = ast.Property( pspec.attrib'name', ast.Type.create_from_gtype_name(ctype), - readable, writable, construct, construct_only)) + readable, writable, construct, construct_only) + prop.default_value = default_value + node.properties.append(prop) node.properties = node.properties def _introspect_signals(self, node, xmlnode): @@ -519,8 +525,9 @@ pair_node.add_gtype(boxed.gtype_name, boxed.get_type) assert boxed.c_symbol_prefix is not None pair_node.c_symbol_prefix = boxed.c_symbol_prefix - # Quick hack - reset the disguised flag; we're setting it - # incorrectly in the scanner + # Backward compatibility hack - reset the disguised flag; we're + # setting it incorrectly in the scanner. We don't change the + # opaque flag, because it's a new one and we define its behavior pair_node.disguised = False else: return False
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/giscanner/girparser.py -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/giscanner/girparser.py
Changed
@@ -435,6 +435,8 @@ compound = cls(node.attrib.get('name'), ctype=node.attrib.get(_cns('type')), disguised=node.attrib.get('disguised') == '1', + opaque=node.attrib.get('opaque') == '1', + pointer=node.attrib.get('pointer') == '1', gtype_name=node.attrib.get(_glibns('type-name')), get_type=node.attrib.get(_glibns('get-type')), c_symbol_prefix=node.attrib.get(_cns('symbol-prefix'))) @@ -462,14 +464,20 @@ def _parse_record(self, node, anonymous=False): struct = self._parse_compound(ast.Record, node) is_gtype_struct_for = node.attrib.get(_glibns('is-gtype-struct-for')) + copy_func = node.attrib.get('copy-function') + free_func = node.attrib.get('free-function') if is_gtype_struct_for is not None: struct.is_gtype_struct_for = self._namespace.type_from_name(is_gtype_struct_for) + struct.copy_func = copy_func + struct.free_func = free_func if not anonymous: self._namespace.append(struct) return struct def _parse_union(self, node, anonymous=False): union = self._parse_compound(ast.Union, node) + union.copy_func = node.attrib.get('copy-function') + union.free_func = node.attrib.get('free-function') if not anonymous: self._namespace.append(union) return union @@ -609,6 +617,7 @@ node.attrib.get('transfer-ownership')) prop.setter = node.attrib.get('setter') prop.getter = node.attrib.get('getter') + prop.default_value = node.attrib.get('default-value') prop.parent = parent self._parse_generic_attribs(node, prop) return prop
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/giscanner/girwriter.py -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/giscanner/girwriter.py
Changed
@@ -560,6 +560,8 @@ attrs.append(('setter', prop.setter)) if prop.getter: attrs.append(('getter', prop.getter)) + if prop.default_value: + attrs.append(('default-value', prop.default_value)) with self.tagcontext('property', attrs): self._write_generic(prop) self._write_type(prop.type) @@ -585,12 +587,20 @@ attrs.append(('c:type', record.ctype)) if record.disguised: attrs.append(('disguised', '1')) + if record.opaque: + attrs.append(('opaque', '1')) + if record.pointer: + attrs.append(('pointer', '1')) if record.foreign: attrs.append(('foreign', '1')) if record.is_gtype_struct_for is not None: is_gtype_struct = True attrs.append(('glib:is-gtype-struct-for', self._type_to_name(record.is_gtype_struct_for))) + if record.copy_func: + attrs.append(('copy-function', record.copy_func)) + if record.free_func: + attrs.append(('free-function', record.free_func)) self._append_version(record, attrs) self._append_node_generic(record, attrs) self._append_registered(record, attrs) @@ -619,6 +629,10 @@ self._append_registered(union, attrs) if union.c_symbol_prefix: attrs.append(('c:symbol-prefix', union.c_symbol_prefix)) + if union.copy_func: + attrs.append(('copy-function', union.copy_func)) + if union.free_func: + attrs.append(('free-function', union.free_func)) with self.tagcontext('union', attrs): self._write_generic(union) if union.fields:
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/giscanner/maintransformer.py -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/giscanner/maintransformer.py
Changed
@@ -28,10 +28,13 @@ ANN_ATTRIBUTES, ANN_CLOSURE, ANN_CONSTRUCTOR, + ANN_COPY_FUNC, + ANN_DEFAULT_VALUE, ANN_DESTROY, ANN_ELEMENT_TYPE, ANN_EMITTER, ANN_FOREIGN, + ANN_FREE_FUNC, ANN_GET_PROPERTY, ANN_GET_VALUE_FUNC, ANN_GETTER, @@ -309,6 +312,13 @@ node.get_value_func = annotation0 if annotation else None if isinstance(node, ast.Constant): self._apply_annotations_constant(node) + if isinstance(node, (ast.Record, ast.Union)): + block = self._get_block(node) + if block: + annotation = block.annotations.get(ANN_COPY_FUNC) + node.copy_func = annotation0 if annotation else None + annotation = block.annotations.get(ANN_FREE_FUNC) + node.free_func = annotation0 if annotation else None return True def _adjust_container_type(self, parent, node, annotations): @@ -963,6 +973,9 @@ getter = block.annotations.get(ANN_GETTER) if getter: prop.getter = getter0 + default_value = block.annotations.get(ANN_DEFAULT_VALUE) + if default_value: + prop.default_value = default_value0 def _apply_annotations_signal(self, parent, signal): names =
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/giscanner/transformer.py -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/giscanner/transformer.py
Changed
@@ -613,7 +613,7 @@ elif (ctype == CTYPE_FUNCTION): node = self._create_typedef_callback(symbol) elif (ctype == CTYPE_POINTER and symbol.base_type.base_type.type == CTYPE_STRUCT): - node = self._create_typedef_compound(ast.Record, symbol, disguised=True) + node = self._create_typedef_compound(ast.Record, symbol, disguised=True, pointer=True) elif ctype == CTYPE_STRUCT: node = self._create_typedef_compound(ast.Record, symbol) elif ctype == CTYPE_UNION: @@ -801,7 +801,7 @@ const.add_symbol_reference(symbol) return const - def _create_typedef_compound(self, compound_class, symbol, disguised=False): + def _create_typedef_compound(self, compound_class, symbol, disguised=False, pointer=False): name = self.strip_identifier(symbol.ident) assert symbol.base_type if symbol.base_type.name: @@ -840,12 +840,14 @@ # Structs with a typedef name are promoted into the main namespace # by it being returned to the "parse" function and are also added to # the tag namespace if it has a tag_name set. - compound = compound_class(name, symbol.ident, disguised=disguised, tag_name=tag_name) + compound = compound_class(name, symbol.ident, disguised=disguised, pointer=pointer, tag_name=tag_name) if tag_name: - # Force the struct as disguised for now since we do not yet know - # if it has fields that will be parsed. Note that this is using - # an erroneous definition of disguised and we should eventually - # only look at the field count when needed. + # Force the struct as opaque for now since we do not yet know + # if it has fields that will be parsed. + compound.opaque = True + # Set disguised as well, for backward compatibility; the "disguised" field + # is used incorrectly, here, but it's too late for us to change this. See + # https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/101 compound.disguised = True else: # Case where we have an anonymous struct which is typedef'd: @@ -864,12 +866,17 @@ else: compound = compound_class(None, symbol.ident, tag_name=symbol.ident) - # Make sure disguised is False as we are now about to parse the - # fields of the real struct. - compound.disguised = False # Fields may need to be parsed in either of the above cases because the # Record can be created with a typedef prior to the struct definition. self._parse_fields(symbol, compound) + + # A compound type with no fields is opaque + compound.opaque = len(compound.fields) == 0 + # Unconditionally set disguised to false, for backward compatibility; + # the "disguised" field is used incorrectly, here, but it's too late for + # us to change this. See: + # https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/101 + compound.disguised = False compound.add_symbol_reference(symbol) return compound
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/meson.build -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/meson.build
Changed
@@ -1,5 +1,5 @@ project('gobject-introspection', 'c', - version: '1.74.0', + version: '1.76.1', meson_version: '>= 0.60.0', default_options: 'c_std=gnu99', @@ -123,38 +123,45 @@ gi_hidden_visibility_cflags += '-fvisibility=hidden' endif +# Reset to 0 if g-i micro version exceeds GLib's +glib_micro_version = 0 # gi_versions2 +glib_version = '>=2.@0@.@1@'.format(gi_versions1, glib_micro_version) -glib_version = '>=2.@0@.@1@'.format(gi_versions1, gi_versions2) - -glib_dep = dependency('glib-2.0', version : glib_version, - fallback: 'glib', 'libglib_dep') -gobject_dep = dependency('gobject-2.0', version : glib_version, - fallback: 'glib', 'libgobject_dep') -gio_dep = dependency('gio-2.0', version : glib_version, - fallback: 'glib', 'libgio_dep') -gmodule_dep = dependency('gmodule-2.0', version : glib_version, - fallback: 'glib', 'libgmodule_dep') +glib_dep = dependency('glib-2.0', version: glib_version, + default_options: 'tests=false') +gobject_dep = dependency('gobject-2.0', version: glib_version) +gio_dep = dependency('gio-2.0', version: glib_version) +gmodule_dep = dependency('gmodule-2.0', version: glib_version) if host_system != 'windows' - giounix_dep = dependency('gio-unix-2.0', version : glib_version, - fallback: 'glib', 'libgiounix_dep') - giowin_dep = dependency('', required : false) + giounix_dep = dependency('gio-unix-2.0', version: glib_version) + giowin_dep = disabler() else # Don't even try to look for gio-unix-2.0 on Windows because Meson will # fruitlessly try to find it in the glib subproject even when we don't want # it to look in the subproject at all. Just use a not-found dependency. - giounix_dep = dependency('', required : false) + giounix_dep = disabler() # XXX: Autotools doesn't build girs for gio-win32-2.0, but maybe we should? - giowin_dep = dependency('gio-windows-2.0', version : glib_version, - fallback: 'glib', 'libgiowin32_dep') + giowin_dep = dependency('gio-windows-2.0', version: glib_version) endif -libffi_dep = dependency('libffi', - fallback : 'libffi', 'ffi_dep') + +# We either get libffi from the system, or from GLib's own subproject +libffi_dep = dependency('libffi') if not (host_system == 'darwin' and host_arch == 'aarch64' or host_system == 'linux' and libffi_dep.version().version_compare('>= 3.4')) config.set('LEGACY_GIRFFI_FREE', 1) endif +# Replicate https://github.com/mesonbuild/meson/pull/10275 setting +# the correct env in the custom_target +pkg_config = find_program('pkg-config') +g_ir_scanner_env = environment() +dep_type = glib_dep.type_name() +if dep_type == 'internal' + g_ir_scanner_env.append('PKG_CONFIG_PATH', meson.global_build_root() + '/meson-uninstalled') + g_ir_scanner_env.set('PKG_CONFIG', pkg_config.full_path()) +endif + configure_file( configuration: config, output: 'config.h'
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/subprojects/glib.wrap -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/subprojects/glib.wrap
Changed
@@ -1,5 +1,10 @@ wrap-git -directory=glib -url=https://gitlab.gnome.org/GNOME/glib.git -revision=main -depth=1 +directory = glib +url = https://gitlab.gnome.org/GNOME/glib.git +push-url = ssh://git@ssh.gitlab.gnome.org:GNOME/glib.git +revision = main +depth = 1 + +provide +dependency_names = gthread-2.0, gobject-2.0, gmodule-no-export-2.0, gmodule-export-2.0, gmodule-2.0, glib-2.0, gio-2.0, gio-windows-2.0, gio-unix-2.0 +program_names = glib-genmarshal, glib-mkenums, glib-compile-schemas, glib-compile-resources, gio-querymodules, gdbus-codegen
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/gimarshallingtests.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/gimarshallingtests.c
Changed
@@ -1205,6 +1205,19 @@ } /** + * gi_marshalling_tests_array_fixed_caller_allocated_out: + * @ints: (out caller-allocates) (array fixed-size=4): + */ +void +gi_marshalling_tests_array_fixed_caller_allocated_out (gint *ints) +{ + ints0 = -1; + ints1 = 0; + ints2 = 1; + ints3 = 2; +} + +/** * gi_marshalling_tests_array_fixed_short_in: * @shorts: (array fixed-size=4): */ @@ -1252,6 +1265,23 @@ } /** + * gi_marshalling_tests_array_fixed_caller_allocated_struct_out: + * @structs: (out caller-allocates) (array fixed-size=4): + */ +void +gi_marshalling_tests_array_fixed_caller_allocated_struct_out (GIMarshallingTestsSimpleStruct *structs) +{ + structs0.long_ = -2; + structs0.int8 = -1; + structs1.long_ = 1; + structs1.int8 = 2; + structs2.long_ = 3; + structs2.int8 = 4; + structs3.long_ = 5; + structs3.int8 = 6; +} + +/** * gi_marshalling_tests_array_fixed_inout: * @ints: (inout) (array fixed-size=4) (transfer none): */ @@ -4024,6 +4054,7 @@ *new_struct = *struct_; new_struct->string_ = g_strdup (struct_->string_); + new_struct->g_strv = g_strdupv (struct_->g_strv); return new_struct; } @@ -4034,6 +4065,7 @@ if (struct_ != NULL) { g_free (struct_->string_); + g_clear_pointer (&struct_->g_strv, g_strfreev); g_slice_free (GIMarshallingTestsBoxedStruct, struct_); } } @@ -4213,6 +4245,156 @@ g_assert_cmpint (union_->long_, ==, 42); } +/** + * gi_marshalling_tests_structured_union_new: + * @type: Type of #GIMarshallingTestsStructuredUnion to create + */ +GIMarshallingTestsStructuredUnion * +gi_marshalling_tests_structured_union_new (GIMarshallingTestsStructuredUnionType type) +{ + GIMarshallingTestsStructuredUnion *new_union; + + new_union = g_new0 (GIMarshallingTestsStructuredUnion, 1); + new_union->type = type; + + switch (type) + { + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_NONE: + break; + + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_SIMPLE_STRUCT: + new_union->simple_struct.parent.long_ = 6; + new_union->simple_struct.parent.int8 = 7; + break; + + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_NESTED_STRUCT: + new_union->nested_struct.parent.simple_struct.long_ = 6; + new_union->nested_struct.parent.simple_struct.int8 = 7; + break; + + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_BOXED_STRUCT: + new_union->boxed_struct.parent.long_ = 42; + new_union->boxed_struct.parent.string_ = g_strdup ("hello"); + new_union->boxed_struct.parent.g_strv = g_new0 (gchar *, 4); + new_union->boxed_struct.parent.g_strv0 = g_strdup ("0"); + new_union->boxed_struct.parent.g_strv1 = g_strdup ("1"); + new_union->boxed_struct.parent.g_strv2 = g_strdup ("2"); + new_union->boxed_struct.parent.g_strv3 = NULL; + break; + + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_BOXED_STRUCT_PTR: + new_union->boxed_struct_ptr.parent = g_boxed_copy ( + gi_marshalling_tests_boxed_struct_get_type(), + gi_marshalling_tests_boxed_struct_returnv ()); + break; + + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_POINTER_STRUCT: + new_union->pointer_struct.parent.long_ = 42; + break; + + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_SINGLE_UNION: + new_union->single_union.parent.union_.long_ = 42; + break; + + default: + g_free (new_union); + g_return_val_if_reached (NULL); + } + + return new_union; +} + +static GIMarshallingTestsStructuredUnion * +gi_marshalling_tests_structured_union_copy (GIMarshallingTestsStructuredUnion *union_) +{ + GIMarshallingTestsStructuredUnion *new_union; + + new_union = g_new (GIMarshallingTestsStructuredUnion, 1); + *new_union = *union_; + + switch (union_->type) + { + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_BOXED_STRUCT: + new_union->boxed_struct.parent.string_ = g_strdup (union_->boxed_struct.parent.string_); + if (union_->boxed_struct.parent.g_strv) + { + guint length = g_strv_length (union_->boxed_struct.parent.g_strv); + guint i; + + new_union->boxed_struct.parent.g_strv = g_new0 (gchar *, length + 1); + for (i = 0; i < length; i++) + new_union->boxed_struct.parent.g_strvi = g_strdup (union_->boxed_struct.parent.g_strvi); + new_union->boxed_struct.parent.g_strvi = NULL; + } + break; + + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_BOXED_STRUCT_PTR: + new_union->boxed_struct_ptr.parent = g_boxed_copy ( + gi_marshalling_tests_boxed_struct_get_type(), union_->boxed_struct_ptr.parent); + break; + + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_NONE: + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_SINGLE_UNION: + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_POINTER_STRUCT: + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_SIMPLE_STRUCT: + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_NESTED_STRUCT: + break; + + default: + g_return_val_if_reached (new_union); + } + + return new_union; +} + +static void +gi_marshalling_tests_structured_union_free (GIMarshallingTestsStructuredUnion *union_) +{ + switch (union_->type) + { + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_BOXED_STRUCT: + g_free (union_->boxed_struct.parent.string_); + g_strfreev (union_->boxed_struct.parent.g_strv); + break; + + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_BOXED_STRUCT_PTR: + g_boxed_free (gi_marshalling_tests_boxed_struct_get_type(), union_->boxed_struct_ptr.parent); + break; + + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_NONE: + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_SINGLE_UNION: + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_POINTER_STRUCT: + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_SIMPLE_STRUCT: + case GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_NESTED_STRUCT: + break; + + default: + g_assert_not_reached (); + } + + g_free (union_); +} + +GType gi_marshalling_tests_structured_union_get_type (void) +{ + static GType type = 0; + + if (type == 0) + { + type = g_boxed_type_register_static ("GIMarshallingTestsStructuredUnion", + (GBoxedCopyFunc) + gi_marshalling_tests_structured_union_copy, + (GBoxedFreeFunc) gi_marshalling_tests_structured_union_free); + } + + return type; +} + +GIMarshallingTestsStructuredUnionType +gi_marshalling_tests_structured_union_type (GIMarshallingTestsStructuredUnion *structured_union) +{ + return structured_union->type; +} enum
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/gimarshallingtests.h -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/gimarshallingtests.h
Changed
@@ -679,6 +679,9 @@ void gi_marshalling_tests_array_fixed_int_in (const gint *ints); _GI_TEST_EXTERN +void gi_marshalling_tests_array_fixed_caller_allocated_out (gint *ints); + +_GI_TEST_EXTERN void gi_marshalling_tests_array_fixed_short_in (const gshort *shorts); @@ -689,6 +692,9 @@ _GI_TEST_EXTERN void gi_marshalling_tests_array_fixed_out_struct (GIMarshallingTestsSimpleStruct **structs); +_GI_TEST_EXTERN +void gi_marshalling_tests_array_fixed_caller_allocated_struct_out (GIMarshallingTestsSimpleStruct *structs); + _GI_TEST_EXTERN void gi_marshalling_tests_array_fixed_inout (gint **ints); @@ -1321,6 +1327,12 @@ glong long_; } GIMarshallingTestsUnion; +typedef union { + glong long_; + gsize size; + const gchar *str; +} GIMarshallingTestsUnregisteredUnion; + _GI_TEST_EXTERN GType gi_marshalling_tests_union_get_type (void) G_GNUC_CONST; @@ -1337,6 +1349,79 @@ _GI_TEST_EXTERN void gi_marshalling_tests_union_method (GIMarshallingTestsUnion *union_); +typedef enum +{ + GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_NONE, + GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_SIMPLE_STRUCT, + GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_NESTED_STRUCT, + GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_POINTER_STRUCT, + GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_BOXED_STRUCT, + GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_BOXED_STRUCT_PTR, + GI_MARSHALLING_TESTS_STRUCTURED_UNION_TYPE_SINGLE_UNION, +} GIMarshallingTestsStructuredUnionType; + +typedef struct { + GIMarshallingTestsStructuredUnionType type; + GIMarshallingTestsSimpleStruct parent; +} GIMarshallingTestsStructuredUnionSimpleStruct; + +typedef struct { + GIMarshallingTestsStructuredUnionType type; + GIMarshallingTestsNestedStruct parent; +} GIMarshallingTestsStructuredUnionNestedStruct; + +typedef struct { + GIMarshallingTestsStructuredUnionType type; + GIMarshallingTestsPointerStruct parent; +} GIMarshallingTestsStructuredUnionPointerStruct; + +typedef struct { + GIMarshallingTestsStructuredUnionType type; + GIMarshallingTestsBoxedStruct parent; +} GIMarshallingTestsStructuredUnionBoxedStruct; + +typedef struct { + GIMarshallingTestsStructuredUnionType type; + GIMarshallingTestsBoxedStruct *parent; +} GIMarshallingTestsStructuredUnionBoxedStructPtr; + +typedef struct { + GIMarshallingTestsStructuredUnionType type; + GIMarshallingTestsUnion union_; +} GIMarshallingTestsStructuredUnionUnionStruct; + +typedef union { + GIMarshallingTestsStructuredUnionUnionStruct parent; +} GIMarshallingTestsStructuredUnionSingleUnion; + +typedef union { + /*< private >*/ + GIMarshallingTestsStructuredUnionType type; + + GIMarshallingTestsStructuredUnionSimpleStruct simple_struct; + GIMarshallingTestsStructuredUnionNestedStruct nested_struct; + GIMarshallingTestsStructuredUnionPointerStruct pointer_struct; + GIMarshallingTestsStructuredUnionBoxedStruct boxed_struct; + GIMarshallingTestsStructuredUnionBoxedStructPtr boxed_struct_ptr; + GIMarshallingTestsStructuredUnionSingleUnion single_union; +} GIMarshallingTestsStructuredUnion; + +_GI_TEST_EXTERN +GType gi_marshalling_tests_structured_union_get_type (void) G_GNUC_CONST; + +_GI_TEST_EXTERN +GIMarshallingTestsStructuredUnion *gi_marshalling_tests_structured_union_new (GIMarshallingTestsStructuredUnionType type); + +/* we want this to clash with a field value name */ +_GI_TEST_EXTERN +GIMarshallingTestsStructuredUnionType gi_marshalling_tests_structured_union_type (GIMarshallingTestsStructuredUnion *structured_union); + +typedef union { + GIMarshallingTestsStructuredUnionType type; + GIMarshallingTestsStructuredUnionSimpleStruct simple_struct1; + GIMarshallingTestsStructuredUnionSimpleStruct simple_struct2; +} GIMarshallingTestsStructuredUnionSingleType; + /* Object */ #define GI_MARSHALLING_TESTS_TYPE_OBJECT (gi_marshalling_tests_object_get_type ())
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/meson.build -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/meson.build
Changed
@@ -56,6 +56,7 @@ test_everything_files = custom_target('everything', output: 'everything.h', 'everything.c', depends: typelibs, + env: g_ir_scanner_env, command: test_girscanner, '--quiet',
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/repository/gitypelibtest.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/repository/gitypelibtest.c
Changed
@@ -168,6 +168,18 @@ } static void +test_record_get_copy_function (GIRepository *repo) +{ + GIStructInfo *info; + + g_assert_true (g_irepository_require (repo, "Regress", NULL, 0, NULL)); + info = g_irepository_find_by_name (repo, "Regress", "TestBoxedD"); + g_assert_nonnull (info); + g_assert_cmpstr (g_struct_info_get_copy_function (info), ==, "regress_test_boxed_d_copy"); + g_base_info_unref (info); +} + +static void test_hash_with_cairo_typelib (GIRepository * repo) { GIBaseInfo *info; @@ -318,6 +330,7 @@ test_size_of_gvalue (repo); test_is_pointer_for_struct_arg (repo); test_fundamental_get_ref_function_pointer (repo); + test_record_get_copy_function (repo); test_hash_with_cairo_typelib (repo); test_char_types (repo); test_signal_array_len (repo);
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/Identfilter-1.0-expected.gir -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Identfilter-1.0-expected.gir
Changed
@@ -11,10 +11,13 @@ shared-library="" c:identifier-prefixes="Identfilter" c:symbol-prefixes="identfilter"> - <record name="Context" c:type="identfilter_t" disguised="1"> + <record name="Context" c:type="identfilter_t" disguised="1" opaque="1"> <source-position filename="identfilter.h" line="4"/> </record> - <record name="Object" c:type="identfilter_object_t" disguised="1"> + <record name="Object" + c:type="identfilter_object_t" + disguised="1" + opaque="1"> <source-position filename="identfilter.h" line="5"/> <method name="foo_method" c:identifier="identfilter_object_foo_method"> <source-position filename="identfilter.h" line="8"/>
View file
_service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Regress-1.0-C-expected/Regress.BAD_EXPR_CONSTANT.page
Added
@@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<page id="Regress.BAD_EXPR_CONSTANT" + type="topic" + style="default" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + <link xref="index" group="default" type="guide"/> + </info> + <title>Regress.BAD_EXPR_CONSTANT</title> + + +</page>
View file
_service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Regress-1.0-C-expected/Regress.GOOD_EXPR_CONSTANT.page
Added
@@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<page id="Regress.GOOD_EXPR_CONSTANT" + type="topic" + style="default" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + <link xref="index" group="default" type="guide"/> + </info> + <title>Regress.GOOD_EXPR_CONSTANT</title> + + +</page>
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/Regress-1.0-C-expected/Regress.TestSimpleBoxedA.page -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Regress-1.0-C-expected/Regress.TestSimpleBoxedA.page
Changed
@@ -9,7 +9,7 @@ <link xref="index" group="class" type="guide"/> </info> <title>Regress.TestSimpleBoxedA</title> - + <p>...</p> <links type="topic" ui:expanded="true" api:type="function" api:mime="text/x-csrc"
View file
_service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Regress-1.0-Gjs-expected/Regress.BAD_EXPR_CONSTANT.page
Added
@@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<page id="Regress.BAD_EXPR_CONSTANT" + type="topic" + style="default" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + <link xref="index" group="default" type="guide"/> + </info> + <title>Regress.BAD_EXPR_CONSTANT</title> + + +</page>
View file
_service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Regress-1.0-Gjs-expected/Regress.GOOD_EXPR_CONSTANT.page
Added
@@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<page id="Regress.GOOD_EXPR_CONSTANT" + type="topic" + style="default" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + <link xref="index" group="default" type="guide"/> + </info> + <title>Regress.GOOD_EXPR_CONSTANT</title> + + +</page>
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestSimpleBoxedA.page -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestSimpleBoxedA.page
Changed
@@ -19,7 +19,7 @@ <link xref='Regress.TestSimpleBoxedA-some_enum'>some_enum</link>: value }); </code></synopsis> - + <p>...</p> <links type="topic" ui:expanded="true" api:type="function" api:mime="text/x-gjs"
View file
_service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Regress-1.0-Python-expected/Regress.BAD_EXPR_CONSTANT.page
Added
@@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<page id="Regress.BAD_EXPR_CONSTANT" + type="topic" + style="default" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + <link xref="index" group="default" type="guide"/> + </info> + <title>Regress.BAD_EXPR_CONSTANT</title> + + +</page>
View file
_service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Regress-1.0-Python-expected/Regress.GOOD_EXPR_CONSTANT.page
Added
@@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<page id="Regress.GOOD_EXPR_CONSTANT" + type="topic" + style="default" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + <link xref="index" group="default" type="guide"/> + </info> + <title>Regress.GOOD_EXPR_CONSTANT</title> + + +</page>
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/Regress-1.0-Python-expected/Regress.TestSimpleBoxedA.page -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Regress-1.0-Python-expected/Regress.TestSimpleBoxedA.page
Changed
@@ -14,7 +14,7 @@ test_simple_boxed_a = Regress.TestSimpleBoxedA() </code></synopsis> - + <p>...</p> <links type="topic" ui:expanded="true" api:type="function" api:mime="text/python"
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/Regress-1.0-expected.gir -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Regress-1.0-expected.gir
Changed
@@ -18,8 +18,8 @@ <alias name="AliasedTestBoxed" c:type="RegressAliasedTestBoxed"> <doc xml:space="preserve" filename="regress.h" - line="1444">Typedef TestBoxed to test caller-allocates correctness</doc> - <source-position filename="regress.h" line="1449"/> + line="1460">Typedef TestBoxed to test caller-allocates correctness</doc> + <source-position filename="regress.h" line="1465"/> <type name="TestBoxed" c:type="RegressTestBoxed"/> </alias> <alias name="FooObjectCookie" c:type="RegressFooObjectCookie"> @@ -33,26 +33,26 @@ <alias name="IntsetAlias" c:type="RegressIntsetAlias" introspectable="0"> <doc xml:space="preserve" filename="regress.h" - line="1414">Compatibility typedef, like telepathy-glib's TpIntSet</doc> - <source-position filename="regress.h" line="1420"/> + line="1430">Compatibility typedef, like telepathy-glib's TpIntSet</doc> + <source-position filename="regress.h" line="1436"/> <type name="Intset" c:type="RegressIntset"/> </alias> <alias name="PtrArrayAlias" c:type="RegressPtrArrayAlias"> <doc xml:space="preserve" filename="regress.h" - line="1422">Typedef'd GPtrArray for some reason</doc> - <source-position filename="regress.h" line="1427"/> + line="1438">Typedef'd GPtrArray for some reason</doc> + <source-position filename="regress.h" line="1443"/> <type name="GLib.PtrArray" c:type="GPtrArray"/> </alias> <alias name="TestTypeGUInt64" c:type="RegressTestTypeGUInt64"> - <source-position filename="regress.h" line="528"/> + <source-position filename="regress.h" line="530"/> <type name="guint64" c:type="guint64"/> </alias> <alias name="VaListAlias" c:type="RegressVaListAlias" introspectable="0"> <doc xml:space="preserve" filename="regress.h" - line="1433">Typedef'd va_list for additional reasons</doc> - <source-position filename="regress.h" line="1438"/> + line="1449">Typedef'd va_list for additional reasons</doc> + <source-position filename="regress.h" line="1454"/> <type name="va_list" c:type="va_list"/> </alias> <constant name="ANNOTATION_CALCULATED_DEFINE" @@ -92,12 +92,12 @@ </member> </enumeration> <record name="AnAnonymousUnion" c:type="RegressAnAnonymousUnion"> - <source-position filename="regress.h" line="1550"/> + <source-position filename="regress.h" line="1566"/> <field name="x" writable="1"> <type name="gint" c:type="int"/> </field> <union> - <source-position filename="regress.h" line="1549"/> + <source-position filename="regress.h" line="1565"/> <field name="a" writable="1"> <array zero-terminated="0" fixed-size="2"> <type name="LikeGnomeKeyringPasswordSchema" @@ -1097,7 +1097,8 @@ deprecated-version="1.2" writable="1" construct="1" - transfer-ownership="none"> + transfer-ownership="none" + default-value="NULL"> <doc xml:space="preserve" filename="annotation.c" line="156">This is a property which is a string</doc> @@ -1108,7 +1109,8 @@ version="1.2" writable="1" construct="1" - transfer-ownership="none"> + transfer-ownership="none" + default-value="NULL"> <doc xml:space="preserve" filename="annotation.c" line="181">This is a property annotation intentionally indented with a mix @@ -1225,14 +1227,14 @@ </record> <record name="AnonymousUnionAndStruct" c:type="RegressAnonymousUnionAndStruct"> - <source-position filename="regress.h" line="1563"/> + <source-position filename="regress.h" line="1579"/> <field name="x" writable="1"> <type name="gint" c:type="int"/> </field> <union> - <source-position filename="regress.h" line="1562"/> + <source-position filename="regress.h" line="1578"/> <record> - <source-position filename="regress.h" line="1559"/> + <source-position filename="regress.h" line="1575"/> <field name="a" writable="1"> <type name="LikeGnomeKeyringPasswordSchema" c:type="RegressLikeGnomeKeyringPasswordSchema*"/> @@ -1248,6 +1250,12 @@ </field> </union> </record> + <constant name="BAD_EXPR_CONSTANT" + value="1" + c:type="REGRESS_BAD_EXPR_CONSTANT"> + <source-position filename="regress.h" line="528"/> + <type name="gint" c:type="gint"/> + </constant> <constant name="BOOL_CONSTANT" value="true" c:type="REGRESS_BOOL_CONSTANT"> <source-position filename="regress.h" line="524"/> <type name="gboolean" c:type="gboolean"/> @@ -1503,6 +1511,7 @@ </union> <record name="FooBoxed" c:type="RegressFooBoxed" + opaque="1" glib:type-name="RegressFooBoxed" glib:get-type="regress_foo_boxed_get_type" c:symbol-prefix="foo_boxed"> @@ -1549,6 +1558,7 @@ <record name="FooBufferClass" c:type="RegressFooBufferClass" disguised="1" + opaque="1" glib:is-gtype-struct-for="FooBuffer"> <source-position filename="foo.h" line="52"/> </record> @@ -1574,6 +1584,7 @@ </callback> <record name="FooDBusData" c:type="RegressFooDBusData" + opaque="1" glib:type-name="RegressFooDBusData" glib:get-type="regress_foo_dbus_data_get_type" c:symbol-prefix="foo_dbus_data"> @@ -2150,7 +2161,8 @@ <property name="string" writable="1" construct="1" - transfer-ownership="none"> + transfer-ownership="none" + default-value="NULL"> <type name="utf8" c:type="gchar*"/> </property> <field name="parent_instance"> @@ -2243,6 +2255,7 @@ <record name="FooOtherObjectClass" c:type="RegressFooOtherObjectClass" disguised="1" + opaque="1" glib:is-gtype-struct-for="FooOtherObject"> <source-position filename="foo.h" line="54"/> </record> @@ -2369,7 +2382,8 @@ </record> <record name="FooStructPrivate" c:type="RegressFooStructPrivate" - disguised="1"> + disguised="1" + opaque="1"> <source-position filename="foo.h" line="325"/> </record> <interface name="FooSubInterface" @@ -2602,13 +2616,19 @@ <constant name="GI_SCANNER_ELSE" value="3" c:type="REGRESS_GI_SCANNER_ELSE"> - <source-position filename="regress.h" line="1527"/> + <source-position filename="regress.h" line="1543"/> <type name="gint" c:type="gint"/> </constant> <constant name="GI_SCANNER_IFDEF" value="3" c:type="REGRESS_GI_SCANNER_IFDEF"> - <source-position filename="regress.h" line="1531"/> + <source-position filename="regress.h" line="1547"/> + <type name="gint" c:type="gint"/> + </constant> + <constant name="GOOD_EXPR_CONSTANT" + value="-2305843009213693952" + c:type="REGRESS_GOOD_EXPR_CONSTANT"> + <source-position filename="regress.h" line="527"/> <type name="gint" c:type="gint"/> </constant> <constant name="GUINT64_CONSTANT" @@ -2620,7 +2640,7 @@ <constant name="GUINT64_CONSTANTA" value="18446744073709551615" c:type="REGRESS_GUINT64_CONSTANTA"> - <source-position filename="regress.h" line="529"/> + <source-position filename="regress.h" line="531"/> <type name="TestTypeGUInt64" c:type="RegressTestTypeGUInt64"/> </constant> <constant name="G_GINT64_CONSTANT" @@ -2633,21 +2653,21 @@ <source-position filename="regress.h" line="520"/> <type name="gint" c:type="gint"/> </constant> - <record name="Intset" c:type="RegressIntset" disguised="1"> + <record name="Intset" c:type="RegressIntset" disguised="1" opaque="1"> <doc xml:space="preserve" filename="regress.h" - line="1406">Like telepathy-glib's TpIntset.</doc> - <source-position filename="regress.h" line="1412"/> + line="1422">Like telepathy-glib's TpIntset.</doc> + <source-position filename="regress.h" line="1428"/> </record> <constant name="LONG_STRING_CONSTANT" value="TYPE,VALUE,ENCODING,CHARSET,LANGUAGE,DOM,INTL,POSTAL,PARCEL,HOME,WORK,PREF,VOICE,FAX,MSG,CELL,PAGER,BBS,MODEM,CAR,ISDN,VIDEO,AOL,APPLELINK,ATTMAIL,CIS,EWORLD,INTERNET,IBMMAIL,MCIMAIL,POWERSHARE,PRODIGY,TLX,X400,GIF,CGM,WMF,BMP,MET,PMB,DIB,PICT,TIFF,PDF,PS,JPEG,QTIME,MPEG,MPEG2,AVI,WAVE,AIFF,PCM,X509,PGP" c:type="REGRESS_LONG_STRING_CONSTANT"> - <source-position filename="regress.h" line="1498"/> + <source-position filename="regress.h" line="1514"/> <type name="utf8" c:type="gchar*"/> </constant> <record name="LikeGnomeKeyringPasswordSchema" c:type="RegressLikeGnomeKeyringPasswordSchema"> - <source-position filename="regress.h" line="1517"/> + <source-position filename="regress.h" line="1533"/> <field name="dummy" writable="1"> <type name="gint" c:type="int"/> </field> @@ -2661,7 +2681,7 @@ </field> </record> <record name="LikeXklConfigItem" c:type="RegressLikeXklConfigItem"> - <source-position filename="regress.h" line="1484"/> + <source-position filename="regress.h" line="1500"/> <field name="name" writable="1"> <array zero-terminated="0" fixed-size="32"> <type name="gchar" c:type="gchar"/> @@ -2669,7 +2689,7 @@ </field> <method name="set_name" c:identifier="regress_like_xkl_config_item_set_name"> - <source-position filename="regress.h" line="1488"/> + <source-position filename="regress.h" line="1504"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -2686,13 +2706,13 @@ <constant name="MAXUINT64" value="18446744073709551615" c:type="REGRESS_MAXUINT64"> - <source-position filename="regress.h" line="1521"/> + <source-position filename="regress.h" line="1537"/> <type name="guint64" c:type="guint64"/> </constant> <constant name="MININT64" value="-9223372036854775808" c:type="REGRESS_MININT64"> - <source-position filename="regress.h" line="1520"/> + <source-position filename="regress.h" line="1536"/> <type name="gint64" c:type="gint64"/> </constant> <constant name="Mixed_Case_Constant" @@ -2718,9 +2738,9 @@ introspectable="0"> <doc xml:space="preserve" filename="regress.h" - line="1388">This should be skipped, and moreover, all function which + line="1404">This should be skipped, and moreover, all function which use it should be.</doc> - <source-position filename="regress.h" line="1398"/> + <source-position filename="regress.h" line="1414"/> <field name="x" writable="1"> <type name="gint" c:type="int"/> </field> @@ -2731,7 +2751,7 @@ <function-macro name="TEST_FLOATING" c:identifier="REGRESS_TEST_FLOATING" introspectable="0"> - <source-position filename="regress.h" line="1316"/> + <source-position filename="regress.h" line="1332"/> <parameters> <parameter name="object"> </parameter> @@ -2740,7 +2760,7 @@ <function-macro name="TEST_FLOATING_GET_CLASS" c:identifier="REGRESS_TEST_FLOATING_GET_CLASS" introspectable="0"> - <source-position filename="regress.h" line="1318"/> + <source-position filename="regress.h" line="1334"/> <parameters> <parameter name="obj"> </parameter> @@ -2749,7 +2769,7 @@ <function-macro name="TEST_FUNDAMENTAL_OBJECT" c:identifier="REGRESS_TEST_FUNDAMENTAL_OBJECT" introspectable="0"> - <source-position filename="regress.h" line="1020"/> + <source-position filename="regress.h" line="1036"/> <parameters> <parameter name="obj"> </parameter> @@ -2758,7 +2778,7 @@ <function-macro name="TEST_FUNDAMENTAL_OBJECT_CAST" c:identifier="REGRESS_TEST_FUNDAMENTAL_OBJECT_CAST" introspectable="0"> - <source-position filename="regress.h" line="1022"/> + <source-position filename="regress.h" line="1038"/> <parameters> <parameter name="obj"> </parameter> @@ -2767,7 +2787,7 @@ <function-macro name="TEST_FUNDAMENTAL_OBJECT_CLASS" c:identifier="REGRESS_TEST_FUNDAMENTAL_OBJECT_CLASS" introspectable="0"> - <source-position filename="regress.h" line="1021"/> + <source-position filename="regress.h" line="1037"/> <parameters> <parameter name="klass"> </parameter> @@ -2776,7 +2796,7 @@ <function-macro name="TEST_FUNDAMENTAL_OBJECT_GET_CLASS" c:identifier="REGRESS_TEST_FUNDAMENTAL_OBJECT_GET_CLASS" introspectable="0"> - <source-position filename="regress.h" line="1019"/> + <source-position filename="regress.h" line="1035"/> <parameters> <parameter name="obj"> </parameter> @@ -2785,7 +2805,7 @@ <function-macro name="TEST_GNUC_EXTENSION_STMT" c:identifier="REGRESS_TEST_GNUC_EXTENSION_STMT" introspectable="0"> - <source-position filename="regress.h" line="1494"/> + <source-position filename="regress.h" line="1510"/> <parameters> <parameter name="foo"> </parameter> @@ -2794,7 +2814,7 @@ <function-macro name="TEST_INTERFACE" c:identifier="REGRESS_TEST_INTERFACE" introspectable="0"> - <source-position filename="regress.h" line="1264"/> + <source-position filename="regress.h" line="1280"/> <parameters> <parameter name="object"> </parameter> @@ -2803,7 +2823,7 @@ <function-macro name="TEST_INTERFACE_GET_IFACE" c:identifier="REGRESS_TEST_INTERFACE_GET_IFACE" introspectable="0"> - <source-position filename="regress.h" line="1266"/> + <source-position filename="regress.h" line="1282"/> <parameters> <parameter name="obj"> </parameter> @@ -2812,7 +2832,7 @@ <function-macro name="TEST_IS_FLOATING" c:identifier="REGRESS_TEST_IS_FLOATING" introspectable="0"> - <source-position filename="regress.h" line="1317"/> + <source-position filename="regress.h" line="1333"/> <parameters> <parameter name="object"> </parameter> @@ -2821,7 +2841,7 @@ <function-macro name="TEST_IS_FUNDAMENTAL_OBJECT" c:identifier="REGRESS_TEST_IS_FUNDAMENTAL_OBJECT" introspectable="0"> - <source-position filename="regress.h" line="1017"/> + <source-position filename="regress.h" line="1033"/> <parameters> <parameter name="obj"> </parameter> @@ -2830,7 +2850,7 @@ <function-macro name="TEST_IS_FUNDAMENTAL_OBJECT_CLASS" c:identifier="REGRESS_TEST_IS_FUNDAMENTAL_OBJECT_CLASS" introspectable="0"> - <source-position filename="regress.h" line="1018"/> + <source-position filename="regress.h" line="1034"/> <parameters> <parameter name="klass"> </parameter> @@ -2839,7 +2859,7 @@ <function-macro name="TEST_IS_INTERFACE" c:identifier="REGRESS_TEST_IS_INTERFACE" introspectable="0"> - <source-position filename="regress.h" line="1265"/> + <source-position filename="regress.h" line="1281"/> <parameters> <parameter name="object"> </parameter> @@ -2848,7 +2868,7 @@ <function-macro name="TEST_IS_OBJECT" c:identifier="REGRESS_TEST_IS_OBJECT" introspectable="0"> - <source-position filename="regress.h" line="761"/> + <source-position filename="regress.h" line="777"/> <parameters> <parameter name="object"> </parameter> @@ -2857,7 +2877,7 @@ <function-macro name="TEST_IS_SUB_OBJECT" c:identifier="REGRESS_TEST_IS_SUB_OBJECT" introspectable="0"> - <source-position filename="regress.h" line="983"/> + <source-position filename="regress.h" line="999"/> <parameters> <parameter name="object"> </parameter> @@ -2866,7 +2886,7 @@ <function-macro name="TEST_IS_WI_802_1X" c:identifier="REGRESS_TEST_IS_WI_802_1X" introspectable="0"> - <source-position filename="regress.h" line="1283"/> + <source-position filename="regress.h" line="1299"/> <parameters> <parameter name="object"> </parameter> @@ -2875,7 +2895,7 @@ <function-macro name="TEST_OBJECT" c:identifier="REGRESS_TEST_OBJECT" introspectable="0"> - <source-position filename="regress.h" line="760"/> + <source-position filename="regress.h" line="776"/> <parameters> <parameter name="object"> </parameter> @@ -2884,7 +2904,7 @@ <function-macro name="TEST_OBJ_GET_CLASS" c:identifier="REGRESS_TEST_OBJ_GET_CLASS" introspectable="0"> - <source-position filename="regress.h" line="762"/> + <source-position filename="regress.h" line="778"/> <parameters> <parameter name="obj"> </parameter> @@ -2893,7 +2913,7 @@ <function-macro name="TEST_SUB_OBJECT" c:identifier="REGRESS_TEST_SUB_OBJECT" introspectable="0"> - <source-position filename="regress.h" line="982"/> + <source-position filename="regress.h" line="998"/> <parameters> <parameter name="object"> </parameter> @@ -2902,7 +2922,7 @@ <function-macro name="TEST_SUB_OBJ_GET_CLASS" c:identifier="REGRESS_TEST_SUB_OBJ_GET_CLASS" introspectable="0"> - <source-position filename="regress.h" line="984"/> + <source-position filename="regress.h" line="1000"/> <parameters> <parameter name="obj"> </parameter> @@ -2911,7 +2931,7 @@ <function-macro name="TEST_VALUE_HOLDS_FUNDAMENTAL_OBJECT" c:identifier="REGRESS_TEST_VALUE_HOLDS_FUNDAMENTAL_OBJECT" introspectable="0"> - <source-position filename="regress.h" line="1057"/> + <source-position filename="regress.h" line="1073"/> <parameters> <parameter name="value"> </parameter> @@ -2920,7 +2940,7 @@ <function-macro name="TEST_WI_802_1X" c:identifier="REGRESS_TEST_WI_802_1X" introspectable="0"> - <source-position filename="regress.h" line="1282"/> + <source-position filename="regress.h" line="1298"/> <parameters> <parameter name="object"> </parameter> @@ -2929,7 +2949,7 @@ <function-macro name="TEST_WI_802_1X_GET_CLASS" c:identifier="REGRESS_TEST_WI_802_1X_GET_CLASS" introspectable="0"> - <source-position filename="regress.h" line="1284"/> + <source-position filename="regress.h" line="1300"/> <parameters> <parameter name="obj"> </parameter> @@ -2969,7 +2989,7 @@ glib:type-name="RegressTestBoxed" glib:get-type="regress_test_boxed_get_type" c:symbol-prefix="test_boxed"> - <source-position filename="regress.h" line="674"/> + <source-position filename="regress.h" line="685"/> <field name="some_int8" writable="1"> <type name="gint8" c:type="gint8"/> </field> @@ -2980,14 +3000,14 @@ <type name="TestBoxedPrivate" c:type="RegressTestBoxedPrivate*"/> </field> <constructor name="new" c:identifier="regress_test_boxed_new"> - <source-position filename="regress.h" line="680"/> + <source-position filename="regress.h" line="691"/> <return-value transfer-ownership="full"> <type name="TestBoxed" c:type="RegressTestBoxed*"/> </return-value> </constructor> <constructor name="new_alternative_constructor1" c:identifier="regress_test_boxed_new_alternative_constructor1"> - <source-position filename="regress.h" line="683"/> + <source-position filename="regress.h" line="694"/> <return-value transfer-ownership="full"> <type name="TestBoxed" c:type="RegressTestBoxed*"/> </return-value> @@ -2999,7 +3019,7 @@ </constructor> <constructor name="new_alternative_constructor2" c:identifier="regress_test_boxed_new_alternative_constructor2"> - <source-position filename="regress.h" line="686"/> + <source-position filename="regress.h" line="697"/> <return-value transfer-ownership="full"> <type name="TestBoxed" c:type="RegressTestBoxed*"/> </return-value> @@ -3014,7 +3034,7 @@ </constructor> <constructor name="new_alternative_constructor3" c:identifier="regress_test_boxed_new_alternative_constructor3"> - <source-position filename="regress.h" line="689"/> + <source-position filename="regress.h" line="700"/> <return-value transfer-ownership="full"> <type name="TestBoxed" c:type="RegressTestBoxed*"/> </return-value> @@ -3027,7 +3047,7 @@ <method name="_not_a_method" c:identifier="regress_test_boxeds_not_a_method" moved-to="test_boxeds_not_a_method"> - <source-position filename="regress.h" line="701"/> + <source-position filename="regress.h" line="712"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3038,7 +3058,7 @@ </parameters> </method> <method name="copy" c:identifier="regress_test_boxed_copy"> - <source-position filename="regress.h" line="693"/> + <source-position filename="regress.h" line="704"/> <return-value transfer-ownership="full"> <type name="TestBoxed" c:type="RegressTestBoxed*"/> </return-value> @@ -3049,7 +3069,7 @@ </parameters> </method> <method name="equals" c:identifier="regress_test_boxed_equals"> - <source-position filename="regress.h" line="696"/> + <source-position filename="regress.h" line="707"/> <return-value transfer-ownership="none"> <type name="gboolean" c:type="gboolean"/> </return-value> @@ -3068,7 +3088,7 @@ glib:type-name="RegressTestBoxedB" glib:get-type="regress_test_boxed_b_get_type" c:symbol-prefix="test_boxed_b"> - <source-position filename="regress.h" line="712"/> + <source-position filename="regress.h" line="723"/> <field name="some_int8" writable="1"> <type name="gint8" c:type="gint8"/> </field> @@ -3076,7 +3096,7 @@ <type name="glong" c:type="glong"/> </field> <constructor name="new" c:identifier="regress_test_boxed_b_new"> - <source-position filename="regress.h" line="719"/> + <source-position filename="regress.h" line="730"/> <return-value transfer-ownership="full"> <type name="TestBoxedB" c:type="RegressTestBoxedB*"/> </return-value> @@ -3090,7 +3110,7 @@ </parameters> </constructor> <method name="copy" c:identifier="regress_test_boxed_b_copy"> - <source-position filename="regress.h" line="722"/> + <source-position filename="regress.h" line="733"/> <return-value transfer-ownership="full"> <type name="TestBoxedB" c:type="RegressTestBoxedB*"/> </return-value> @@ -3106,7 +3126,7 @@ glib:type-name="RegressTestBoxedC" glib:get-type="regress_test_boxed_c_get_type" c:symbol-prefix="test_boxed_c"> - <source-position filename="regress.h" line="730"/> + <source-position filename="regress.h" line="741"/> <field name="refcount" writable="1"> <type name="guint" c:type="guint"/> </field> @@ -3114,7 +3134,7 @@ <type name="guint" c:type="guint"/> </field> <constructor name="new" c:identifier="regress_test_boxed_c_new"> - <source-position filename="regress.h" line="736"/> + <source-position filename="regress.h" line="747"/> <return-value transfer-ownership="full"> <type name="TestBoxedC" c:type="RegressTestBoxedC*"/> </return-value> @@ -3122,12 +3142,15 @@ </record> <record name="TestBoxedD" c:type="RegressTestBoxedD" + opaque="1" + copy-function="regress_test_boxed_d_copy" + free-function="regress_test_boxed_d_free" glib:type-name="RegressTestBoxedD" glib:get-type="regress_test_boxed_d_get_type" c:symbol-prefix="test_boxed_d"> - <source-position filename="regress.h" line="738"/> + <source-position filename="regress.h" line="754"/> <constructor name="new" c:identifier="regress_test_boxed_d_new"> - <source-position filename="regress.h" line="746"/> + <source-position filename="regress.h" line="762"/> <return-value transfer-ownership="full"> <type name="TestBoxedD" c:type="RegressTestBoxedD*"/> </return-value> @@ -3141,7 +3164,7 @@ </parameters> </constructor> <method name="copy" c:identifier="regress_test_boxed_d_copy"> - <source-position filename="regress.h" line="749"/> + <source-position filename="regress.h" line="765"/> <return-value transfer-ownership="full"> <type name="TestBoxedD" c:type="RegressTestBoxedD*"/> </return-value> @@ -3152,7 +3175,7 @@ </parameters> </method> <method name="free" c:identifier="regress_test_boxed_d_free"> - <source-position filename="regress.h" line="752"/> + <source-position filename="regress.h" line="768"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3163,7 +3186,7 @@ </parameters> </method> <method name="get_magic" c:identifier="regress_test_boxed_d_get_magic"> - <source-position filename="regress.h" line="756"/> + <source-position filename="regress.h" line="772"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -3176,17 +3199,18 @@ </record> <record name="TestBoxedPrivate" c:type="RegressTestBoxedPrivate" - disguised="1"> - <source-position filename="regress.h" line="666"/> + disguised="1" + opaque="1"> + <source-position filename="regress.h" line="677"/> </record> <callback name="TestCallback" c:type="RegressTestCallback"> - <source-position filename="regress.h" line="1144"/> + <source-position filename="regress.h" line="1160"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> </callback> <callback name="TestCallbackArray" c:type="RegressTestCallbackArray"> - <source-position filename="regress.h" line="1176"/> + <source-position filename="regress.h" line="1192"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -3211,7 +3235,7 @@ </callback> <callback name="TestCallbackArrayInOut" c:type="RegressTestCallbackArrayInOut"> - <source-position filename="regress.h" line="1182"/> + <source-position filename="regress.h" line="1198"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3233,7 +3257,7 @@ </parameters> </callback> <callback name="TestCallbackFull" c:type="RegressTestCallbackFull"> - <source-position filename="regress.h" line="1163"/> + <source-position filename="regress.h" line="1179"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -3241,25 +3265,25 @@ <parameter name="foo" transfer-ownership="none"> <doc xml:space="preserve" filename="regress.h" - line="1159">the investment rate</doc> + line="1175">the investment rate</doc> <type name="gint" c:type="int"/> </parameter> <parameter name="bar" transfer-ownership="none"> <doc xml:space="preserve" filename="regress.h" - line="1160">how much money</doc> + line="1176">how much money</doc> <type name="gdouble" c:type="double"/> </parameter> <parameter name="path" transfer-ownership="none"> <doc xml:space="preserve" filename="regress.h" - line="1161">Path to file</doc> + line="1177">Path to file</doc> <type name="filename" c:type="char*"/> </parameter> </parameters> </callback> <callback name="TestCallbackGError" c:type="RegressTestCallbackGError"> - <source-position filename="regress.h" line="1151"/> + <source-position filename="regress.h" line="1167"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3271,7 +3295,7 @@ </callback> <callback name="TestCallbackHashtable" c:type="RegressTestCallbackHashtable"> - <source-position filename="regress.h" line="1150"/> + <source-position filename="regress.h" line="1166"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3279,7 +3303,7 @@ <parameter name="data" transfer-ownership="none"> <doc xml:space="preserve" filename="regress.h" - line="1148">a hash table; will be modified</doc> + line="1164">a hash table; will be modified</doc> <type name="GLib.HashTable" c:type="GHashTable*"> <type name="utf8"/> <type name="gint"/> @@ -3289,7 +3313,7 @@ </callback> <callback name="TestCallbackOwnedGError" c:type="RegressTestCallbackOwnedGError"> - <source-position filename="regress.h" line="1156"/> + <source-position filename="regress.h" line="1172"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3297,20 +3321,20 @@ <parameter name="error" transfer-ownership="full"> <doc xml:space="preserve" filename="regress.h" - line="1154">GError instance; must be freed by the callback</doc> + line="1170">GError instance; must be freed by the callback</doc> <type name="GLib.Error" c:type="GError*"/> </parameter> </parameters> </callback> <callback name="TestCallbackReturnFull" c:type="RegressTestCallbackReturnFull"> - <source-position filename="regress.h" line="1168"/> + <source-position filename="regress.h" line="1184"/> <return-value transfer-ownership="full"> <type name="TestObj" c:type="RegressTestObj*"/> </return-value> </callback> <callback name="TestCallbackUserData" c:type="RegressTestCallbackUserData"> - <source-position filename="regress.h" line="1145"/> + <source-position filename="regress.h" line="1161"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -3449,7 +3473,7 @@ </enumeration> <callback name="TestExternallyDefinedCallback" c:type="RegressTestExternallyDefinedCallback"> - <source-position filename="regress.h" line="791"/> + <source-position filename="regress.h" line="807"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3492,9 +3516,9 @@ glib:type-name="RegressTestFloating" glib:get-type="regress_test_floating_get_type" glib:type-struct="TestFloatingClass"> - <source-position filename="regress.h" line="1328"/> + <source-position filename="regress.h" line="1344"/> <constructor name="new" c:identifier="regress_test_floating_new"> - <source-position filename="regress.h" line="1335"/> + <source-position filename="regress.h" line="1351"/> <return-value transfer-ownership="none"> <doc xml:space="preserve" filename="regress.c" @@ -3509,7 +3533,7 @@ <record name="TestFloatingClass" c:type="RegressTestFloatingClass" glib:is-gtype-struct-for="TestFloating"> - <source-position filename="regress.h" line="1328"/> + <source-position filename="regress.h" line="1344"/> <field name="parent_class"> <type name="GObject.InitiallyUnownedClass" c:type="GInitiallyUnownedClass"/> @@ -3527,9 +3551,9 @@ glib:unref-func="regress_test_fundamental_object_unref" glib:set-value-func="regress_test_value_set_fundamental_object" glib:get-value-func="regress_test_value_get_fundamental_object"> - <source-position filename="regress.h" line="1046"/> + <source-position filename="regress.h" line="1062"/> <virtual-method name="copy"> - <source-position filename="regress.h" line="1031"/> + <source-position filename="regress.h" line="1047"/> <return-value transfer-ownership="full"> <type name="TestFundamentalObject" c:type="RegressTestFundamentalObject*"/> @@ -3542,7 +3566,7 @@ </parameters> </virtual-method> <virtual-method name="finalize"> - <source-position filename="regress.h" line="1032"/> + <source-position filename="regress.h" line="1048"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3554,7 +3578,7 @@ </parameters> </virtual-method> <method name="ref" c:identifier="regress_test_fundamental_object_ref"> - <source-position filename="regress.h" line="1052"/> + <source-position filename="regress.h" line="1068"/> <return-value transfer-ownership="full"> <doc xml:space="preserve" filename="regress.c" @@ -3572,7 +3596,7 @@ </method> <method name="unref" c:identifier="regress_test_fundamental_object_unref"> - <source-position filename="regress.h" line="1055"/> + <source-position filename="regress.h" line="1071"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3597,7 +3621,7 @@ <record name="TestFundamentalObjectClass" c:type="RegressTestFundamentalObjectClass" glib:is-gtype-struct-for="TestFundamentalObject"> - <source-position filename="regress.h" line="1046"/> + <source-position filename="regress.h" line="1062"/> <field name="type_class"> <type name="GObject.TypeClass" c:type="GTypeClass"/> </field> @@ -3612,7 +3636,7 @@ </record> <callback name="TestFundamentalObjectCopyFunction" c:type="RegressTestFundamentalObjectCopyFunction"> - <source-position filename="regress.h" line="1031"/> + <source-position filename="regress.h" line="1047"/> <return-value transfer-ownership="full"> <type name="TestFundamentalObject" c:type="RegressTestFundamentalObject*"/> @@ -3626,7 +3650,7 @@ </callback> <callback name="TestFundamentalObjectFinalizeFunction" c:type="RegressTestFundamentalObjectFinalizeFunction"> - <source-position filename="regress.h" line="1032"/> + <source-position filename="regress.h" line="1048"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3649,10 +3673,10 @@ <doc xml:space="preserve" filename="regress.c" line="3763">Just like a #RegressTestFundamentalObject but without gvalue setter and getter</doc> - <source-position filename="regress.h" line="1094"/> + <source-position filename="regress.h" line="1110"/> <constructor name="new" c:identifier="regress_test_fundamental_object_no_get_set_func_new"> - <source-position filename="regress.h" line="1127"/> + <source-position filename="regress.h" line="1143"/> <return-value transfer-ownership="full"> <type name="TestFundamentalObjectNoGetSetFunc" c:type="RegressTestFundamentalObjectNoGetSetFunc*"/> @@ -3665,14 +3689,14 @@ </constructor> <function name="make_compatible_with_fundamental_sub_object" c:identifier="regress_test_fundamental_object_no_get_set_func_make_compatible_with_fundamental_sub_object"> - <source-position filename="regress.h" line="1139"/> + <source-position filename="regress.h" line="1155"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> </function> <method name="get_data" c:identifier="regress_test_fundamental_object_no_get_set_func_get_data"> - <source-position filename="regress.h" line="1131"/> + <source-position filename="regress.h" line="1147"/> <return-value transfer-ownership="none"> <type name="utf8" c:type="const char*"/> </return-value> @@ -3694,7 +3718,7 @@ <record name="TestFundamentalObjectNoGetSetFuncClass" c:type="RegressTestFundamentalObjectNoGetSetFuncClass" glib:is-gtype-struct-for="TestFundamentalObjectNoGetSetFunc"> - <source-position filename="regress.h" line="1094"/> + <source-position filename="regress.h" line="1110"/> <field name="fundamental_object_class"> <type name="TestFundamentalObjectClass" c:type="RegressTestFundamentalObjectClass"/> @@ -3708,10 +3732,10 @@ glib:get-type="regress_test_fundamental_sub_object_get_type" glib:type-struct="TestFundamentalSubObjectClass" glib:fundamental="1"> - <source-position filename="regress.h" line="1076"/> + <source-position filename="regress.h" line="1092"/> <constructor name="new" c:identifier="regress_test_fundamental_sub_object_new"> - <source-position filename="regress.h" line="1119"/> + <source-position filename="regress.h" line="1135"/> <return-value transfer-ownership="full"> <type name="TestFundamentalSubObject" c:type="RegressTestFundamentalSubObject*"/> @@ -3733,7 +3757,7 @@ <record name="TestFundamentalSubObjectClass" c:type="RegressTestFundamentalSubObjectClass" glib:is-gtype-struct-for="TestFundamentalSubObject"> - <source-position filename="regress.h" line="1076"/> + <source-position filename="regress.h" line="1092"/> <field name="fundamental_object_class"> <type name="TestFundamentalObjectClass" c:type="RegressTestFundamentalObjectClass"/> @@ -3747,10 +3771,10 @@ glib:get-type="regress_test_fundamental_sub_object_no_get_set_func_get_type" glib:type-struct="TestFundamentalSubObjectNoGetSetFuncClass" glib:fundamental="1"> - <source-position filename="regress.h" line="1109"/> + <source-position filename="regress.h" line="1125"/> <constructor name="new" c:identifier="regress_test_fundamental_sub_object_no_get_set_func_new"> - <source-position filename="regress.h" line="1135"/> + <source-position filename="regress.h" line="1151"/> <return-value transfer-ownership="full"> <type name="TestFundamentalSubObjectNoGetSetFunc" c:type="RegressTestFundamentalSubObjectNoGetSetFunc*"/> @@ -3769,7 +3793,7 @@ <record name="TestFundamentalSubObjectNoGetSetFuncClass" c:type="RegressTestFundamentalSubObjectNoGetSetFuncClass" glib:is-gtype-struct-for="TestFundamentalSubObjectNoGetSetFunc"> - <source-position filename="regress.h" line="1109"/> + <source-position filename="regress.h" line="1125"/> <field name="fundamental_object_class"> <type name="TestFundamentalObjectNoGetSetFuncClass" c:type="RegressTestFundamentalObjectNoGetSetFuncClass"/> @@ -3893,10 +3917,10 @@ glib:type-name="RegressTestInterface" glib:get-type="regress_test_interface_get_type" glib:type-struct="TestInterfaceIface"> - <source-position filename="regress.h" line="1272"/> + <source-position filename="regress.h" line="1288"/> <method name="emit_signal" c:identifier="regress_test_interface_emit_signal"> - <source-position filename="regress.h" line="1278"/> + <source-position filename="regress.h" line="1294"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3912,7 +3936,8 @@ <property name="number" writable="1" construct="1" - transfer-ownership="none"> + transfer-ownership="none" + default-value="0"> <type name="gint" c:type="gint"/> </property> <glib:signal name="interface-signal" when="last"> @@ -3933,13 +3958,13 @@ <record name="TestInterfaceIface" c:type="RegressTestInterfaceIface" glib:is-gtype-struct-for="TestInterface"> - <source-position filename="regress.h" line="1272"/> + <source-position filename="regress.h" line="1288"/> <field name="base_iface"> <type name="GObject.TypeInterface" c:type="GTypeInterface"/> </field> </record> <callback name="TestNoPtrCallback" c:type="RegressTestNoPtrCallback"> - <source-position filename="regress.h" line="1143"/> + <source-position filename="regress.h" line="1159"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -3951,15 +3976,15 @@ glib:type-name="RegressTestObj" glib:get-type="regress_test_obj_get_type" glib:type-struct="TestObjClass"> - <source-position filename="regress.h" line="813"/> + <source-position filename="regress.h" line="829"/> <constructor name="constructor" c:identifier="regress_constructor"> - <source-position filename="regress.h" line="822"/> + <source-position filename="regress.h" line="838"/> <return-value transfer-ownership="full"> <type name="TestObj" c:type="RegressTestObj*"/> </return-value> </constructor> <constructor name="new" c:identifier="regress_test_obj_new"> - <source-position filename="regress.h" line="819"/> + <source-position filename="regress.h" line="835"/> <return-value transfer-ownership="full"> <type name="TestObj" c:type="RegressTestObj*"/> </return-value> @@ -3974,7 +3999,7 @@ </constructor> <constructor name="new_callback" c:identifier="regress_test_obj_new_callback"> - <source-position filename="regress.h" line="1240"/> + <source-position filename="regress.h" line="1256"/> <return-value transfer-ownership="full"> <type name="TestObj" c:type="RegressTestObj*"/> </return-value> @@ -4001,7 +4026,7 @@ <constructor name="new_from_file" c:identifier="regress_test_obj_new_from_file" throws="1"> - <source-position filename="regress.h" line="825"/> + <source-position filename="regress.h" line="841"/> <return-value transfer-ownership="full"> <type name="TestObj" c:type="RegressTestObj*"/> </return-value> @@ -4012,7 +4037,7 @@ </parameters> </constructor> <function name="null_out" c:identifier="regress_test_obj_null_out"> - <source-position filename="regress.h" line="966"/> + <source-position filename="regress.h" line="982"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4032,7 +4057,7 @@ </function> <function name="static_method" c:identifier="regress_test_obj_static_method"> - <source-position filename="regress.h" line="867"/> + <source-position filename="regress.h" line="883"/> <return-value transfer-ownership="none"> <type name="gdouble" c:type="double"/> </return-value> @@ -4044,7 +4069,7 @@ </function> <function name="static_method_callback" c:identifier="regress_test_obj_static_method_callback"> - <source-position filename="regress.h" line="1237"/> + <source-position filename="regress.h" line="1253"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4059,7 +4084,7 @@ </parameters> </function> <virtual-method name="allow_none_vfunc"> - <source-position filename="regress.h" line="803"/> + <source-position filename="regress.h" line="819"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4073,13 +4098,13 @@ allow-none="1"> <doc xml:space="preserve" filename="regress.h" - line="801">Another object</doc> + line="817">Another object</doc> <type name="TestObj" c:type="RegressTestObj*"/> </parameter> </parameters> </virtual-method> <virtual-method name="complex_vfunc"> - <source-position filename="regress.h" line="791"/> + <source-position filename="regress.h" line="807"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4098,7 +4123,7 @@ line="3221">This method is virtual. Notably its name differs from the virtual slot name, which makes it useful for testing bindings handle this case.</doc> - <source-position filename="regress.h" line="797"/> + <source-position filename="regress.h" line="813"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -4123,7 +4148,7 @@ line="3221">This method is virtual. Notably its name differs from the virtual slot name, which makes it useful for testing bindings handle this case.</doc> - <source-position filename="regress.h" line="959"/> + <source-position filename="regress.h" line="975"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -4144,7 +4169,7 @@ </method> <method name="emit_sig_with_array_len_prop" c:identifier="regress_test_obj_emit_sig_with_array_len_prop"> - <source-position filename="regress.h" line="849"/> + <source-position filename="regress.h" line="865"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4156,7 +4181,7 @@ </method> <method name="emit_sig_with_error" c:identifier="regress_test_obj_emit_sig_with_error"> - <source-position filename="regress.h" line="855"/> + <source-position filename="regress.h" line="871"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4171,7 +4196,7 @@ </method> <method name="emit_sig_with_foreign_struct" c:identifier="regress_test_obj_emit_sig_with_foreign_struct"> - <source-position filename="regress.h" line="840"/> + <source-position filename="regress.h" line="856"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4186,7 +4211,7 @@ <doc xml:space="preserve" filename="regress.c" line="2926">The signal handler must increment the inout parameter by 1.</doc> - <source-position filename="regress.h" line="852"/> + <source-position filename="regress.h" line="868"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4201,7 +4226,7 @@ </method> <method name="emit_sig_with_int64" c:identifier="regress_test_obj_emit_sig_with_int64"> - <source-position filename="regress.h" line="843"/> + <source-position filename="regress.h" line="859"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4213,7 +4238,7 @@ </method> <method name="emit_sig_with_null_error" c:identifier="regress_test_obj_emit_sig_with_null_error"> - <source-position filename="regress.h" line="858"/> + <source-position filename="regress.h" line="874"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4228,7 +4253,7 @@ </method> <method name="emit_sig_with_obj" c:identifier="regress_test_obj_emit_sig_with_obj"> - <source-position filename="regress.h" line="837"/> + <source-position filename="regress.h" line="853"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4240,7 +4265,7 @@ </method> <method name="emit_sig_with_uint64" c:identifier="regress_test_obj_emit_sig_with_uint64"> - <source-position filename="regress.h" line="846"/> + <source-position filename="regress.h" line="862"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4251,7 +4276,7 @@ </parameters> </method> <method name="forced_method" c:identifier="regress_forced_method"> - <source-position filename="regress.h" line="870"/> + <source-position filename="regress.h" line="886"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4267,7 +4292,7 @@ <method name="get_string" c:identifier="regress_test_obj_get_string" glib:get-property="string"> - <source-position filename="regress.h" line="834"/> + <source-position filename="regress.h" line="850"/> <return-value transfer-ownership="none"> <type name="utf8" c:type="const char*"/> </return-value> @@ -4279,7 +4304,7 @@ </method> <method name="instance_method" c:identifier="regress_test_obj_instance_method"> - <source-position filename="regress.h" line="861"/> + <source-position filename="regress.h" line="877"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -4291,7 +4316,7 @@ </method> <method name="instance_method_callback" c:identifier="regress_test_obj_instance_method_callback"> - <source-position filename="regress.h" line="1234"/> + <source-position filename="regress.h" line="1250"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4310,7 +4335,7 @@ </method> <method name="instance_method_full" c:identifier="regress_test_obj_instance_method_full"> - <source-position filename="regress.h" line="864"/> + <source-position filename="regress.h" line="880"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4322,7 +4347,7 @@ </method> <method name="name_conflict" c:identifier="regress_test_obj_name_conflict"> - <source-position filename="regress.h" line="978"/> + <source-position filename="regress.h" line="994"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4337,7 +4362,7 @@ </method> <method name="not_nullable_element_typed_gpointer_in" c:identifier="regress_test_obj_not_nullable_element_typed_gpointer_in"> - <source-position filename="regress.h" line="973"/> + <source-position filename="regress.h" line="989"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4366,7 +4391,7 @@ </method> <method name="not_nullable_typed_gpointer_in" c:identifier="regress_test_obj_not_nullable_typed_gpointer_in"> - <source-position filename="regress.h" line="970"/> + <source-position filename="regress.h" line="986"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4388,7 +4413,7 @@ <method name="set_bare" c:identifier="regress_test_obj_set_bare" glib:set-property="bare"> - <source-position filename="regress.h" line="828"/> + <source-position filename="regress.h" line="844"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4407,7 +4432,7 @@ <method name="set_string" c:identifier="regress_test_obj_set_string" glib:set-property="string"> - <source-position filename="regress.h" line="831"/> + <source-position filename="regress.h" line="847"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4426,7 +4451,7 @@ <doc xml:space="preserve" filename="regress.c" line="3185">Check that the out value is skipped</doc> - <source-position filename="regress.h" line="947"/> + <source-position filename="regress.h" line="963"/> <return-value transfer-ownership="none"> <doc xml:space="preserve" filename="regress.c" @@ -4500,7 +4525,7 @@ <doc xml:space="preserve" filename="regress.c" line="3149">Check that the out value is skipped</doc> - <source-position filename="regress.h" line="935"/> + <source-position filename="regress.h" line="951"/> <return-value transfer-ownership="none"> <doc xml:space="preserve" filename="regress.c" @@ -4574,7 +4599,7 @@ <doc xml:space="preserve" filename="regress.c" line="3113">Check that a parameter is skipped</doc> - <source-position filename="regress.h" line="923"/> + <source-position filename="regress.h" line="939"/> <return-value transfer-ownership="none"> <doc xml:space="preserve" filename="regress.c" @@ -4647,7 +4672,7 @@ <doc xml:space="preserve" filename="regress.c" line="3053">Check that the return value is skipped</doc> - <source-position filename="regress.h" line="905"/> + <source-position filename="regress.h" line="921"/> <return-value transfer-ownership="none" skip="1"> <doc xml:space="preserve" filename="regress.c" @@ -4721,7 +4746,7 @@ filename="regress.c" line="3089">Check that the return value is skipped. Succeed if a is nonzero, otherwise raise an error.</doc> - <source-position filename="regress.h" line="917"/> + <source-position filename="regress.h" line="933"/> <return-value transfer-ownership="none" skip="1"> <doc xml:space="preserve" filename="regress.c" @@ -4745,7 +4770,7 @@ </method> <method name="torture_signature_0" c:identifier="regress_test_obj_torture_signature_0"> - <source-position filename="regress.h" line="885"/> + <source-position filename="regress.h" line="901"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -4791,7 +4816,7 @@ <doc xml:space="preserve" filename="regress.c" line="3021">This function throws an error if m is odd.</doc> - <source-position filename="regress.h" line="894"/> + <source-position filename="regress.h" line="910"/> <return-value transfer-ownership="none"> <type name="gboolean" c:type="gboolean"/> </return-value> @@ -4848,13 +4873,22 @@ <type name="guint8" c:type="guint8"/> </array> </property> - <property name="double" writable="1" transfer-ownership="none"> + <property name="double" + writable="1" + transfer-ownership="none" + default-value="1.000000"> <type name="gdouble" c:type="gdouble"/> </property> - <property name="float" writable="1" transfer-ownership="none"> + <property name="float" + writable="1" + transfer-ownership="none" + default-value="1.000000"> <type name="gfloat" c:type="gfloat"/> </property> - <property name="gtype" writable="1" transfer-ownership="none"> + <property name="gtype" + writable="1" + transfer-ownership="none" + default-value="G_TYPE_INVALID"> <type name="GType" c:type="GType"/> </property> <property name="hash-table" writable="1" transfer-ownership="container"> @@ -4871,10 +4905,16 @@ <type name="gint8"/> </type> </property> - <property name="int" writable="1" transfer-ownership="none"> + <property name="int" + writable="1" + transfer-ownership="none" + default-value="0"> <type name="gint" c:type="gint"/> </property> - <property name="list" writable="1" transfer-ownership="none"> + <property name="list" + writable="1" + transfer-ownership="none" + default-value="NULL"> <type name="GLib.List" c:type="gpointer"> <type name="utf8"/> </type> @@ -4887,7 +4927,8 @@ <property name="name-conflict" writable="1" construct="1" - transfer-ownership="none"> + transfer-ownership="none" + default-value="42"> <type name="gint" c:type="gint"/> </property> <property name="pptrarray" writable="1" transfer-ownership="none"> @@ -4899,13 +4940,15 @@ writable="1" transfer-ownership="none" setter="set_string" - getter="get_string"> + getter="get_string" + default-value="NULL"> <type name="utf8" c:type="gchar*"/> </property> <property name="write-only" readable="0" writable="1" - transfer-ownership="none"> + transfer-ownership="none" + default-value="FALSE"> <type name="gboolean" c:type="gboolean"/> </property> <field name="parent_instance"> @@ -4953,7 +4996,7 @@ </field> <field name="function_ptr"> <callback name="function_ptr"> - <source-position filename="regress.h" line="788"/> + <source-position filename="regress.h" line="804"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -5210,13 +5253,13 @@ <record name="TestObjClass" c:type="RegressTestObjClass" glib:is-gtype-struct-for="TestObj"> - <source-position filename="regress.h" line="813"/> + <source-position filename="regress.h" line="829"/> <field name="parent_class"> <type name="GObject.ObjectClass" c:type="GObjectClass"/> </field> <field name="matrix"> <callback name="matrix"> - <source-position filename="regress.h" line="797"/> + <source-position filename="regress.h" line="813"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -5238,7 +5281,7 @@ </field> <field name="allow_none_vfunc"> <callback name="allow_none_vfunc"> - <source-position filename="regress.h" line="803"/> + <source-position filename="regress.h" line="819"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -5252,7 +5295,7 @@ allow-none="1"> <doc xml:space="preserve" filename="regress.h" - line="801">Another object</doc> + line="817">Another object</doc> <type name="TestObj" c:type="RegressTestObj*"/> </parameter> </parameters> @@ -5270,7 +5313,7 @@ </field> <field name="_regress_reserved1" introspectable="0"> <callback name="_regress_reserved1"> - <source-position filename="regress.h" line="811"/> + <source-position filename="regress.h" line="827"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -5278,7 +5321,7 @@ </field> <field name="_regress_reserved2" introspectable="0"> <callback name="_regress_reserved2"> - <source-position filename="regress.h" line="812"/> + <source-position filename="regress.h" line="828"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -5316,7 +5359,7 @@ </function> </enumeration> <bitfield name="TestPrivateEnum" c:type="RegressTestPrivateEnum"> - <source-position filename="regress.h" line="1471"/> + <source-position filename="regress.h" line="1487"/> <member name="public_enum_before" value="1" c:identifier="REGRESS_TEST_PUBLIC_ENUM_BEFORE"> @@ -5327,7 +5370,7 @@ </member> </bitfield> <record name="TestPrivateStruct" c:type="RegressTestPrivateStruct"> - <source-position filename="regress.h" line="1463"/> + <source-position filename="regress.h" line="1479"/> <field name="this_is_public_before" writable="1"> <type name="gint" c:type="gint"/> </field> @@ -5339,7 +5382,7 @@ </field> </record> <record name="TestReferenceCounters" c:type="RegressTestReferenceCounters"> - <source-position filename="regress.h" line="1573"/> + <source-position filename="regress.h" line="1589"/> <field name="refcount" writable="1"> <type name="gint" c:type="grefcount"/> </field> @@ -5364,10 +5407,12 @@ </enumeration> <record name="TestSimpleBoxedA" c:type="RegressTestSimpleBoxedA" + copy-function="regress_test_simple_boxed_a_copy" glib:type-name="RegressTestSimpleBoxedA" glib:get-type="regress_test_simple_boxed_a_get_gtype" c:symbol-prefix="test_simple_boxed_a"> - <source-position filename="regress.h" line="632"/> + <doc xml:space="preserve" filename="regress.h" line="628">...</doc> + <source-position filename="regress.h" line="643"/> <field name="some_int" writable="1"> <type name="gint" c:type="gint"/> </field> @@ -5381,7 +5426,7 @@ <type name="TestEnum" c:type="RegressTestEnum"/> </field> <method name="copy" c:identifier="regress_test_simple_boxed_a_copy"> - <source-position filename="regress.h" line="639"/> + <source-position filename="regress.h" line="650"/> <return-value transfer-ownership="full"> <type name="TestSimpleBoxedA" c:type="RegressTestSimpleBoxedA*"/> </return-value> @@ -5392,7 +5437,7 @@ </parameters> </method> <method name="equals" c:identifier="regress_test_simple_boxed_a_equals"> - <source-position filename="regress.h" line="642"/> + <source-position filename="regress.h" line="653"/> <return-value transfer-ownership="none"> <type name="gboolean" c:type="gboolean"/> </return-value> @@ -5407,7 +5452,7 @@ </method> <function name="const_return" c:identifier="regress_test_simple_boxed_a_const_return"> - <source-position filename="regress.h" line="646"/> + <source-position filename="regress.h" line="657"/> <return-value transfer-ownership="none"> <type name="TestSimpleBoxedA" c:type="const RegressTestSimpleBoxedA*"/> @@ -5419,7 +5464,7 @@ glib:type-name="RegressTestSimpleBoxedB" glib:get-type="regress_test_simple_boxed_b_get_type" c:symbol-prefix="test_simple_boxed_b"> - <source-position filename="regress.h" line="653"/> + <source-position filename="regress.h" line="664"/> <field name="some_int8" writable="1"> <type name="gint8" c:type="gint8"/> </field> @@ -5427,7 +5472,7 @@ <type name="TestSimpleBoxedA" c:type="RegressTestSimpleBoxedA"/> </field> <method name="copy" c:identifier="regress_test_simple_boxed_b_copy"> - <source-position filename="regress.h" line="660"/> + <source-position filename="regress.h" line="671"/> <return-value transfer-ownership="full"> <type name="TestSimpleBoxedB" c:type="RegressTestSimpleBoxedB*"/> </return-value> @@ -5439,13 +5484,13 @@ </method> </record> <callback name="TestSimpleCallback" c:type="RegressTestSimpleCallback"> - <source-position filename="regress.h" line="1142"/> + <source-position filename="regress.h" line="1158"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> </callback> <record name="TestStructA" c:type="RegressTestStructA"> - <source-position filename="regress.h" line="544"/> + <source-position filename="regress.h" line="546"/> <field name="some_int" writable="1"> <type name="gint" c:type="gint"/> </field> @@ -5462,7 +5507,7 @@ <doc xml:space="preserve" filename="regress.c" line="1736">Make a copy of a RegressTestStructA</doc> - <source-position filename="regress.h" line="547"/> + <source-position filename="regress.h" line="549"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -5485,7 +5530,7 @@ </parameters> </method> <function name="parse" c:identifier="regress_test_struct_a_parse"> - <source-position filename="regress.h" line="551"/> + <source-position filename="regress.h" line="553"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -5509,7 +5554,7 @@ </function> </record> <record name="TestStructB" c:type="RegressTestStructB"> - <source-position filename="regress.h" line="560"/> + <source-position filename="regress.h" line="562"/> <field name="some_int8" writable="1"> <type name="gint8" c:type="gint8"/> </field> @@ -5520,7 +5565,7 @@ <doc xml:space="preserve" filename="regress.c" line="1779">Make a copy of a RegressTestStructB</doc> - <source-position filename="regress.h" line="563"/> + <source-position filename="regress.h" line="565"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -5544,7 +5589,7 @@ </method> </record> <record name="TestStructC" c:type="RegressTestStructC"> - <source-position filename="regress.h" line="571"/> + <source-position filename="regress.h" line="573"/> <field name="another_int" writable="1"> <type name="gint" c:type="gint"/> </field> @@ -5553,7 +5598,7 @@ </field> </record> <record name="TestStructD" c:type="RegressTestStructD"> - <source-position filename="regress.h" line="590"/> + <source-position filename="regress.h" line="592"/> <field name="array1" writable="1"> <array c:type="RegressTestStructA**"> <type name="TestStructA" c:type="RegressTestStructA*"/> @@ -5579,7 +5624,7 @@ </field> </record> <record name="TestStructE" c:type="RegressTestStructE"> - <source-position filename="regress.h" line="607"/> + <source-position filename="regress.h" line="609"/> <field name="some_type" writable="1"> <type name="GType" c:type="GType"/> </field> @@ -5619,7 +5664,7 @@ </field> </union> <record name="TestStructF" c:type="RegressTestStructF"> - <source-position filename="regress.h" line="620"/> + <source-position filename="regress.h" line="622"/> <field name="ref_count" writable="1"> <type name="gint" c:type="volatile gint"/> </field> @@ -5646,7 +5691,7 @@ </field> </record> <record name="TestStructFixedArray" c:type="RegressTestStructFixedArray"> - <source-position filename="regress.h" line="1476"/> + <source-position filename="regress.h" line="1492"/> <field name="just_int" writable="1"> <type name="gint" c:type="gint"/> </field> @@ -5656,7 +5701,7 @@ </array> </field> <method name="frob" c:identifier="regress_test_struct_fixed_array_frob"> - <source-position filename="regress.h" line="1480"/> + <source-position filename="regress.h" line="1496"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -5675,17 +5720,17 @@ glib:type-name="RegressTestSubObj" glib:get-type="regress_test_sub_obj_get_type" glib:type-struct="TestSubObjClass"> - <source-position filename="regress.h" line="1000"/> + <source-position filename="regress.h" line="1016"/> <implements name="TestInterface"/> <constructor name="new" c:identifier="regress_test_sub_obj_new"> - <source-position filename="regress.h" line="1007"/> + <source-position filename="regress.h" line="1023"/> <return-value transfer-ownership="full"> <type name="TestObj" c:type="RegressTestObj*"/> </return-value> </constructor> <method name="instance_method" c:identifier="regress_test_sub_obj_instance_method"> - <source-position filename="regress.h" line="1013"/> + <source-position filename="regress.h" line="1029"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -5696,7 +5741,7 @@ </parameters> </method> <method name="unset_bare" c:identifier="regress_test_sub_obj_unset_bare"> - <source-position filename="regress.h" line="1010"/> + <source-position filename="regress.h" line="1026"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -5709,7 +5754,8 @@ <property name="boolean" writable="1" construct="1" - transfer-ownership="none"> + transfer-ownership="none" + default-value="TRUE"> <type name="gboolean" c:type="gboolean"/> </property> <field name="parent_instance"> @@ -5725,7 +5771,7 @@ <record name="TestSubObjClass" c:type="RegressTestSubObjClass" glib:is-gtype-struct-for="TestSubObj"> - <source-position filename="regress.h" line="1000"/> + <source-position filename="regress.h" line="1016"/> <field name="parent_class"> <type name="TestObjClass" c:type="RegressTestObjClass"/> </field> @@ -5737,16 +5783,16 @@ glib:type-name="RegressTestWi8021x" glib:get-type="regress_test_wi_802_1x_get_type" glib:type-struct="TestWi8021xClass"> - <source-position filename="regress.h" line="1296"/> + <source-position filename="regress.h" line="1312"/> <constructor name="new" c:identifier="regress_test_wi_802_1x_new"> - <source-position filename="regress.h" line="1303"/> + <source-position filename="regress.h" line="1319"/> <return-value transfer-ownership="full"> <type name="TestWi8021x" c:type="RegressTestWi8021x*"/> </return-value> </constructor> <function name="static_method" c:identifier="regress_test_wi_802_1x_static_method"> - <source-position filename="regress.h" line="1312"/> + <source-position filename="regress.h" line="1328"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -5759,7 +5805,7 @@ <method name="get_testbool" c:identifier="regress_test_wi_802_1x_get_testbool" glib:get-property="testbool"> - <source-position filename="regress.h" line="1306"/> + <source-position filename="regress.h" line="1322"/> <return-value transfer-ownership="none"> <type name="gboolean" c:type="gboolean"/> </return-value> @@ -5772,7 +5818,7 @@ <method name="set_testbool" c:identifier="regress_test_wi_802_1x_set_testbool" glib:set-property="testbool"> - <source-position filename="regress.h" line="1309"/> + <source-position filename="regress.h" line="1325"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -5789,7 +5835,8 @@ writable="1" transfer-ownership="none" setter="set_testbool" - getter="get_testbool"> + getter="get_testbool" + default-value="TRUE"> <type name="gboolean" c:type="gboolean"/> </property> <field name="parent_instance"> @@ -5802,7 +5849,7 @@ <record name="TestWi8021xClass" c:type="RegressTestWi8021xClass" glib:is-gtype-struct-for="TestWi8021x"> - <source-position filename="regress.h" line="1296"/> + <source-position filename="regress.h" line="1312"/> <field name="parent_class"> <type name="GObject.ObjectClass" c:type="GObjectClass"/> </field> @@ -5810,12 +5857,12 @@ <constant name="UTF8_CONSTANT" value="const ♥ utf8" c:type="REGRESS_UTF8_CONSTANT"> - <source-position filename="regress.h" line="1491"/> + <source-position filename="regress.h" line="1507"/> <type name="utf8" c:type="gchar*"/> </constant> <function name="aliased_caller_alloc" c:identifier="regress_aliased_caller_alloc"> - <source-position filename="regress.h" line="1453"/> + <source-position filename="regress.h" line="1469"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -6472,7 +6519,7 @@ </parameters> </function> <function name="func_obj_null_in" c:identifier="regress_func_obj_null_in"> - <source-position filename="regress.h" line="963"/> + <source-position filename="regress.h" line="979"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -6490,7 +6537,7 @@ </function> <function name="func_obj_nullable_in" c:identifier="regress_func_obj_nullable_in"> - <source-position filename="regress.h" line="968"/> + <source-position filename="regress.h" line="984"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -6507,7 +6554,7 @@ </parameters> </function> <function name="get_variant" c:identifier="regress_get_variant"> - <source-position filename="regress.h" line="1566"/> + <source-position filename="regress.h" line="1582"/> <return-value transfer-ownership="none"> <doc xml:space="preserve" filename="regress.c" @@ -6539,7 +6586,7 @@ filename="regress.c" line="4701">This test case mirrors GnomeKeyringPasswordSchema from libgnome-keyring.</doc> - <source-position filename="regress.h" line="1506"/> + <source-position filename="regress.h" line="1522"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -6562,7 +6609,7 @@ </function> <function name="introspectable_via_alias" c:identifier="regress_introspectable_via_alias"> - <source-position filename="regress.h" line="1431"/> + <source-position filename="regress.h" line="1447"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -6575,7 +6622,7 @@ <function name="not_introspectable_via_alias" c:identifier="regress_not_introspectable_via_alias" introspectable="0"> - <source-position filename="regress.h" line="1442"/> + <source-position filename="regress.h" line="1458"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -6588,7 +6635,7 @@ <function name="random_function_with_skipped_structure" c:identifier="regress_random_function_with_skipped_structure" introspectable="0"> - <source-position filename="regress.h" line="1402"/> + <source-position filename="regress.h" line="1418"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -6631,7 +6678,7 @@ </function> <function name="test_array_callback" c:identifier="regress_test_array_callback"> - <source-position filename="regress.h" line="1197"/> + <source-position filename="regress.h" line="1213"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -6643,7 +6690,7 @@ </function> <function name="test_array_fixed_out_objects" c:identifier="regress_test_array_fixed_out_objects"> - <source-position filename="regress.h" line="874"/> + <source-position filename="regress.h" line="890"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -6818,7 +6865,7 @@ </function> <function name="test_array_inout_callback" c:identifier="regress_test_array_inout_callback"> - <source-position filename="regress.h" line="1200"/> + <source-position filename="regress.h" line="1216"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -7006,7 +7053,7 @@ </function> <function name="test_array_static_in_int" c:identifier="regress_test_array_static_in_int"> - <source-position filename="regress.h" line="882"/> + <source-position filename="regress.h" line="898"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7030,7 +7077,7 @@ Similar to: - gsf_property_settings_free() with structs but they contain pointers - g_byte_array_new_take() with guint8s</doc> - <source-position filename="regress.h" line="1588"/> + <source-position filename="regress.h" line="1604"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7058,7 +7105,7 @@ line="4853">Test flat array input with transfer none. Similar to g_main_context_check() or gtk_target_list_new().</doc> - <source-position filename="regress.h" line="1591"/> + <source-position filename="regress.h" line="1607"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7084,7 +7131,7 @@ <doc xml:space="preserve" filename="regress.c" line="1762">This is similar to gdk_keymap_get_entries_for_keyval().</doc> - <source-position filename="regress.h" line="554"/> + <source-position filename="regress.h" line="556"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7112,7 +7159,7 @@ line="4812">Test flat caller-allocated array output. Similar to g_main_context_query().</doc> - <source-position filename="regress.h" line="1585"/> + <source-position filename="regress.h" line="1601"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7146,7 +7193,7 @@ line="4774">Test flat array output with transfer container. Similar to pango_layout_get_log_attrs().</doc> - <source-position filename="regress.h" line="1579"/> + <source-position filename="regress.h" line="1595"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7178,7 +7225,7 @@ <doc xml:space="preserve" filename="regress.c" line="4796">Test flat fixed-size array output with transfer full.</doc> - <source-position filename="regress.h" line="1582"/> + <source-position filename="regress.h" line="1598"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7208,7 +7255,7 @@ - mm_modem_peek_ports() with structs - gdk_query_visual_types() with enums - gdk_event_get_axes() with doubles</doc> - <source-position filename="regress.h" line="1576"/> + <source-position filename="regress.h" line="1592"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7237,7 +7284,7 @@ </function> <function name="test_async_ready_callback" c:identifier="regress_test_async_ready_callback"> - <source-position filename="regress.h" line="1230"/> + <source-position filename="regress.h" line="1246"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7288,7 +7335,7 @@ </function> <function name="test_boxeds_not_a_method" c:identifier="regress_test_boxeds_not_a_method"> - <source-position filename="regress.h" line="701"/> + <source-position filename="regress.h" line="712"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7300,7 +7347,7 @@ </function> <function name="test_boxeds_not_a_static" c:identifier="regress_test_boxeds_not_a_static"> - <source-position filename="regress.h" line="704"/> + <source-position filename="regress.h" line="715"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7366,7 +7413,7 @@ </return-value> </function> <function name="test_callback" c:identifier="regress_test_callback"> - <source-position filename="regress.h" line="1191"/> + <source-position filename="regress.h" line="1207"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -7382,7 +7429,7 @@ </function> <function name="test_callback_async" c:identifier="regress_test_callback_async"> - <source-position filename="regress.h" line="1223"/> + <source-position filename="regress.h" line="1239"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7408,7 +7455,7 @@ filename="regress.c" line="4055">Notified - callback persists until a DestroyNotify delegate is invoked.</doc> - <source-position filename="regress.h" line="1210"/> + <source-position filename="regress.h" line="1226"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -7438,7 +7485,7 @@ filename="regress.c" line="4082">Adds a scope notified callback with no user data. This can invoke an error condition in bindings which needs to be tested.</doc> - <source-position filename="regress.h" line="1215"/> + <source-position filename="regress.h" line="1231"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -7457,7 +7504,7 @@ </function> <function name="test_callback_return_full" c:identifier="regress_test_callback_return_full"> - <source-position filename="regress.h" line="1207"/> + <source-position filename="regress.h" line="1223"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -7470,7 +7517,7 @@ </function> <function name="test_callback_thaw_async" c:identifier="regress_test_callback_thaw_async"> - <source-position filename="regress.h" line="1226"/> + <source-position filename="regress.h" line="1242"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -7482,7 +7529,7 @@ line="4096">Invokes all callbacks installed by #test_callback_destroy_notify(), adding up their return values, and removes them, invoking the corresponding destroy notfications.</doc> - <source-position filename="regress.h" line="1219"/> + <source-position filename="regress.h" line="1235"/> <return-value transfer-ownership="none"> <doc xml:space="preserve" filename="regress.c" @@ -7496,7 +7543,7 @@ filename="regress.c" line="4024">Call - callback parameter persists for the duration of the method call and can be released on return.</doc> - <source-position filename="regress.h" line="1203"/> + <source-position filename="regress.h" line="1219"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -7568,7 +7615,7 @@ </function> <function name="test_create_fundamental_hidden_class_instance" c:identifier="regress_test_create_fundamental_hidden_class_instance"> - <source-position filename="regress.h" line="1123"/> + <source-position filename="regress.h" line="1139"/> <return-value transfer-ownership="full"> <type name="TestFundamentalObject" c:type="RegressTestFundamentalObject*"/> @@ -7576,7 +7623,7 @@ </function> <function name="test_date_in_gvalue" c:identifier="regress_test_date_in_gvalue"> - <source-position filename="regress.h" line="1369"/> + <source-position filename="regress.h" line="1385"/> <return-value transfer-ownership="full"> <type name="GObject.Value" c:type="GValue*"/> </return-value> @@ -7661,7 +7708,7 @@ </function> <function name="test_gerror_callback" c:identifier="regress_test_gerror_callback"> - <source-position filename="regress.h" line="1248"/> + <source-position filename="regress.h" line="1264"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8124,7 +8171,7 @@ </function> <function name="test_hash_table_callback" c:identifier="regress_test_hash_table_callback"> - <source-position filename="regress.h" line="1245"/> + <source-position filename="regress.h" line="1261"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8242,7 +8289,7 @@ </function> <function name="test_multi_callback" c:identifier="regress_test_multi_callback"> - <source-position filename="regress.h" line="1194"/> + <source-position filename="regress.h" line="1210"/> <return-value transfer-ownership="none"> <type name="gint" c:type="int"/> </return-value> @@ -8291,7 +8338,7 @@ The sky is blue. You will give me your credit card number.</doc> - <source-position filename="regress.h" line="1383"/> + <source-position filename="regress.h" line="1399"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8328,7 +8375,7 @@ </informaltable> What we're testing here is that the scanner ignores the @a nested inside XML.</doc> - <source-position filename="regress.h" line="1386"/> + <source-position filename="regress.h" line="1402"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8343,7 +8390,7 @@ </function> <function name="test_noptr_callback" c:identifier="regress_test_noptr_callback"> - <source-position filename="regress.h" line="1188"/> + <source-position filename="regress.h" line="1204"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8359,7 +8406,7 @@ </function> <function name="test_null_gerror_callback" c:identifier="regress_test_null_gerror_callback"> - <source-position filename="regress.h" line="1251"/> + <source-position filename="regress.h" line="1267"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8371,14 +8418,14 @@ </function> <function name="test_null_strv_in_gvalue" c:identifier="regress_test_null_strv_in_gvalue"> - <source-position filename="regress.h" line="1375"/> + <source-position filename="regress.h" line="1391"/> <return-value transfer-ownership="full"> <type name="GObject.Value" c:type="GValue*"/> </return-value> </function> <function name="test_owned_gerror_callback" c:identifier="regress_test_owned_gerror_callback"> - <source-position filename="regress.h" line="1254"/> + <source-position filename="regress.h" line="1270"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8417,14 +8464,14 @@ <function name="test_simple_boxed_a_const_return" c:identifier="regress_test_simple_boxed_a_const_return" moved-to="TestSimpleBoxedA.const_return"> - <source-position filename="regress.h" line="646"/> + <source-position filename="regress.h" line="657"/> <return-value transfer-ownership="none"> <type name="TestSimpleBoxedA" c:type="const RegressTestSimpleBoxedA*"/> </return-value> </function> <function name="test_simple_callback" c:identifier="regress_test_simple_callback"> - <source-position filename="regress.h" line="1185"/> + <source-position filename="regress.h" line="1201"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8456,7 +8503,7 @@ filename="regress.c" line="4277">Should not emit a warning: https://bugzilla.gnome.org/show_bug.cgi?id=685399</doc> - <source-position filename="regress.h" line="1258"/> + <source-position filename="regress.h" line="1274"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8483,7 +8530,7 @@ <function name="test_struct_a_parse" c:identifier="regress_test_struct_a_parse" moved-to="TestStructA.parse"> - <source-position filename="regress.h" line="551"/> + <source-position filename="regress.h" line="553"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8520,7 +8567,7 @@ </function> <function name="test_strv_in_gvalue" c:identifier="regress_test_strv_in_gvalue"> - <source-position filename="regress.h" line="1372"/> + <source-position filename="regress.h" line="1388"/> <return-value transfer-ownership="full"> <type name="GObject.Value" c:type="GValue*"/> </return-value> @@ -8579,7 +8626,7 @@ </function> <function name="test_torture_signature_0" c:identifier="regress_test_torture_signature_0"> - <source-position filename="regress.h" line="1340"/> + <source-position filename="regress.h" line="1356"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8619,7 +8666,7 @@ <doc xml:space="preserve" filename="regress.c" line="4497">This function throws an error if m is odd.</doc> - <source-position filename="regress.h" line="1348"/> + <source-position filename="regress.h" line="1364"/> <return-value transfer-ownership="none"> <type name="gboolean" c:type="gboolean"/> </return-value> @@ -8655,7 +8702,7 @@ </function> <function name="test_torture_signature_2" c:identifier="regress_test_torture_signature_2"> - <source-position filename="regress.h" line="1357"/> + <source-position filename="regress.h" line="1373"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> @@ -8956,7 +9003,7 @@ <function name="test_value_get_fundamental_object" c:identifier="regress_test_value_get_fundamental_object" introspectable="0"> - <source-position filename="regress.h" line="1063"/> + <source-position filename="regress.h" line="1079"/> <return-value> <type name="TestFundamentalObject" c:type="RegressTestFundamentalObject*"/> @@ -8988,7 +9035,7 @@ <function name="test_value_set_fundamental_object" c:identifier="regress_test_value_set_fundamental_object" introspectable="0"> - <source-position filename="regress.h" line="1060"/> + <source-position filename="regress.h" line="1076"/> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value>
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/Symbolfilter-1.0-expected.gir -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Symbolfilter-1.0-expected.gir
Changed
@@ -11,7 +11,7 @@ shared-library="" c:identifier-prefixes="Symbolfilter" c:symbol-prefixes="symbolfilter"> - <record name="Object" c:type="SymbolfilterObject" disguised="1"> + <record name="Object" c:type="SymbolfilterObject" disguised="1" opaque="1"> <source-position filename="symbolfilter.h" line="4"/> <method name="filterObjectFooMethod" c:identifier="SymbolfilterObjectFooMethod">
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/Typedefs-1.0-expected.gir -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/Typedefs-1.0-expected.gir
Changed
@@ -26,6 +26,7 @@ </record> <record name="BoxedWithHiddenStruct" c:type="TypedefsBoxedWithHiddenStruct" + opaque="1" glib:type-name="TypedefsBoxedWithHiddenStruct" glib:get-type="typedefs_boxed_with_hidden_struct_get_type" c:symbol-prefix="boxed_with_hidden_struct">
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/foo.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/foo.c
Changed
@@ -343,7 +343,7 @@ * Return value: (type RegressFooSubobject) (transfer none): The global #RegressFooSubobject */ RegressFooObject * -regress_foo_object_get_default () +regress_foo_object_get_default (void) { return NULL; }
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/regress.c -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/regress.c
Changed
@@ -2643,7 +2643,7 @@ pspec); /** - * RegressTestObj:list: (type GLib.List(utf8)) (transfer none) + * RegressTestObj:list: (type GLib.List(utf8)) (transfer none) (default-value NULL) */ pspec = g_param_spec_pointer ("list", "GList property", @@ -2745,7 +2745,7 @@ /** - * TestObj:gtype: + * RegressTestObj:gtype: (default-value G_TYPE_INVALID) */ pspec = g_param_spec_gtype ("gtype", "GType property", @@ -2757,7 +2757,7 @@ pspec); /** - * TestObj:name-conflict: + * RegressTestObj:name-conflict: */ pspec = g_param_spec_int ("name-conflict", "name-conflict property", @@ -2771,7 +2771,7 @@ pspec); /** - * TestObj:byte-array: + * RegressTestObj:byte-array: */ pspec = g_param_spec_boxed ("byte-array", "GByteArray property", @@ -2783,7 +2783,7 @@ pspec); /** - * TestObj:write-only: + * RegressTestObj:write-only: */ pspec = g_param_spec_boolean ("write-only", "Write-only property", "A write-only bool property that resets the value of TestObj:int to 0 when true",
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/regress.h -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/regress.h
Changed
@@ -524,6 +524,8 @@ #define REGRESS_BOOL_CONSTANT TRUE #define REGRESS_G_GINT64_CONSTANT (G_GINT64_CONSTANT (1000)) #define REGRESS_GUINT64_CONSTANT ((guint64) -1) +#define REGRESS_GOOD_EXPR_CONSTANT (1 + 2 * (3 + 2) << 3 - 4 >> REGRESS_ATEST_ERROR_CODE2) +#define REGRESS_BAD_EXPR_CONSTANT (1 + SOMETHING_UNDEFINED) typedef guint64 RegressTestTypeGUInt64; #define REGRESS_GUINT64_CONSTANTA ((RegressTestTypeGUInt64) -1) @@ -623,6 +625,15 @@ typedef struct _RegressTestSimpleBoxedA RegressTestSimpleBoxedA; typedef struct _RegressTestSimpleBoxedB RegressTestSimpleBoxedB; +/** + * RegressTestSimpleBoxedA: (copy-func regress_test_simple_boxed_a_copy) + * @some_int: + * @some_int8: + * @some_double: + * @some_enum: + * + * ... + */ struct _RegressTestSimpleBoxedA { gint some_int; @@ -735,6 +746,11 @@ _GI_TEST_EXTERN RegressTestBoxedC *regress_test_boxed_c_new (void); +/** + * RegressTestBoxedD: (copy-func regress_test_boxed_d_copy) + * (free-func regress_test_boxed_d_free) + * + */ typedef struct _RegressTestBoxedD RegressTestBoxedD;
View file
_service:tar_scm:gobject-introspection-1.74.0.tar.xz/tests/scanner/test_transformer.py -> _service:tar_scm:gobject-introspection-1.76.1.tar.xz/tests/scanner/test_transformer.py
Changed
@@ -95,8 +95,10 @@ """) self.assertEqual(len(self.namespace.names), 1) node = self.namespace.get('Struct') - self.assertTrue(node is not None) - self.assertTrue(isinstance(node, ast.Record)) + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) + self.assertFalse(node.opaque) + self.assertFalse(node.pointer) self.assertFalse(node.disguised) self.assertEqual(len(node.fields), 1) @@ -109,8 +111,10 @@ """) self.assertEqual(len(self.namespace.names), 1) node = self.namespace.get('Struct') - self.assertTrue(node is not None) - self.assertTrue(isinstance(node, ast.Record)) + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) + self.assertFalse(node.opaque) + self.assertFalse(node.pointer) self.assertFalse(node.disguised) self.assertEqual(len(node.fields), 1) @@ -123,8 +127,10 @@ """) self.assertEqual(len(self.namespace.names), 1) node = self.namespace.get('Struct') - self.assertTrue(node is not None) - self.assertTrue(isinstance(node, ast.Record)) + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) + self.assertFalse(node.opaque) + self.assertFalse(node.pointer) self.assertFalse(node.disguised) self.assertEqual(len(node.fields), 1) @@ -136,8 +142,10 @@ """) self.assertEqual(len(self.namespace.names), 1) node = self.namespace.get('Struct') - self.assertTrue(node is not None) - self.assertTrue(isinstance(node, ast.Record)) + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) + self.assertFalse(node.opaque) + self.assertFalse(node.pointer) self.assertFalse(node.disguised) self.assertEqual(len(node.fields), 1) @@ -149,8 +157,10 @@ """) self.assertEqual(len(self.namespace.names), 1) node = self.namespace.get('Struct') - self.assertTrue(node is not None) - self.assertTrue(isinstance(node, ast.Record)) + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) + self.assertFalse(node.opaque) + self.assertFalse(node.pointer) self.assertFalse(node.disguised) self.assertEqual(len(node.fields), 1) @@ -165,18 +175,20 @@ self.assertEqual(len(self.namespace.names), 3) node = self.namespace.get('Struct') - self.assertTrue(node is not None) - self.assertTrue(isinstance(node, ast.Record)) + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) + self.assertFalse(node.opaque) + self.assertFalse(node.pointer) self.assertFalse(node.disguised) self.assertEqual(len(node.fields), 1) alias = self.namespace.get('StructAlias1') - self.assertTrue(isinstance(alias, ast.Alias)) + self.assertIsInstance(alias, ast.Alias) self.assertEqual(alias.target, node) self.assertEqual(alias.ctype, 'TestStructAlias1') alias = self.namespace.get('StructAlias2') - self.assertTrue(isinstance(alias, ast.Alias)) + self.assertIsInstance(alias, ast.Alias) self.assertEqual(alias.target, node) self.assertEqual(alias.ctype, 'TestStructAlias2') @@ -192,15 +204,19 @@ self.assertEqual(len(self.namespace.names), 2) node = self.namespace.get('Struct') - self.assertTrue(node is not None) - self.assertTrue(isinstance(node, ast.Record)) + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) + self.assertFalse(node.opaque) + self.assertFalse(node.pointer) self.assertFalse(node.disguised) self.assertEqual(len(node.fields), 1) self.assertEqual(node.ctype, 'TestStruct') shared = self.namespace.get('StructAlias') - self.assertTrue(shared is not None) - self.assertTrue(isinstance(shared, ast.Record)) + self.assertIsNotNone(shared) + self.assertIsInstance(shared, ast.Record) + self.assertFalse(shared.opaque) + self.assertFalse(shared.pointer) self.assertFalse(shared.disguised) self.assertEqual(len(shared.fields), 1) self.assertEqual(shared.ctype, 'TestStructAlias') @@ -216,15 +232,19 @@ self.assertEqual(len(self.namespace.names), 2) node = self.namespace.get('Struct') - self.assertTrue(node is not None) - self.assertTrue(isinstance(node, ast.Record)) + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) + self.assertFalse(node.opaque) + self.assertFalse(node.pointer) self.assertFalse(node.disguised) self.assertEqual(len(node.fields), 1) self.assertEqual(node.ctype, 'TestStruct') shared = self.namespace.get('StructAlias') - self.assertTrue(shared is not None) - self.assertTrue(isinstance(shared, ast.Record)) + self.assertIsNotNone(shared) + self.assertIsInstance(shared, ast.Record) + self.assertFalse(shared.opaque) + self.assertFalse(shared.pointer) self.assertFalse(shared.disguised) self.assertEqual(len(shared.fields), 1) self.assertEqual(shared.ctype, 'TestStructAlias') @@ -239,14 +259,14 @@ self.assertEqual(len(self.namespace.names), 2) node = self.namespace.get('Struct') - self.assertTrue(node is not None) - self.assertTrue(isinstance(node, ast.Record)) + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) self.assertEqual(len(node.fields), 1) self.assertEqual(node.ctype, 'TestStruct') ptr = self.namespace.get('StructPtr') - self.assertTrue(ptr is not None) - self.assertTrue(isinstance(ptr, ast.Alias)) + self.assertIsNotNone(ptr) + self.assertIsInstance(ptr, ast.Alias) self.assertEqual(ptr.ctype, 'TestStructPtr') def test_struct_tag_pointer(self): @@ -260,20 +280,39 @@ self.assertEqual(len(self.namespace.names), 2) node = self.namespace.get('Struct') - self.assertTrue(node is not None) - self.assertTrue(isinstance(node, ast.Record)) + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) + self.assertFalse(node.opaque) + self.assertFalse(node.pointer) self.assertFalse(node.disguised) self.assertEqual(node.ctype, 'TestStruct') self.assertEqual(len(node.fields), 1) ptr = self.namespace.get('StructPtr') - self.assertTrue(ptr is not None) + self.assertIsNotNone(ptr) # This currently gives a disguised Record instead of an Alias - self.assertTrue(isinstance(ptr, ast.Record)) + self.assertIsInstance(ptr, ast.Record) + self.assertFalse(ptr.opaque) + self.assertTrue(ptr.pointer) self.assertTrue(ptr.disguised) self.assertEqual(len(ptr.fields), 0) self.assertEqual(ptr.ctype, 'TestStructPtr') + def test_opaque_struct(self): + load_namespace_from_source_string(self.namespace, """ + typedef struct _TestStruct TestStruct; + """) + self.assertEqual(len(self.namespace.names), 1) + + node = self.namespace.get('Struct') + self.assertIsNotNone(node) + self.assertIsInstance(node, ast.Record) + self.assertTrue(node.opaque) + self.assertFalse(node.pointer) + self.assertTrue(node.disguised) + self.assertEqual(node.ctype, 'TestStruct') + self.assertFalse(node.fields) + class TestNestedStructs(unittest.TestCase): def setUp(self): @@ -297,11 +336,11 @@ self.assertEqual(len(node.fields), 1) simple = self.namespace.get('SimpleStruct') - self.assertTrue(node is not None) + self.assertIsNotNone(node) field = node.fields0 - self.assertTrue(field is not None) - self.assertTrue(isinstance(field, ast.Field)) + self.assertIsNotNone(field) + self.assertIsInstance(field, ast.Field) self.assertEqual(field.type, simple) self.assertEqual(field.name, 'nested_struct') @@ -318,17 +357,18 @@ self.assertEqual(len(node.fields), 1) field = node.fields0 - self.assertTrue(field is not None) - self.assertTrue(isinstance(field, ast.Field)) - self.assertEqual(field.name, None) + self.assertIsNotNone(field) + self.assertIsInstance(field, ast.Field) + self.assertIsNone(field.name) anon = field.anonymous_node - self.assertTrue(isinstance(anon, ast.Record)) + self.assertIsNotNone(anon) + self.assertIsInstance(anon, ast.Record) self.assertEqual(len(anon.fields), 1) anon_field = anon.fields0 - self.assertTrue(anon_field is not None) - self.assertTrue(isinstance(anon_field, ast.Field)) + self.assertIsNotNone(anon_field) + self.assertIsInstance(anon_field, ast.Field) self.assertEqual(anon_field.name, 'value') def test_nested(self): @@ -344,18 +384,19 @@ self.assertEqual(len(node.fields), 1) field = node.fields0 - self.assertTrue(field is not None) - self.assertTrue(isinstance(field, ast.Field)) + self.assertIsNotNone(field) + self.assertIsInstance(field, ast.Field) self.assertEqual(field.name, 'nested') nested = field.anonymous_node - self.assertTrue(isinstance(nested, ast.Record)) + self.assertIsNotNone(nested) + self.assertIsInstance(nested, ast.Record) self.assertEqual(len(nested.fields), 1) self.assertEqual(nested.name, 'nested') nested_field = nested.fields0 - self.assertTrue(nested_field is not None) - self.assertTrue(isinstance(nested_field, ast.Field)) + self.assertIsNotNone(nested_field) + self.assertIsInstance(nested_field, ast.Field) self.assertEqual(nested_field.name, 'value') def test_struct_ptr(self): @@ -373,11 +414,11 @@ self.assertEqual(len(node.fields), 1) simple = self.namespace.get('SimpleStruct') - self.assertTrue(simple is not None) + self.assertIsNotNone(simple) field = node.fields0 - self.assertTrue(field is not None) - self.assertTrue(isinstance(field, ast.Field)) + self.assertIsNotNone(field) + self.assertIsInstance(field, ast.Field) self.assertEqual(field.type.ctype, 'TestSimpleStruct*') self.assertEqual(field.name, 'struct_ptr') @@ -405,7 +446,7 @@ self.assertEqual(len(node.fields), 2) simple = self.namespace.get('SimpleStruct') - self.assertTrue(node is not None) + self.assertIsNotNone(node) field = node.fields0 self.assertEqual(field.type, simple) @@ -432,7 +473,7 @@ self.assertEqual(field.name, 'nested') nested = field.anonymous_node - self.assertTrue(isinstance(nested, ast.Union)) + self.assertIsInstance(nested, ast.Union) self.assertEqual(nested.name, 'nested') self.assertEqual(len(nested.fields), 2) @@ -453,11 +494,11 @@ self.assertEqual(len(node.fields), 1) field = node.fields0 - self.assertEqual(field.name, None) + self.assertIsNone(field.name) nested = field.anonymous_node - self.assertTrue(isinstance(nested, ast.Union)) - self.assertEqual(nested.name, None) + self.assertIsInstance(nested, ast.Union) + self.assertIsNone(nested.name) self.assertEqual(len(nested.fields), 2) self.assertEqual(nested.fields0.name, 'ival') @@ -480,7 +521,7 @@ """) self.assertEqual(len(self.namespace.names), 1) node = self.namespace.get('Callback') - self.assertTrue(isinstance(node, ast.Callback)) + self.assertIsInstance(node, ast.Callback) class TestArrays(unittest.TestCase):
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2