summaryrefslogtreecommitdiff
path: root/docs/reference
Commit message (Collapse)AuthorAgeFilesLines
* glib-sections.txt: Add g_macro__has_extension in private sectionclang-cl-improvementsChun-wei Fan2021-03-311-0/+1
| | | | This should satisfy the documentation build check.
* gfileinfo: Add APIs to get and set {access,creation}_date_timeAbanoub Ghadban2021-03-281-0/+4
|
* gtree: Make g_tree_remove_all() publicliuyangming2021-03-231-0/+1
| | | | | g_tree_remove_all is useful and the corresponding function in GHashTable is exposed, so make this function public is meaningful.
* gmain: Add g_steal_fd() to APISimon McVittie2021-03-221-0/+3
| | | | | | | This is basically glnx_steal_fd() from libglnx. We already had two private implementations of it in GLib. Signed-off-by: Simon McVittie <smcv@collabora.com>
* gversionmacros: Add version macros for GLib 2.70Simon McVittie2021-03-185-1/+27
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* gspawn: Add new g_spawn_async_with_pipes_and_fds() APIPhilip Withnall2021-02-161-0/+1
| | | | | | | | | This is a simple wrapper around the new source/target FD mapping functionality in `fork_exec()`. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2097
* string: Add find and replace functionJoshua Lee2021-02-091-0/+1
| | | | | | | | | This adds g_string_replace(), a function that replaces instances of one string with another in a GString. It allows the caller to specify the maximum number of replacements to perform, and returns the number of replacements performed to the caller. Fixes: #225
* gstrfuncs: Add g_memdup2() functionPhilip Withnall2021-02-041-0/+1
| | | | | | | | | | | | | | | | | | | | This will replace the existing `g_memdup()` function, which has an unavoidable security flaw of taking its `byte_size` argument as a `guint` rather than as a `gsize`. Most callers will expect it to be a `gsize`, and may pass in large values which could silently be truncated, resulting in an undersize allocation compared to what the caller expects. This could lead to a classic buffer overflow vulnerability for many callers of `g_memdup()`. `g_memdup2()`, in comparison, takes its `byte_size` as a `gsize`. Spotted by Kevin Backhouse of GHSL. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: GHSL-2021-045 Helps: #2319
* glib_typeof: It is an API break that should be opt-inXavier Claessens2021-01-271-0/+1
| | | | | | | | | | | | | | | | That changes the return type of functions like g_object_ref() that can break C++ applications like Webkit. Note that it is not an ABI break. It must thus be opt-in the same way we did when adding this to g_object_ref() for GNU C compilers in the first place. Unfortunately it cannot be done directly in gmacros.h because GLIB_VERSION_2_68 is not defined there, and gversionmacros.h cannot be included there because there is some strict ordering in which those headers must be included. This means that applications that does not define GLIB_VERSION_MIN_REQUIRED will still get an API break, so we encourage them to declare their minimum requirement to avoir such issues in the future too.
* gtestutils: Add g_test_get_path() APIJonas Ådahl2021-01-251-0/+1
| | | | | | | | I found myself wanting to know the test that is currently being run, where e.g. __func__ would be inconvenient to use, because e.g. the place the string was needed was not in the test case function. Using __func__ also relies on the test function itself containing the whole path, while loosing the "/" information that is part of the test path.
* Add g_dbus_utils_object_path_escape and g_dbus_utils_object_path_unescapeMARTINSONS Frederic2021-01-201-0/+3
| | | | | | | | | | | These two APIs are useful to publish an object which path content is not controlled (e.g. dynamically built or coming from external source). Closes #968 (Rebased and tweaked by Frederic Martinsons) Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
* docs: Add documentation for GLIB_VERSION_CUR_STABLE and PREV_STABLEPhilip Withnall2021-01-191-0/+2
| | | | | | It was missing. Oh no! Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* giomodule: Ignore GIO_MODULE_DIR when running as setuidPhilip Withnall2021-01-071-0/+6
| | | | | | | | | | | | | | | Even if the modules in the given directory never get chosen to be used, loading arbitrary code from a user-provided directory is not safe when running as setuid, as the process’ environment comes from an untrusted source. Also ignore `GIO_EXTRA_MODULES`. Spotted by Simon McVittie. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2168
* Merge branch 'extended-error' into 'master'Philip Withnall2021-01-061-0/+7
|\ | | | | | | | | Extended error See merge request GNOME/glib!1304
| * gerror: Add support for extended errorsKrzesimir Nowak2021-01-061-0/+7
| | | | | | | | | | | | This commit adds a G_DEFINE_EXTENDED_ERROR macro and g_error_domain_register() functions to register extended error domains.
* | Merge branch '1281-to-pixdata-docs' into 'master'Philip Withnall2021-01-041-0/+3
|\ \ | | | | | | | | | | | | | | | | | | gresource: Document the `to-pixdata` option as being deprecated Closes #1281 See merge request GNOME/glib!1826
| * | gresource: Document the `to-pixdata` option as being deprecatedPhilip Withnall2020-12-221-0/+3
| |/ | | | | | | | | | | | | | | | | Just embed a PNG instead. gdk-pixbuf deprecated its pixdata support in version 2.32, in 2015. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #1281
* | Merge branch 'appinfo-shellany-uwplaunch' into 'master'Philip Withnall2021-01-041-0/+7
|\ \ | |/ |/| | | | | | | | | GWin32AppInfo: support getting info about UWP apps and launching them Closes #1991 See merge request GNOME/glib!1772
| * docs: Ignore new win32 private headersPhilip Withnall2020-12-231-0/+7
| | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | docs: Mention GInitiallyUnowned when introducing refcountsPhilip Withnall2020-12-121-1/+1
| | | | | | | | | | | | | | | | For completeness. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #1568
* | Merge branch '2098-add-gio-restore-support' into 'master'Ondrej Holy2020-12-091-5/+16
|\ \ | | | | | | | | | | | | | | | | | | Add restore option for trash gio-tool subcommand Closes #2098 See merge request GNOME/glib!1778
| * | gio-tool-trash: Add --restore subcommandFrederic Martinsons2020-12-071-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It search for attribute trash::orig-path and move the input file to it. Possibly recreating the directory of orignal path and/or overwritting the destination. Closes #2098 Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
| * | gio-tool-trash: Add --list subcommandFrederic Martinsons2020-12-071-0/+4
| | | | | | | | | | | | | | | | | | | | | This will print all the files in TrashCan along with their original location. Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
* | | Merge branch '54-add-gio-launch-command' into 'master'Ondrej Holy2020-12-091-0/+19
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Add gio launch command to execute desktop file Closes #54 See merge request GNOME/glib!1779
| * | | Add gio launch command to execute desktop fileFrederic Martinsons2020-12-091-0/+19
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command will try to execute a desktop file, before that it will load the input as a keyfile for checking its existence and its validity (as a keyfile). File arguments are allowed after the desktop file. Closes #54 Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
* | | Merge branch 'binding-threadsafe-2' into 'master'Philip Withnall2020-12-041-0/+2
|\ \ \ | |/ / |/| | | | | | | | Make GBinding thread-safe (alternative approach) See merge request GNOME/glib!1745
| * | Add g_binding_dup_target() and g_binding_dup_source()Sebastian Dröge2020-11-261-0/+2
| | | | | | | | | | | | | | | These new getters prevent the source/target from simply disappearing if they're finalized from another thread in the meantime.
* | | Adding macros G_NORETURN and G_NORETURN_FUNCPTREmmanuel Fleury2020-11-251-0/+2
|/ / | | | | | | | | | | This macro is borrowed from the gnulib project in the 'noreturn.h' file. Fixes: #994
* | Merge branch '553-tz-errors' into 'master'Sebastian Dröge2020-11-221-0/+1
|\ \ | | | | | | | | | | | | | | | | | | gtimezone: Add new constructor which can report errors Closes #553 See merge request GNOME/glib!1760
| * | gtimezone: Add new constructor which can report errorsPhilip Withnall2020-11-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new variant of `g_time_zone_new()` which returns `NULL` on failure to load a timezone, rather than silently returning UTC. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #553
* | | Merge branch 'py-fixes' into 'master'Sebastian Dröge2020-11-201-3/+8
|\ \ \ | | | | | | | | | | | | | | | | Python formatting improvements See merge request GNOME/glib!1757
| * | | py: Various flake8 cleanupsPhilip Withnall2020-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | None of these are particularly significant, but they do get the CI output clean. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | py: Reformat all Python files consistentlyPhilip Withnall2020-11-171-3/+7
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is the unmodified results of running ``` black $(git ls-files '*.py') ``` with black version 19.10b0. See #2046. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | gobject: Drop use of volatile from get_type() macrosPhilip Withnall2020-11-202-5/+5
| |/ |/| | | | | | | | | | | | | | | | | | | | | http://isvolatileusefulwiththreads.in/c/ It’s possible that the variables here are only marked as volatile because they’re arguments to `g_once_*()`. Those arguments will be modified in a subsequent commit. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #600
* | docs: Clarify the meaning of --buildtype=plain a littlePhilip Withnall2020-11-181-0/+6
|/ | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #1833
* gtestutils: Add g_assert_cmpstrv()Niels De Graef2020-11-141-0/+1
| | | | | | | Add a test util function that helps asserting two string arrays are the same, and which adds some useful information if they're not. Fixes: #2015
* Merge branch 'instantiatable' into 'master'Sebastian Dröge2020-11-134-27/+27
|\ | | | | | | | | gobject: Standardise on the term ‘instantiatable’ See merge request GNOME/glib!1735
| * gobject: Standardise on the term ‘instantiatable’Philip Withnall2020-11-024-27/+27
| | | | | | | | | | | | | | Rather than using a mixture of ‘instantiable’ and ‘instantiatable’ everywhere, standardise on the term which is already in the public API. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | gdbus: Add FD support for gdbus callNorbert Pocs2020-11-061-0/+12
| | | | | | | | | | | | | | | | Gdbus call could not take file handle (parameter 'h') as a parameter. Original patch from Tim Waugh <twaugh@redhat.com>. Fixes: #961
* | gtype: Add g_type_interface_instantiatable_prerequisite()Benjamin Otte2020-11-021-0/+1
|/ | | | | | | | | | This function returns the most specific instantiatable type that is a prerequisite for a given interface. This type is necessary in particular when dealing with GValues because a GValue contains an instance of a type. This commit includes tests for the new API.
* Merge branch 'issue-2236' into 'master'Philip Withnall2020-11-023-21/+20
|\ | | | | | | | | | | | | Include generated files and documentation in the GIO reference Closes #2236 See merge request GNOME/glib!1730
| * Build gdbus-objectmanager-example docs unconditionallyissue-2236Emmanuele Bassi2020-10-301-10/+6
| | | | | | | | | | The GIO reference documentation links to that documentation, so we cannot only build it when the installed tests are enabled.
| * docs: Fix xinclude directivesEmmanuele Bassi2020-10-301-9/+10
| | | | | | | | | | | | For legacy reasons, Meson's gtk-doc helper script launches the gtkdoc-mkhtml tool in the `html` directory under the build root. This means that all paths must be relative to that location.
| * docs: Add missing annotation glossaryEmmanuele Bassi2020-10-301-2/+4
| | | | | | | | | | Without the glossary, gtk-doc will emit warnings for every introspection annotation it finds.
* | gio: Fix various typos of the name ‘D-Bus’Philip Withnall2020-10-262-3/+3
|/ | | | | | This introduces no functional changes. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Merge branch 'typeof' into 'master'Philip Withnall2020-10-151-1/+1
|\ | | | | | | | | Use C++11 decltype where possible See merge request GNOME/glib!1575
| * Replace __typeof__ with glib_typeof macroXavier Claessens2020-10-141-1/+1
| | | | | | | | | | | | | | g_has_typeof macro is wrongly in the public g_ namespace, internaly symbols are usually in the glib_ namespace. This will also allow to define glib_typeof differently on non-GNUC compilers (e.g. c++11 decltype).
* | gstrvbuilder: Add a new object to make NULL-terminated string arrays.Robert Ancell2020-10-141-0/+6
|/ | | | | | | GLib uses NULL-terminated string arrays (GStrv) in a number of places, however these are quite hard to construct in C when the number of elements is not known in advance. GStrvBuilder wraps GPtrArray to make these easy to create with type safety and does the memory management for you.
* GSubprocessLauncher: allow to close passed FDsSergio Costas2020-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, when using g_subprocess_launcher_take_fd() to pass an FD to a child, the GSubprocessLauncher object also takes ownership of the FD in the parent, and closes it during finalize(). This is a reasonable assumption in the majority of the cases, but sometimes it isn't a good idea. An example is when creating a GSubprocessLauncher in JavaScript: here, the destruction process is managed by the Garbage Collector, which means that those sockets will remain opened for some time after all the references to the object has been droped. This means that it could be not possible to detect when the child has closed that same FD, because in order to make that work, both FDs instances (the one in the parent and the one in the children) must be closed. This can be a problem in, as an example, a process that launches a child that communicates with Wayland using an specific socket (like when using the new API MetaWaylandClient). Of course, it isn't a valid solution to manually call close() in the parent process just after the call to spawn(), because the FD number could be reused in the time between it is manually closed, and when the object is destroyed and closes again that FD. If that happens, it will close an incorrect FD. One solution could be to call run_dispose() from Javascript on the GSubprocessLauncher object, to force freeing the resources. Unfortunately, the current code frees them in the finalize() method, not in dispose() (this is fixed in !1670 (merged) ) but it isn't a very elegant solution. This proposal adds a new method, g_subprocess_launcher_close(), that allows to close the FDs passed to the child. To avoid problems, after closing an FD with this method, no more spawns are allowed. Fix: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1677
* gmessages: Expose our default filtering as APISimon McVittie2020-10-071-0/+1
| | | | | | | | | This allows programs that want to change how log messages are printed, such as gnome-terminal (gnome-terminal#42) and Flatpak, to override the log-writer or the legacy log-handler without having to reimplement the G_MESSAGES_DEBUG filtering logic. Signed-off-by: Simon McVittie <smcv@collabora.com>