Projects
Mega:23.09
gobject-introspection
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
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
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`. * | */
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;
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) + {
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">
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):
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