- 23 Jul, 2020 1 commit
-
-
Nirbheek Chauhan authored
`getenv()` doesn't work well on Windows, f.ex., it can't fetch env vars set with `SetEnvironmentVariable()`. This also means that it doesn't work at all when targeting UWP since that's the only way to set env vars in that case.
-
- 03 Jul, 2020 1 commit
-
-
Peter Bloomfield authored
Use a GPtrArray instead of a GSList in g_uri_list_extract_uris().
-
- 12 Apr, 2019 1 commit
-
-
Nirbheek Chauhan authored
Both provide iconv_open, and in fact, we weren't using the difference anywhere in glib at all.
-
- 07 Jan, 2019 1 commit
-
-
Philip Withnall authored
This is a wrapper around g_private_set() which allocates the desired amount of memory for the caller and calls g_private_set() on it. This is intended to make it easier to suppress Valgrind warnings about leaked memory, since g_private_set() is typically used to make one-time per-thread allocations. We can now just add a blanket suppression rule for any allocations inside g_private_set_alloc0(). Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
- 04 Sep, 2018 1 commit
-
-
Benjamin Otte authored
-
- 13 Feb, 2018 1 commit
-
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <withnall@endlessm.com> Reviewed-by: nobody
-
- 09 Feb, 2018 2 commits
-
-
Mikhail Zabaluev authored
The existing array annotation is inconsistent with the other conversion functions. Now that the implementation guarantees no embedded NULs, the return value can be re-annotated. https://bugzilla.gnome.org/show_bug.cgi?id=756128
-
Mikhail Zabaluev authored
Note that the g_convert() API works with byte arrays. It's wrong to default to utf8 there, because iconv can read and produce strings with interior nul characters which are not allowed in (type utf8). The documentation was misleading about that in some places, so that got corrected as well. Strings in the locale encoding are annotated as dynamic-length byte arrays because they don't have any guaranteed format and can contain nul bytes. For UTF-8 strings in g_*_{from,to}_utf8(), GLib assumes no embedded nul bytes and the (type utf8) annotations on the UTF-8 parameters and return values remain as they were. Likewise for (type filename). https://bugzilla.gnome.org/show_bug.cgi?id=756128
-
- 02 Feb, 2018 3 commits
-
-
Philip Withnall authored
The behaviour of upstream iconv() when faced with a character which is valid in the input encoding, but not representable in the output encoding, is implementation defined: http://pubs.opengroup.org/onlinepubs/9699919799/ Specifically: If iconv() encounters a character in the input buffer that is valid, but for which an identical character does not exist in the target codeset, iconv() shall perform an implementation-defined conversion on this character. This behaviour was being exposed in our g_iconv() wrapper and also in g_convert_with_iconv() — but users of g_convert_with_iconv() (both the GLib unit tests, and the implementation of g_convert_with_fallback()) were assuming that iconv() would return EILSEQ if faced with an unrepresentable character. On platforms like NetBSD, this is not the case: NetBSD’s iconv() finishes the conversion successfully, and outputs a string containing replacement characters. It signals those replacements in its return value from iconv(), which is positive (specifically, non-zero) in such a case. Let’s codify the existing assumed behaviour of g_convert_with_iconv(), documenting that it will return G_CONVERT_ERROR_INVALID_SEQUENCE if faced with an unrepresentable character. As g_iconv() is a thin wrapper around iconv(), leave the behaviour there implementation-defined (but document it as such). Signed-off-by:
Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=790698
-
Philip Withnall authored
Fix capitalisation of GLib, make some text less gender-specific, and add some missing colons. Signed-off-by:
Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=790698
-
Philip Withnall authored
Another part of the long tail of converting our documentation from DocBook to Markdown. Signed-off-by:
Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=790698
-
- 19 Jan, 2018 3 commits
-
-
Mikhail Zabaluev authored
String inputs to convenience conversion functions g_locale_from_utf8(), g_filename_from_utf8(), and g_filename_to_utf8(), are annotated for the bindings as NUL-terminated strings of (type utf8) or (type filename). There is also a len parameter that allows converting part of the string, but it is exposed to the bindings as a value independent from the string buffer. Absent any more sophisticated ways to annotate, the way to provide a safeguard against len argument values longer than the string length is to check that no nul is encountered within the first len bytes of the string. strdup_len() includes this check as part of UTF-8 validation, but g_convert() permits embedded nuls. For g_filename_from_utf8(), also check the output to prevent embedded NUL bytes. It's not safe to allow embedded NULs in a string that is going to be used as (type filename), and no known bytestring encoding for file names allows them. https://bugzilla.gnome.org/show_bug.cgi?id=792516
-
Mikhail Zabaluev authored
The character encoding conversion utility functions g_locale_to_utf8() and g_filename_to_utf8() had inconsistent behavior on producing strings with inner NUL bytes: in the all-UTF-8 strdup path, the input string validation prohibits embedded NULs, while g_convert(), using iconv(), can produce UTF-8 output with NUL bytes inside the output buffer. This, while valid UTF-8 per the Unicode standard, is not valid for the nul-terminated (type utf8) return value format that the *_to_utf8() functions are annotated with (as per discussion in bug 756128). Check the output of g_convert() for embedded NUL bytes, and if any are found, set the newly introduced error G_CONVERT_ERROR_EMBEDDED_NUL. Also document the error set by g_{locale,filename}_{from,to}_utf8() when the input string contains nul bytes. https://bugzilla.gnome.org/show_bug.cgi?id=792516
-
Mikhail Zabaluev authored
In the strdup_len() path, no need to do what g_utf8_validate() already does: locate the string-terminating nul byte. Also in strdup_len(), make the out parameter bytes_read receive the length of the valid (meaning also nul-free) part of the input string, as the documentation on g_{locale,filename}_{from,to}_utf8() says it does. https://bugzilla.gnome.org/show_bug.cgi?id=792516
-
- 11 Jan, 2018 1 commit
-
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <withnall@endlessm.com> Reviewed-by: nobody
-
- 12 Nov, 2017 1 commit
-
-
Stefan Sauer authored
-
- 11 Sep, 2017 1 commit
-
-
Mikhail Zabaluev authored
It's ugly: - The core method, g_iconv(), can't be annotated with good semantics. - The error value of g_iconv_open() is not representable in today's introspection. https://bugzilla.gnome.org/show_bug.cgi?id=756128
-
- 24 May, 2017 1 commit
-
-
Sébastien Wilmet authored
All glib/*.{c,h} files have been processed, as well as gtester-report. 12 of those files are not licensed under LGPL: gbsearcharray.h gconstructor.h glibintl.h gmirroringtable.h gscripttable.h gtranslit-data.h gunibreak.h gunichartables.h gunicomp.h gunidecomp.h valgrind.h win_iconv.c Some of them are generated files, some are licensed under a BSD-style license and win_iconv.c is in the public domain. Sub-directories inside glib/: deprecated/: processed in a previous commit glib-mirroring-tab/: already LGPLv2.1+ gnulib/: not modified, the code is copied from gnulib libcharset/: a copy pcre/: a copy tests/: processed in a previous commit https://bugzilla.gnome.org/show_bug.cgi?id=776504
-
- 28 Apr, 2017 1 commit
-
-
Philip Withnall authored
There are a few places where commit 18a33f72 replaced valid (nullable) (optional) annotations with just (optional). That has a different meaning. (nullable) (optional) can only be applied to gpointer* parameters, and means that both the gpointer* and returned gpointer can be NULL. i.e. The caller can pass in NULL to ignore the return value; and the returned value can be NULL. (optional) can be applied to anything* parameters, and means that the anything* can be NULL. i.e. The caller can pass in NULL to ignore the return value. The return value cannot be NULL. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
- 06 Apr, 2017 1 commit
-
-
Christoph Reiter authored
Makes new code link against the normal symbol names again. Variants with utf8 suffix are there for existing binaries/ABI compat. https://bugzilla.gnome.org/show_bug.cgi?id=780634
-
- 02 Mar, 2017 1 commit
-
-
Paolo Borelli authored
g_utf8_make_valid was turned into a public API this cycle. However now that it is public we should make the API more generic, allowing the caller to specify the length. This is especially useful if the function is called with a string that has \0 in the middle or for chunks of a strings that are not nul terminated. This is also consistent with most of the other utf8 utils. Callers inside glib are updated to the new signature. https://bugzilla.gnome.org/show_bug.cgi?id=779456
-
- 22 Nov, 2016 1 commit
-
-
Christian Hergert authored
If we have an input parameter (or return value) we need to use (nullable). However, if it is an (inout) or (out) parameter, (optional) is sufficient. It looks like (nullable) could be used for everything according to the Annotation documentation, but (optional) is more specific.
-
- 13 Oct, 2016 1 commit
-
-
Simon McVittie authored
Based on a patch by Simon van der Linden and rebased onto current GLib, with improved documentation loosely based on Telepathy's tp_utf8_make_valid(). Signed-off-by:
Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugzilla.gnome.org/show_bug.cgi?id=591603 Bug: https://bugzilla.gnome.org/show_bug.cgi?id=610969Reviewed-by:
Colin Walters <walters@verbum.org>
-
- 12 Oct, 2016 1 commit
-
- 04 Jun, 2016 1 commit
-
-
Christoph Reiter authored
Adds the filename annotation for all file names and things which can contain file names like environment variables, argv- On Unix they can contain anything while on Windows they are always utf-8. https://bugzilla.gnome.org/show_bug.cgi?id=767245
-
- 12 Apr, 2016 1 commit
-
-
Phillip Wood authored
Character entities are not supposed to be supported by gtk-doc¹ and fix the spelling of ‘optional’ ¹https://bugzilla.gnome.org/show_bug.cgi?id=758137 https://bugzilla.gnome.org/show_bug.cgi?id=758174
-
- 07 Nov, 2015 1 commit
-
-
Philip Withnall authored
Add various (nullable) and (optional) annotations which were missing from a variety of functions. Also port a couple of existing (allow-none) annotations in the same files to use (nullable) and (optional) as appropriate instead. Secondly, add various (not nullable) annotations as needed by the new default in gobject-introspection of marking gpointers as (nullable). See https://bugzilla.gnome.org/show_bug.cgi?id=729660. This includes adding some stub documentation comments for the assertion macro error functions, which weren’t previously documented. The new comments are purely to allow for annotations, and hence are marked as (skip) to prevent the symbols appearing in the GIR file. https://bugzilla.gnome.org/show_bug.cgi?id=719966
-
- 30 May, 2014 1 commit
-
-
Thiago Santos authored
Some charsets have each char with more than one byte, make it clear that the length should be in bytes https://bugzilla.gnome.org/show_bug.cgi?id=730963
-
- 20 Feb, 2014 2 commits
-
-
Allison Karlitskaya authored
Add a note to the documentation of g_convert() advising to avoid using it for transliteration. Link to g_str_to_ascii().
-
William Jon McCann authored
Instead of "Return value:".
-
- 08 Feb, 2014 2 commits
-
-
Matthias Clasen authored
-
Matthias Clasen authored
These are all replaced by markdown ref links.
-
- 06 Feb, 2014 4 commits
-
-
Matthias Clasen authored
-
Matthias Clasen authored
-
Matthias Clasen authored
Switch to simpler markdown, `foo`.
-
Matthias Clasen authored
Switch to simpler markdown, `foo`.
-
- 01 Feb, 2014 4 commits
-
-
Matthias Clasen authored
These don't really work in the generated docs, so just copy the content in the few places.
-
Matthias Clasen authored
In particular, we convert sections and lists to markdown syntax here.
-
Matthias Clasen authored
-
Matthias Clasen authored
Most of the time, the text read just as well without the extra boldness.
-