Commit Graph

59 Commits

Author SHA1 Message Date
Philip Withnall
0ce0701893 gunidecomp: Update and reformat Unicode version support history
To aid https://stackoverflow.com/q/60949426/2931197.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-31 14:18:32 +01:00
Philip Withnall
18a232be89 glib: Various minor scan-build fixes
These squash various warnings from `scan-build`. None of them are
legitimate bugs, but some of them do improve code readability a bit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1767
2019-09-05 13:51:27 +01:00
Michael Gratton
af9696caad g_utf8_normalize: Doc comment return missing nullable annotation
The return value for g_utf8_normalize may be null, but the return type
is not annotated as such. This is important for language bindings for
langs that are about nullability, such as Vala and Haskell.
2019-06-29 15:06:20 +10:00
Philip Withnall
84d0af4226 Merge branch '1811-unicode-annotations' into 'master'
gunidecomp: Add (out) annotations to g_unichar_{de,}compose()

Closes #1811

See merge request GNOME/glib!936
2019-06-21 17:02:58 +00:00
Philip Withnall
5380f417dc gunidecomp: Fix a (nullable) annotation which should be (optional)
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #872
2019-06-21 11:04:35 +01:00
Philip Withnall
79502febe0 gunidecomp: Add (out) annotations to g_unichar_{de,}compose()
The `(out)` and (unusually) `(not optional)` annotations were missing.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1811
2019-06-20 23:33:58 +01:00
Sébastien Wilmet
f9faac7661 glib/: LGPLv2+ -> LGPLv2.1+
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
2017-05-24 11:58:19 +02:00
Sébastien Wilmet
f60590534d License headers: "the Gnome Library" -> "this library"
Harmonize a little the license headers. In most of the license headers
in GLib, it is "this library".

It is also what is explained at:
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html#SEC4
"How to Apply These Terms to Your New Libraries"

https://bugzilla.gnome.org/show_bug.cgi?id=776586
2017-01-04 19:12:56 +01:00
Christian Hergert
18a33f72db introspection: use (nullable) or (optional) instead of (allow-none)
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.
2016-11-22 14:14:37 -08:00
William Jon McCann
20f4d1820b docs: use "Returns:" consistently
Instead of "Return value:".
2014-02-19 19:41:52 -05:00
Matthias Clasen
cb588d4532 Convert external links to markdown syntax 2014-02-05 21:23:28 -05:00
Matthias Clasen
0cc20b7e0b Don't use <filename> in docs
Switch to simpler markdown, `foo`.
2014-02-05 20:17:46 -05:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Robert Ancell
4143842eb4 Add missing allow-none annotations for function parameters.
Found using:
find . -name '*.c' | xargs grep 'or %NULL' | grep ' \* @' | grep -v '@error' | grep -v allow-none
2012-03-31 20:34:28 +11:00
Philip Withnall
386bb0faad unicode: Fix a few issues with G_UNICHAR_MAX_DECOMPOSITION_LENGTH
Raised by Matthias in bgo#665685 but which I didn't spot until after pushing
commit 3ac7c35656.

Renames G_UNICHAR_MAX_DECOMPOSITION_LEN to G_UNICHAR_MAX_DECOMPOSITION_LENGTH
and fixes a few documentation issues.

See: bgo#665685
2011-12-06 19:41:31 +00:00
Philip Withnall
3ac7c35656 Bug 665685 — Add a #define for the max length of a Unicode decomposition
Add G_UNICHAR_MAX_DECOMPOSITION_LEN for the maximum length of the
decomposition of a single Unicode character.

Closes: bgo#665685
2011-12-06 19:09:01 +00:00
Behdad Esfahbod
10a154446c Minor doc fix. 2011-12-06 13:20:39 -05:00
Behdad Esfahbod
b7051e8da8 Fix docs 2011-09-15 16:51:51 -04:00
Behdad Esfahbod
e3219c8425 Fixup max decomposition len guarantee
Unicode Technical Committee agreed to limit decomposition length to
18 in both cases.  Reflect that.
2011-08-17 12:14:07 +02:00
Matthias Clasen
09e2d2a61c Move Unicode docs inline, ditch template 2011-07-18 23:23:17 -04:00
Behdad Esfahbod
615977d337 Simplify Hangul Jamo decomposition
The algorithm is not copy/paste from Unicode anymore, but it's easy
enough to follow the logic.
2011-07-18 18:12:35 -04:00
Behdad Esfahbod
0584fe33de Bug 654651 - Better g_unicode_canonical_decomposition()
Add g_unichar_fully_decompose().
Deprecate g_unicode_canonical_decomposition().
2011-07-18 18:12:35 -04:00
Behdad Esfahbod
7041b701dd Remove comp_step_table table
Reuse the pre-existing composition data.
2011-07-14 16:55:35 -04:00
Behdad Esfahbod
89a5d17d58 Document, that the second part of a decompose() wouldn't decompose()
This is not directly documented in Unicode, or I couldn't find it,
but the test I just added confirms that it is currently the case.
2011-07-14 16:55:35 -04:00
Behdad Esfahbod
cff4b5b3a3 Remove stale comment
Unicode guarantees that.
2011-07-14 16:55:35 -04:00
Behdad Esfahbod
a73c66b134 Add tests for Unicode canonical composition/decomposition
Also update compose()/decompose() API corner cases and docs.
2011-07-14 16:55:35 -04:00
Matthias Clasen
761a1841ee Bug 654195 - Add g_unichar_compose() and g_unichar_decompose() 2011-07-14 16:55:34 -04:00
Matthias Clasen
f13d561211 More header inclusion cleanup 2010-09-05 00:23:03 -04:00
Ryan Lortie
2e53e50244 glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
Matthias Clasen
065928c778 Fix a doc issue
svn path=/trunk/; revision=7310
2008-08-05 01:23:16 +00:00
Mathias Hasselmann
c79ef3793c Mention g_utf8_normalize() returns NULL on invalid string. (#501997)
* glib/gunidecomp.c: Mention g_utf8_normalize()
returns NULL on invalid string. (#501997)

svn path=/trunk/; revision=6058
2007-12-06 10:22:13 +00:00
Matthias Clasen
bda8d80b6d Documentation cleanups
svn path=/trunk/; revision=5652
2007-07-22 04:14:54 +00:00
Behdad Esfahbod
613b489b6b Make g_unichar_combining_class() public. (#453998)
2007-07-19  Behdad Esfahbod  <behdad@gnome.org>

        * glib/glib.symbols:
        * glib/gunicode.h:
        * glib/gunicodeprivate.h:
        * glib/gunidecomp.c (g_unichar_combining_class):
        * glib/guniprop.c (has_more_above):
        Make g_unichar_combining_class() public. (#453998)


svn path=/trunk/; revision=5644
2007-07-19 13:46:05 +00:00
Behdad Esfahbod
290443f86f Update to reflect Unicode PR #29 (#348694, Nikolai Weibull)
2006-07-31  Behdad Esfahbod  <behdad@gnome.org>

        * glib/gunidecomp.c (_g_utf8_normalize_wc): Update to reflect Unicode
        PR #29 (#348694, Nikolai Weibull)

        * tests/unicode-normalize.c (encode), (test_form): Make output more
        useful, reporting the unexpected output of the test.
2006-07-31 04:50:05 +00:00
Matthias Clasen
499d7937b7 Don't eat Hangul when normalizing. (#301742, reported by Christian Biere,
2005-05-25  Matthias Clasen  <mclasen@redhat.com>

	* glib/gunidecomp.c (combine_hangul): Don't eat Hangul
	when normalizing.  (#301742, reported by Christian Biere,
	patch by Noah Levitt)
2005-05-25 16:03:13 +00:00
Matthias Clasen
c8099fa3e9 Correct the end of the Hangul Syllables range, from 0xd7af to 0xd7a3, in
2005-05-18  Matthias Clasen  <mclasen@redhat.com>

	* glib/gunidecomp.c: Correct the end of the Hangul
	Syllables range, from 0xd7af to 0xd7a3, in several
	places.  (#301984, Changwoo Ryu)
2005-05-18 13:41:11 +00:00
Matthias Clasen
608a31b98e Make PLT-reduction work with gcc4, and don't include everything in
2005-03-13  Matthias Clasen  <mclasen@redhat.com>

	Make PLT-reduction work with gcc4, and don't include
	everything in galias.h:

	* glib/glib.symbols: Group symbols by header and source file.
	* glib/makegalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegalias.pl -def
	* glib/Makefile.am (galiasdef.c): Add a rule to generate this
	file.
	* glib/*.c: Include galias.h after the other GLib headers,
	include galiasdef.c at the bottom.
2005-03-14 04:26:57 +00:00
Matthias Clasen
dafdffd751 Implement the same PLT reduction technique used in GTK+:
Thu Sep 16 02:03:15 2004  Matthias Clasen  <maclas@gmx.de>

	Implement the same PLT reduction technique used in GTK+:
2004-09-16 06:05:53 +00:00
Noah Levitt
782188d539 Size compose_table correctly. (#123421, Simon Josefsson)
2004-01-30  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunicomp.h:
	* glib/gunidecomp.c:
	* glib/gen-unicode-tables.pl: Size compose_table correctly. (#123421,
        Simon Josefsson)

	* glib/gen-unicode-tables.pl: Get rid of some new warnings from perl
	5.8.1.
2004-01-30 23:20:16 +00:00
Manish Singh
267031000f fix gint/gsize confusion.
Fri Dec  5 12:09:13 2003  Manish Singh  <yosh@gimp.org>

        * glib/gunidecomp.c (_g_utf8_normalize_wc): fix gint/gsize confusion.
2003-12-05 20:09:34 +00:00
Noah Levitt
45b1590923 Add hangul composition and decomposition to unicode normalization.
2003-12-04  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunidecomp.c: Add hangul composition and decomposition to
	unicode normalization. (#100456)

	* tests/unicode-normalize.c: Test hangul.
2003-12-04 19:47:52 +00:00
Noah Levitt
8d91ba8c58 Unicode 4.0 special casing. (#114681)
2003-09-10  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunicodeprivate.h:
	* glib/gunicollate.c:
	* glib/gunidecomp.c:
	* glib/guniprop.c:
	* tests/casemap.txt:
	* tests/gen-casemap-txt.pl: Unicode 4.0 special casing. (#114681)

	* glib/gunicodeprivate.h: Use a private header instead of extern
	function declarations (_g_utf8_normalize_wc,
	_g_unichar_combining_class).
2003-09-10 16:55:36 +00:00
Noah Levitt
05f99527eb Update Unicode data to 4.0. (#107974)
2003-07-30  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gen-unicode-tables.pl:
	* glib/gunibreak.c:
	* glib/gunibreak.h:
	* glib/gunichartables.h:
	* glib/gunicode.h:
	* glib/gunicomp.h:
	* glib/gunidecomp.c:
	* glib/gunidecomp.h:
	* glib/guniprop.c:
	* tests/casefold.txt:
	* tests/casemap.txt:
	* tests/gen-casefold-txt.pl:
	* tests/gen-casemap-txt.pl: Update Unicode data to 4.0. (#107974)
2003-07-31 02:27:56 +00:00
Noah Levitt
fef203f9f7 Fix typo (#114375). Also, make the function static.
2003-06-04  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunidecomp.h (combine): Fix typo (#114375). Also, make the
	function static.
2003-06-04 20:53:55 +00:00
Noah Levitt
6bc2ee510a Fix off-by-one error in g_unicode_canonical_ordering (bug #113260).
2003-05-19  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunidecomp.c: Fix off-by-one error in
	g_unicode_canonical_ordering (bug #113260).
2003-05-19 15:54:48 +00:00
Matthias Clasen
98fefa5b5f Use g_malloc instead of directly using malloc.
2003-02-26  Matthias Clasen  <maclas@gmx.de>

	* glib/gunidecomp.c (g_unicode_canonical_decomposition): Use
	g_malloc instead of directly using malloc.
2003-02-25 23:20:16 +00:00
Owen Taylor
bbbd329ff5 Patch from Sven Neumann to make the include order consistent. (#71704)
Tue Dec  3 20:22:27 2002  Owen Taylor  <otaylor@redhat.com>

        * glib/*.c: Patch from Sven Neumann to make the
        include order consistent. (#71704)
2002-12-04 01:27:44 +00:00
Owen Taylor
57d9c0926a 1.3.14
Sun Feb 17 11:37:06 2002  Owen Taylor  <otaylor@redhat.com>

        * 1.3.14

        * glib/glibintl.h: Error out of config.h wasn't included
        rather than including it, since config.h must be the
        first thing included.

        * glib/gconvert.c glib/gmarkup.c glib/gshell.c glib/gspawn.c
        glib/gunibreak.c glib/gunidecomp.c glib/guniprop.c:
        Include config.h as the first thing. (#71704, Morten
        Welinder)
2002-02-17 23:28:43 +00:00
Owen Taylor
2bbd00a263 Patch from Andrew Taylor to optimize the decomposition table to eliminate
Tue Nov 20 20:54:25 2001  Owen Taylor  <otaylor@redhat.com>
	* glib/gunidecomp.[ch] glib/gen-unicode-tables.pl: Patch
	from Andrew Taylor to optimize the decomposition table
	to eliminate relocations and save space. (#64982)
2001-11-21 01:57:10 +00:00
Owen Taylor
917026269e Patch from Andrew Taylor to improve tables and reduce relocations by using
Tue Nov 13 21:25:35 2001  Owen Taylor  <otaylor@redhat.com>

	* glib/{gen-unicode-tables.pl,gunibreak.c,gunibreak.h,
	gunichartables.h, gunicomp.h, gunidecomp.[ch],
	guniprop.c}: Patch from Andrew Taylor to improve
	tables and reduce relocations by using indices
	rather than pointers. (#64433)

	* tests/unicode-normalize.c (main): Fix for changes
	to g_strsplit().
2001-11-14 02:32:45 +00:00