Commit Graph

29188 Commits

Author SHA1 Message Date
Philip Withnall
72b44dce76 docs: Move the GDBusAddress SECTION
Move it to the struct docs, although again this is a little suspect
because there is actually no `GDBusAddress` struct/type.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
2023-10-23 13:18:13 +01:00
Philip Withnall
ef5ca0952b docs: Move the GContentType SECTION
This might not work, as `GContentType` isn’t actually a defined type
(content types are just strings). It would be a bit weird to create a
separate page for content types, though, as the functions handling them
are very method-like and feel like they should be grouped together like
methods of a class.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
2023-10-23 13:18:13 +01:00
Philip Withnall
b3b744aec6 docs: Move the GAsyncHelper SECTION
Move it to the struct docs (although this documentation is private
anyway).

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
2023-10-23 13:18:13 +01:00
Philip Withnall
52248a9d69 docs: Move the GActionGroupExporter SECTION
Move it to the struct docs.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
2023-10-23 13:18:13 +01:00
Philip Withnall
5ae6bcb728 docs: Move the value collection documentation to Markdown
It needs to be in a separate page because it’s all macros and they have
no type/class associated with them.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
2023-10-23 13:18:13 +01:00
Philip Withnall
1d2507a7e5 Merge branch 'ebassi/gir' into 'main'
Generate introspection data

See merge request GNOME/glib!3636
2023-10-23 12:13:39 +00:00
Philip Withnall
a6aaa701a5 docs: Mention dependency cycle between GLib and gobject-introspection
And how to break that cycle.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
2023-10-23 11:26:53 +01:00
Philip Withnall
635100b1f5 gio: Fix invalid doc links
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
2023-10-23 11:26:53 +01:00
Philip Withnall
016aacbda8 gobject: Fix invalid doc links
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
2023-10-23 11:26:53 +01:00
Emmanuele Bassi
160e5db742 Remove old introspection data
We don't need it any more.
2023-10-23 11:26:53 +01:00
Emmanuele Bassi
3ffa33825b Build the API references with the generated GIR data
Gate the API reference on the availability of the introspection data as
well, so we don't accidentally try and generate the documentation
without a description of our API.
2023-10-23 11:26:53 +01:00
Emmanuele Bassi
fe32c3f5c5 Generate introspection data
Currently, the introspection data for GLib and its sub-libraries is
generated by gobject-introspection, to avoid the cyclic dependency
between the two projects.

Since gobject-introspection is generally available on installed systems,
we can check for its presence, and generate the introspection data
directly from GLib.

This does introduce a cyclic dependency, which is why it's possible to
build GLib without introspection, then build gobject-introspection, and
finally rebuild GLib.

By having introspection data available during the GLib build, we can do
things like generating documentation; validating newly added API; and
close the loop between adding new API and it becoming available to non-C
consumers of the C ABI (i.e. language bindings).
2023-10-23 11:26:53 +01:00
Emmanuele Bassi
6e771f0e84 docs: Add missing annotation separator 2023-10-23 10:25:31 +01:00
Emmanuele Bassi
c5a1e4f6c3 docs: Remove duplicate interface field 2023-10-23 10:25:31 +01:00
Emmanuele Bassi
d026534753 docs: Replace deprecated Virtual tag
Use the (virtual) symbol annotation.
2023-10-23 10:25:31 +01:00
Emmanuele Bassi
47faa032cb docs: Remove duplicate docblocks
The g_cclosure_marshal_* symbols are already documented in gmarshal.c.
2023-10-23 10:25:31 +01:00
Emmanuele Bassi
5e7c512609 docs: Fix various invalid links 2023-10-23 10:25:31 +01:00
Emmanuele Bassi
3013a0ef4a docs: Fix the annotation for GSubprocessLauncher 2023-10-23 10:25:31 +01:00
Emmanuele Bassi
d3d69cb8ba docs: Fix annotations for GSimpleProxyResolver
Drop "nullable" from the default-proxy property docblock, and correctly
separate the annotation from the return value's description.
2023-10-23 10:25:31 +01:00
Emmanuele Bassi
cfb11a8d63 docs: Avoid a bare "returns:"
Lines inside a docblock cannot begin with "returns:", as that is the tag
for the documentation of the return value.
2023-10-23 10:25:30 +01:00
Emmanuele Bassi
c86f469c1e Ignore autocleanups when generating introspection data 2023-10-23 10:25:30 +01:00
Emmanuele Bassi
0f8aaee2bf Add missing annotation separator 2023-10-23 10:25:30 +01:00
Emmanuele Bassi
fb84bad077 Remove unnecessary annotation
All pointer-based properties are nullable by definition, and the
`nullable` annotation is not accepted at the identifier level.
2023-10-23 10:25:30 +01:00
Emmanuele Bassi
c5eb130175 Fix broken annotation in GIOChannel
Missing separator between annotation and description.
2023-10-23 10:25:30 +01:00
Philip Withnall
9a03cdbcad Merge branch '3148-appinfo-skip-if-utils-unavailable' into 'main'
tests: Skip appinfo/associations test if update-*-database not installed

Closes #3148

See merge request GNOME/glib!3658
2023-10-22 23:35:40 +00:00
Michael Catanzaro
ceca2dc5bc Merge branch '3144-file-set-contents-truncation' into 'main'
gfileutils: Add a missing ftruncate() call when writing files

Closes #3144

See merge request GNOME/glib!3650
2023-10-22 22:41:56 +00:00
Philip Withnall
8629024243 tests: Skip appinfo/associations test if update-*-database not installed
If `update-desktop-database` or `update-mime-database` are not
installed, there are a few `GAppInfo` methods for modifying file
associations which will print a `g_warning()` when called. Something
like:
```
GLib-GIO-FATAL-WARNING: Failed to execute child process ‘update-desktop-database’ (No such file or directory)
```

(Example: https://gitlab.gnome.org/zamaudio/glib/-/jobs/3190053)

This will cause the appinfo/associations test to fail, as warnings are
fatal.

If that’s going to happen, skip the test. We can’t hard-depend on these
tools as they are external to GLib and only needed for a few operations.
Instead we have a soft runtime dependency on them; that should be
reflected in the tests.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3148
2023-10-22 23:34:00 +01:00
Michael Catanzaro
7a9f8eec35 Merge branch 'alt-digits-locale-change' into 'main'
gdatetime: Fix incorrect alt-digits being used after changing locale

See merge request GNOME/glib!3655
2023-10-22 22:32:34 +00:00
Philip Withnall
4b9ec32b26 ci: Remove some duplicate packages from an install list
This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-10-22 22:10:07 +01:00
Philip Withnall
afd8dde13f gdatetime: Fix incorrect alt-digits being used after changing locale
The alt-digits are loaded from `nl_langinfo()` in a `GOnce` section,
which means `nl_langinfo()` is not re-queried after the process changes
locale (if that happens).

So, change the `GOnce` to a mutex and store the locale of the alt-digits
alongside them. This will introduce contention when calling
`format_number()` is called, but how often are multiple threads trying
to format dates at the same time?

If this does get highlighted as a performance problem, the other
approach I considered was a `GPrivate` struct containing all the
locale-specific cached data. That comes at the cost of using a
`GPrivate` slot (although that’s only particularly expensive on Windows,
and the locale code is quite different for Windows, so perhaps that
could be avoided entirely). It does mean that all locale printing could
be lock-free and still safely update cached data on a locale change.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-10-22 22:10:07 +01:00
Philip Withnall
3f705ffa12 gfileutils: Add a missing ftruncate() call when writing files
When calling `g_file_set_contents_full()` without
`G_FILE_SET_CONTENTS_CONSISTENT`, the file is written by opening it,
`write()`ing to it, then closing it.

This is fine as long as the file is not longer than the new content you
want to set its contents to. If it is, the last bit of the old content
remains, because `g_file_set_contents_full()` was missing an
`ftruncate()` call.

Fix that, and change the tests to catch truncation failures in future.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #3144
2023-10-22 21:37:28 +01:00
Philip Withnall
86a38bdd92 Merge branch 'gmodule-freebsd' into 'main'
gmodule-dl: Use RTLD_DEFAULT on FreeBSD too

See merge request GNOME/glib!3656
2023-10-22 20:13:12 +00:00
Gleb Popov
bb2ab2647d gmodule-dl: Use RTLD_DEFAULT on FreeBSD too 2023-10-22 21:41:33 +03:00
Sabri Ünal
8e959e32b1 Update Turkish translation 2023-10-21 18:59:04 +00:00
Marco Trevisan
ca57acd71b Merge branch '3112-unicode-15.1' into 'main'
gunicode: Update to Unicode 15.1.0

Closes #3112

See merge request GNOME/glib!3651
2023-10-19 17:02:37 +00:00
Philip Withnall
4ba42dc564 Merge branch 'test-hurd-ci' into 'main'
Initial test of Hurd CI - (run_tests.sh status ignored)

Closes #3135

See merge request GNOME/glib!3631
2023-10-18 23:33:04 +00:00
Damien Zammit
f25a9ca10c Initial test of Hurd CI - (run_tests.sh status ignored) 2023-10-18 23:33:04 +00:00
Florentina Mușat
592be87b7a Update Romanian translation 2023-10-18 18:25:14 +00:00
Michael Catanzaro
74985cc556 Merge branch 'date-time-strup-leak' into 'main'
gdatetime: Fix minor leaks from strup/strdown calls

See merge request GNOME/glib!3654
2023-10-18 15:35:37 +00:00
Philip Withnall
b1ae8fb85f gdatetime: Fix minor leaks from strup/strdown calls
These were accidentally introduced in commit 0b114b2687.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-10-18 15:54:33 +01:00
Philip Withnall
21c6ebf65b Merge branch 'wip/kabus/new-mtime' into 'main'
gio: add a file copy flag for default modification time

Closes #3140

See merge request GNOME/glib!3643
2023-10-18 14:45:49 +00:00
Philip Withnall
f8a40ca4f4 Merge branch 'app-command-line-print-literal' into 'main'
GApplicationCommandLine: add print[err]_literal()

See merge request GNOME/glib!3652
2023-10-18 03:33:33 +00:00
Aleksandr Mezin
b9c90c3a3e GApplicationCommandLine: add print[err]_literal()
GJS (and likely other language bindigs relying on introspection)
can't use `g_application_command_line_print()`/`_printerr()`.
2023-10-18 01:20:23 +03:00
Philip Withnall
17145fab35 gunicode: Update to Unicode 15.1.0
All changes mechanically generated with:
```
./tools/update-unicode-data.sh ~/Downloads/UCD 15.1.0
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #3112
2023-10-17 22:59:27 +01:00
Philip Withnall
80aea8e0a6 gen-unicode-tables: Fix indentation at the start of the first row
It was annoying Marco.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #3112
2023-10-17 22:59:27 +01:00
Philip Withnall
cc350774bf gen-unicode-tables: Strip whitespace off parsed fields
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-10-17 22:45:55 +01:00
Philip Withnall
9770d7ba31 gunicode: Fix a minor typo in a documentation comment
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-10-17 22:45:55 +01:00
Philip Withnall
444a313b1f gunicode: Add new line-break types from Unicode 15.1.0
See https://unicode.org/reports/tr14/

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #3112
2023-10-17 22:45:55 +01:00
Michael Catanzaro
6ad6180b3c Merge branch '3120-libelf-disabling' into 'main'
build: Fix -Dlibelf=disabled on Linux

Closes #3120

See merge request GNOME/glib!3648
2023-10-17 14:18:15 +00:00
Michael Catanzaro
58b66f3d6b Merge branch 'clang-format-14' into 'main'
ci: Update from clang-format-11 to clang-format-14

See merge request GNOME/glib!3646
2023-10-17 14:13:56 +00:00