summaryrefslogtreecommitdiff
path: root/docs/reference
Commit message (Collapse)AuthorAgeFilesLines
* docs: Update various broken/redirected linksPhilip Withnall2023-05-022-2/+2
| | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Merge branch '2289-setuid-docs' into 'main'Patrick Griffis2023-04-291-3/+12
|\ | | | | | | | | | | | | docs: Document that GIO should not be used in privileged processes Closes #2289 See merge request GNOME/glib!3413
| * docs: Document that GIO should not be used in privileged processesPhilip Withnall2023-04-281-3/+12
| | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2289
* | docs: Add high-level documentation about malloc failurePhilip Withnall2023-04-281-0/+11
| | | | | | | | | | | | While I’m here. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | docs: Mention that calls after fork() must be async-signal-safePhilip Withnall2023-04-281-1/+8
|/ | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2958
* Merge branch 'html-doc-flag' into 'main'Philip Withnall2023-04-281-28/+30
|\ | | | | | | | | meson: wrap html documentation generation with gtk_doc option See merge request GNOME/glib!3399
| * meson: wrap html documentation generation with gtk_doc optionJames Knight2023-04-271-28/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | By default, if a host environment has the `rst2html5` application available, builds will automatically perform some HTML documentation generation from the documentation's glib reference content (e.g. creating `gvariant-specification-1.0.html`). The creation of this documentation is not required for all use cases. This commit tweaks the building of the HTML-based GLIB specification document to be guarded by `gtk_doc`. Signed-off-by: James Knight <james.d.knight@live.com>
* | Merge branch 'resolver-thread-pool' into 'main'Philip Withnall2023-04-271-0/+2
|\ \ | |/ |/| | | | | gthreadedresolver: Switch to using a separate thread pool and support timeouts See merge request GNOME/glib!3397
| * gresolver: Add GResolver:timeout propertyPhilip Withnall2023-04-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Without a timeout, some lookup requests can go on forever, typically due to bugs in underlying systems. This can have particularly significant effects on the Happy Eyeballs algorithm in `GSocketClient`, which relies on multiple name lookups as its first step. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2866
* | Add init macros for refcounting typesEmmanuele Bassi2023-04-241-0/+2
|/ | | | | | We need a way to initialise refcounted types placed in static storage, or on the stack. Using proper macros avoids knowing the magic constant used for grefcount and gatomicrefcount.
* Merge branch 'registry-settings-root-key' into 'main'Philip Withnall2023-04-141-0/+10
|\ | | | | | | | | gregistrysettingsbackend: Allow a different root key path See merge request GNOME/glib!3306
| * gregistrysettingsbackend: Allow a different root key pathDario Saccavino2023-04-141-0/+10
| |
* | doc: Workaround missing API indexXavier Claessens2023-04-143-214/+214
|/
* docs: Add 2.78 release series documentation pages to the buildPhilip Withnall2023-04-143-0/+12
| | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* gtype: Improve documentation for G_TYPE_IS_CLASSED and interfacesPhilip Withnall2023-04-133-10/+10
| | | | | | | | | | | | | | | | | | The documentation previously implicitly said in a few places that interfaces are classed, but reading through the implementation of `GType`, I don’t think they are. If they were, the registration of the fundamental `G_TYPE_INTERFACE` in `gobject_init()` would specify `G_TYPE_FLAG_CLASSED`. It only specifies `G_TYPE_FLAG_DERIVABLE`. I think this makes sense, because you can’t subclass an interface. Subclassing is a key property of being classed. Tweak the `GType` tutorial to remove that implicit statement, and expand the documentation for `G_TYPE_IS_CLASSED`. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #252
* Link goption documentation to GOptionContext typeSam Thursfield2023-03-232-2/+2
| | | | | | | This makes the goption overview visible in the gi-docgen docs as part of the GOptionContext type. Previously it was not visible anywhere. Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2953
* Add g_unix_open_pipe_internal () for pipes with the close-on-exec flagMaciej S. Szmigiero2023-02-211-0/+1
| | | | | Based on the existing g_unix_open_pipe () but for internal use where returning a raw errno is needed, not a GError.
* docs: Add GPathBuf to the API referenceEmmanuele Bassi2023-02-092-0/+22
|
* gmem: Add g_free_sized() and g_aligned_free_sized()Philip Withnall2023-02-021-0/+2
| | | | | | | | | | | | | | | | | These wrap `free_sized()` and `free_aligned_sized()`, which are present in C23[1]. This means that user code can start to use them without checking for C23 support everywhere first. It also means we can use them internally in GSlice to get a bit of performance for the code which still uses it. See https://en.cppreference.com/w/c/memory/free_aligned_sized and https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2699.htm. [1]: Specifically, section 7.24.3.4 of the latest C23 draft at https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3088.pdf. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* gslice: Remove slice allocator and use malloc() insteadNatanael Copa2023-01-251-47/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keep the API for ABI compatibility. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2935#note_1650099 for a summary of the reasoning for this change: - The performance of system-provided allocators has improved since GSlice was written, and they are now similarly as performant, or more performant, than GSlice. - The code is unmaintained and nobody understands it. - It doesn’t integrate with tooling and system security features which have been written for the system `malloc()` implementation (such as sanitisers, valgrind, etc.). - It’s confusing for developers: should they use `g_slice_new()` or `g_new()`? - GSlice is faster than the libc allocator for allocating and (particularly) freeing linked lists, but since these are a rubbish data structure, that’s not a great thing to optimise for. For the cases where application performance is negatively impacted by the implementation of GSlice being dropped (and we don’t think there’ll be many), applications can use a drop-in `malloc()` replacement which is more suited to their particular workload. Choosing an allocator in GLib to suit all application workloads is not possible. Including documentation updates and cleanups by Philip Withnall. Fixes: #1079
* Add g_string_free_and_stealMatthias Clasen2023-01-191-0/+1
|
* Merge branch 'ptr-array-sort-values' into 'main'Philip Withnall2023-01-061-0/+2
|\ | | | | | | | | garray: Add g_ptr_array_sort_values[_with_data]() wrappers See merge request GNOME/glib!3155
| * garray: Add g_ptr_array_sort_values[_with_data]() wrappersMarco Trevisan (Treviño)2023-01-061-0/+2
| | | | | | | | | | | | | | | | | | | | Historically GPtrArray made possible to compare pointers of pointers values that it holds, however this is inconvenient in most cases as it requires wrapper functions and not friendly castings. So, add two functions that allow to perform the comparisons between the pointer values that a GPtrArray holds following the same syntax that we share everywhere in the codebase.
* | Merge branch 'ptr-array-new-take' into 'main'Philip Withnall2022-12-211-0/+6
|\ \ | |/ |/| | | | | garray: Add more G(Ptr)Array constructors to take or copy C arrays See merge request GNOME/glib!3128
| * garray: Add g_array_new_take() and g_array_new_take_zero_terminated()Marco Trevisan (Treviño)2022-12-211-0/+2
| | | | | | | | | | Make it easy to handle C arrays using GArray API stealing data from other sources.
| * garray: Add g_ptr_array_new_from_null_terminated_array()Marco Trevisan (Treviño)2022-12-191-0/+1
| | | | | | | | | | | | It allows to create a GPtrArray from a null-terminated C array computing its size and in case performing copies of the its values using the provided GCopyFunc.
| * garray: Add g_ptr_array_new_from_array() to copy a C arrayMarco Trevisan (Treviño)2022-12-191-0/+1
| | | | | | | | | | It makes it easier (and more optimized) to create a GPtrArray from a C-style array of pointers, in case using a GCopyFunc to duplicate the elements.
| * garray: Add g_ptr_array_new_take_null_terminated()Marco Trevisan (Treviño)2022-12-191-0/+1
| | | | | | | | | | Similar to g_ptr_array_new_take() but it also computes the length of a zero-terminated array.
| * garray: Add g_ptr_array_new_take() to take a C array without copiesMarco Trevisan (Treviño)2022-12-191-0/+1
| | | | | | | | | | | | | | | | | | GPtrArray is a nice interface to handle pointer arrays, however if a classic array needs to be converted into a GPtrArray is currently needed to manually go through all its elements and do new allocations that could be avoided. So add g_ptr_array_new_take() which steals the data from an array of pointers and allows to manage it using the GPtrArray API.
* | Merge branch 'ghash-keys+values-arrays' into 'main'Philip Withnall2022-12-161-0/+4
|\ \ | | | | | | | | | | | | ghash: Add APIs to get (and steal) hash table keys and values as GPtrArray See merge request GNOME/glib!3130
| * | ghash: Add functions to steal all keys and values preserving ownershipMarco Trevisan (Treviño)2022-12-161-0/+2
| | | | | | | | | | | | | | | | | | Add functions to steal all the keys or values from a ghash (especially useful when it's used as a set), passing the ownership of then to a GPtrArray container that preserves the destroy notify functions.
| * | ghash: Add APIs to get hash table keys and values as GPtrArrayMarco Trevisan (Treviño)2022-12-161-0/+2
| |/ | | | | | | | | | | | | | | | | GPtrArray's are faster than lists and provide more flexibility, so add APIs to get hash keys and values using these containers too. Given that we know the size at array initialization we can optimize the allocation quite a bit, making it faster than the API using GList both at creation time and for consumers.
* | gmenumodel: disallow exporting large menus on the busLars Uebernickel2022-12-141-0/+1
|/ | | | | | | | | | | | | | | This solves problems with validating untrusted inputs from D-Bus, where invalid numbers of added and removed menu entries, and positions, could be specified. Original patch from https://bugzilla.gnome.org/show_bug.cgi?id=728733#c7, tweaked by Philip Withnall to add a few code comments and make `G_MENU_EXPORTER_MAX_SECTION_SIZE` public so callers can check their inputs against it if they want. Also tweaked to use `g_warning()` instead of the nonexistent `g_dbus_warning()`. Fixes: #861
* Merge branch 'mkenums-docs' into 'main'Emmanuele Bassi2022-12-131-1/+1
|\ | | | | | | | | docs: Remove a stray > in the glib-mkenums man page See merge request GNOME/glib!3112
| * docs: Remove a stray > in the glib-mkenums man pagePhilip Withnall2022-12-071-1/+1
| | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | Merge branch 'gio-thumbnail-sizes' into 'main'Philip Withnall2022-12-081-0/+12
|\ \ | |/ |/| | | | | | | | | file-info: Add a set of attributes for large thumbnails Closes #621 See merge request GNOME/glib!2918
| * file-info: Add a set of attributes for large thumbnailsMatthias Clasen2022-12-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some applications (eg., gnome-photos) really want a large thumbnail, if one can be created. Simply falling back to a smaller one (probably created by an old nautilus), without giving the application a chance to create a bigger thumbnail, is undesirable because they will appear fuzzy. Therefore, at separate attribute sets for all the thumbnail sizes that are supported in the spec: normal/large/x-large/xx-large. The old attribute will now return by default the biggest available, as it used to be, but also including the x-large and xx-large cases. Co-Authored-by: Marco Trevisan <mail@3v1n0.net> Fixes: #621
* | Revert "build: Use fs.copyfile() instead of configure_file()"Philip Withnall2022-11-241-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 19353017a786e90e00c29890ba6ca2ef88798df4. The freedesktop SDK, which is used by gnome-build-meta, only has Meson 0.63. Bumping GLib’s Meson dependency to 0.64 means that, at the moment, GLib is not buildable in gnome-build-meta and hence can’t be tested in nightly pipelines against other projects, etc. That’s bad for testing GLib. It’s arguably bad that we’re restricted to using an older version of Meson than shipped by Debian Testing, but that’s a separate discussion to be had. Revert the Meson 0.64 dependency until the freedesktop SDK ships Meson ≥ 0.64. This also means reverting the simplifications to use of `gnome.mkenum_simple()`. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064
* | Merge branch 'wip/pwithnall/meson-0.64' into 'main'Xavier Claessens2022-11-231-5/+1
|\ \ | | | | | | | | | | | | build: Bump Meson dependency to 0.64.0 See merge request GNOME/glib!3077
| * | build: Use fs.copyfile() instead of configure_file()Philip Withnall2022-11-231-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | Because Meson complains about using `configure_file(copy: true)`. Includes improvements by Xavier Claessens. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | Merge branch 'c-cxx-std-versions' into 'main'Marco Trevisan2022-11-221-0/+6
|\ \ \ | | | | | | | | | | | | | | | | Expose C and C++ standard versions and add macros to check them See merge request GNOME/glib!2895
| * | | macros: Add a generic way to get and check the supported C standardMarco Trevisan (Treviño)2022-11-221-0/+2
| | | | | | | | | | | | | | | | | | | | Try to get the value of __STDC_VERSION__ if supported, if not just fallback to the oldest standard that any compiler should handle.
| * | | gmacros: Define G_CXX_STD_VERSION and check macrosMarco Trevisan (Treviño)2022-11-211-0/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sadly, in C++ there's not an universal way to get what language standard is used to compile GLib-based programs, in fact while most compilers relies on `__cplusplus`, MSVC is defining that, but it does not use it to expose such information (unless `/Zc:__cplusplus` arg is used). On the other side, MSVC reports the language standard via _MSVC_LANG [1]. This complication makes us defining some macros in a very complex way (such as glib_typeof()), because we need to perform many checks just to understand if a C++ compiler is used and what standard is expecting. To avoid this, define multiple macros that can be used to figure out what C++ standard is being used. [1] https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-170
* | | build: Deprecate -Druntime_libdir optionPhilip Withnall2022-11-221-17/+0
|/ / | | | | | | | | | | | | | | | | It’s been broken since we ported to Meson and nobody has complained, so let’s deprecate it this cycle and remove it in GLib ≥ 2.78. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2786
* | gobject: Add G_TYPE_FLAG_DEPRECATEDMatthias Clasen2022-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be used to mark entire types as deprecated, and trigger a warning when they are instantiated and `G_ENABLE_DIAGNOSTIC=1` is set in the environment. There's currently no convenient macros for defining types with the new flag, but you can do: ```c _G_DEFINE_TYPE_EXTENDED_BEGIN (GtkAppChooserWidget, gtk_app_chooser_widget, GTK_TYPE_WIDGET, G_TYPE_FLAG_DEPRECATED) ... _G_DEFINE_TYPE_EXTENDED_END () ``` Includes a unit test by Philip Withnall.
* | Merge branch 'variant-spec-updates' into 'main'Philip Withnall2022-11-085-62/+218
|\ \ | | | | | | | | | | | | docs: Add licensing/copyright data to GVariant specification and fix various formatting issues See merge request GNOME/glib!3048
| * | docs: Fix a broken link in the GVariant SpecificationPhilip Withnall2022-11-081-1/+1
| | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | docs: Add a manual revision history to the GVariant SpecificationPhilip Withnall2022-11-081-0/+12
| | | | | | | | | | | | | | | | | | | | | This will make it clear what the bigger changes are between versions. Kind of like a `NEWS` file for the specification. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | docs: Add links to the D-Bus specification to the GVariant SpecificationPhilip Withnall2022-11-081-2/+4
| | | | | | | | | | | | | | | | | | | | | This should clarify object paths and signatures a little, if anyone needs that. This introduces no semantic changes. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | docs: Change ‘DBus’ to ‘D-Bus’ in the GVariant SpecificationPhilip Withnall2022-11-081-32/+32
| | | | | | | | | | | | | | | | | | That’s how it’s meant to be formatted. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>