Commit Graph

25 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
b27fbf503b girepository/girparser,girmodule: Use a GPtrArray to hold the dependencies
It's just better than a list of strings for various reasons, but mostly
here it allows also to avoid copying the lists but making the
ownership clearer through references
2024-05-16 22:51:12 +01:00
Marco Trevisan (Treviño)
6e38293fec girepository/girparser: Move dependencies ownership to each module
In this way the module can survive without that the parser is fully
alive.

At the moment a module has not a ref-count system, but this makes things
clearer when we return the module from a parser.
2024-05-16 22:51:12 +01:00
Marco Trevisan (Treviño)
4cdf53a15c girepository/girmodule: Cleanup the temporary dependencies string
It's used during build phase, as a temporary variable but never freed
2024-05-16 22:51:12 +01:00
Marco Trevisan (Treviño)
6a4f8e5bb7 girepository/girmodule: Use clearer scope for the build struct
Allocate it only when needed avoiding manual memset
2024-05-16 22:51:12 +01:00
Marco Trevisan (Treviño)
05f606f3c5 girepository/girmodule: Cleanup the build stack once we've done
The stack is allocated with a list that we need to free once done
2024-05-16 22:51:12 +01:00
Marco Trevisan (Treviño)
9f4b97bb92 girepository/girmodule: Cleanup the builder types hash keys
We were adding new keys but never removing them, so use the proper
destroy notify for them and clarify the ownership on the caller.
2024-05-16 22:51:12 +01:00
Marco Trevisan (Treviño)
1b8ef05321 girepository/girmodule: Free the version, shared library and c prefix
Those strings are explicitly duplicated but never free'd
2024-05-16 22:51:12 +01:00
Philip Withnall
b4063e1fa8 Merge branch 'typelib-bytes' into 'main'
gitypelib: Replace multiple constructors with gi_typelib_new_from_bytes()

See merge request GNOME/glib!3855
2024-01-26 10:15:49 +00:00
Philip Withnall
1eec66c898 gitypelib: Replace multiple constructors with gi_typelib_new_from_bytes()
`GBytes` provides a way of handling const memory blobs, stolen memory
blobs, and mapped files. Rather than having `GITypelib` implement all of
those itself, just take a `GBytes` as input.

This is an API break, but libgirepository hasn’t been in a stable
release yet.

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

Helps: #3155
2024-01-26 09:51:13 +00:00
Philip Withnall
543fea1df7 girmodule: Simplify a branch in gi_ir_module_new()
`g_strdup(NULL)` is guaranteed to return `NULL`, so there’s no need to
branch to handle that.

Add a stub private doc comment to hold a `(nullable)` annotation for
that argument, though, so that information isn’t lost.

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

Helps: #3155
2024-01-26 09:29:30 +00:00
Marco Trevisan (Treviño)
91a3399027 girmodule: Ensure we actually use unsigned for gi_ir_module_fatal line 2024-01-16 18:40:42 +01:00
Marco Trevisan (Treviño)
bc2e4b3de5 girrepository: Replace usage of gsize with standard size_t
We just do a safe s/gsize/size_t/ replacement here without doing any
changes to places in which different size of size_t and gsize may be
actually different and create troubles.
2024-01-16 18:40:42 +01:00
Marco Trevisan (Treviño)
c8aecbb834 girepository: Use uint8_t pointers instead of guchar 2024-01-16 18:40:42 +01:00
Marco Trevisan (Treviño)
9f33015a25 girrepository: Use standard int sized types instead of g[u]int* 2024-01-16 18:40:42 +01:00
Marco Trevisan (Treviño)
8891429a5b girepository: Use char instead of glib-specific gchar 2024-01-16 18:40:42 +01:00
Marco Trevisan (Treviño)
eda4bfcf95 girrepository: Use void* instead of gpointer 2024-01-16 18:40:37 +01:00
Marco Trevisan (Treviño)
91fc45ea57 girepository: Replace tabs with spaces in indentation
We don't use tabs anywhere and the mixed setup just makes many editors
to cry. So let's just replace the tabs with 8 spaces.
2024-01-16 17:30:37 +01:00
Marco Trevisan (Treviño)
2ee2088f4a girrepository: Drop trailing new line on GMessages 2024-01-15 21:26:53 +00:00
Philip Withnall
466a9f1aca girmodule: Port documentation to gi-docgen and update
Review and update the documentation, making sure it’s complete,
formatted in gi-docgen format, and has all appropriate GIR annotations
and `Since:` lines.

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

Helps: #3155
2023-12-18 14:14:16 +00:00
Philip Withnall
2b544c3f66 girepository: Remove _ prefix from private functions
Now that libgirepository uses `GI_AVAILABLE_IN_*` macros, that’s what
controls symbol visibility. The `_` prefixes are redundant, and out of
keeping with the rest of GLib.

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

Helps: #3155
2023-11-08 15:23:31 +00:00
Philip Withnall
b32da06a7c girepository: Rename symbols to the GI namespace
Rather than a mix of structs being in `GI` and their methods being in
`g_`.

We’ve chosen not to use the `g_` namespace because a number of the
libgirepository class names are quite generic, so we’d end up with
confusing symbols like `GScopeType` and `GArgument`.

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

Helps: #3155
2023-11-08 15:05:20 +00:00
Emmanuele Bassi
b0f4a6bcc4 gir: Rename girnode.h to girnode-private.h
It's a private header.
2023-11-08 00:09:04 +00:00
Emmanuele Bassi
48984375dc gir: Rename girmodule.h to girmodule-private.h
It's private header.
2023-11-08 00:06:01 +00:00
Philip Withnall
844544f72c girepository: Add SPDX license header to all obvious files
Add the SPDX license runes to all the files which have an obvious
copyright header already. This is a mechanical edit.

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

Helps: #3155
2023-10-25 17:10:10 +01:00
Emmanuele Bassi
03d6c16434 Move girepository 2023-10-15 17:56:05 +01:00