summaryrefslogtreecommitdiff
path: root/lib/unistr.in.h
Commit message (Collapse)AuthorAgeFilesLines
* uninorm, unistr: Improve GCC 11 allocation-deallocation checking.Bruno Haible2021-08-081-3/+9
| | | | | | | | | * lib/uninorm.in.h (uninorm_filter_free): Move declaration up. (uninorm_filter_create): Declare that deallocation must happen through 'uninorm_filter_free'. * lib/unistr.in.h: Include <stdlib.h>. (u8_strdup, u16_strdup, u32_strdup): Declare that deallocation must happen through 'free'.
* gnulib-common: update for C2x 2020-12-11 draftPaul Eggert2021-07-311-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use blessed-by-draft-standard way to test for [[__deprecated__]] etc.; this is supported by GCC 11 and the fallback code should work fine with GCC 10 and earlier, clang, etc. * NEWS, doc/attribute.texi: Mention that DEPRECATED etc. must now come first. * lib/fflush.c, lib/unistr.in.h: Do not include unused-parameter.h. All uses of _GL_UNUSED_PARAMETER (after parameters) replaced by _GL_ATTRIBUTE_MAYBE_UNUSED (before parameters). Although perhaps we need a shorter name for _GL_ATTRIBUTE_MAYBE_UNUSED, that should probably be in gnulib-common.m4, due to the ubiquity of this issue. And perhaps the snippet/unused-parameter module should be marked obsolete since it's no longer compatible with its old use. * m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macro _GL_HAS_C_ATTRIBUTE, and use it instead of __STDC_VERSION__ in deciding whether to use C2x attributes like [[__deprecated__]]. (_GL_ATTRIBUTE_MAYBE_UNUSED): Fall back on _GL_ATTRIBUTE_UNUSED. (_GL_ATTRIBUTE_UNUSED): New macro, for labels where C2x [[maybe_unused]] do not work. (_GL_UNUSED, _GL_UNUSED_LABEL): Use it. * modules/fflush, modules/unistr/base (Depends-on): Remove snippet/unused-parameter. * modules/fflush (selinux/selinux.h, selinux/context.h) (selinux/label.h): Do not use $(UNUSED_PARAMETER). Remove useless chmod a-x.
* Put LGPLv2+ notices in source files where appropriate.Bruno Haible2021-06-041-7/+7
| | | | | * lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description says so.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* unistr/u{8,16,32}-uctomb: Avoid possible trouble with huge strings.Bruno Haible2020-09-051-9/+9
| | | | | | | | | | * lib/unistr.in.h (u8_uctomb_aux, u8_uctomb, u16_uctomb_aux, u16_uctomb, u32_uctomb): Change type of last argument to ptrdiff_t. * lib/unistr/u8-uctomb.c (u8_uctomb): Likewise. * lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise. * lib/unistr/u16-uctomb.c (u16_uctomb): Likewise. * lib/unistr/u16-uctomb-aux.c (u16_uctomb_aux): Likewise. * lib/unistr/u32-uctomb.c (u32_uctomb): Likewise.
* uni*/base: Use 'restrict'.Bruno Haible2020-02-231-24/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/unitypes.in.h (_UC_RESTRICT): New macro, based on '_Restrict_' from lib/regex.h. * lib/unistr.in.h (u8_cpy, u16_cpy, u32_cpy, u8_strcpy, u16_strcpy, u32_strcpy, u8_stpcpy, u16_stpcpy, u32_stpcpy, u8_strncpy, u16_strncpy, u32_strncpy, u8_stpncpy, u16_stpncpy, u32_stpncpy, u8_strcat, u16_strcat, u32_strcat, u8_strncat, u16_strncat, u32_strncat, u8_strtok, u16_strtok, u32_strtok): Use '_UC_RESTRICT'. * lib/uninorm.in.h (u8_normalize, u16_normalize, u32_normalize): Use '_UC_RESTRICT'. * lib/uniconv.in.h (u8_conv_to_encoding, u16_conv_to_encoding, u32_conv_to_encoding): Use '_UC_RESTRICT'. * lib/unicase.in.h (u8_toupper, u16_toupper, u32_toupper, u8_tolower, u16_tolower, u32_tolower, u8_totitle, u16_totitle, u32_totitle, u8_ct_toupper, u16_ct_toupper, u32_ct_toupper, u8_ct_tolower, u16_ct_tolower, u32_ct_tolower, u8_ct_totitle, u16_ct_totitle, u32_ct_totitle, u8_casefold, u16_casefold, u32_casefold, u8_ct_casefold, u16_ct_casefold, u32_ct_casefold, u8_casexfrm, u16_casexfrm, u32_casexfrm, ulc_casexfrm): Use '_UC_RESTRICT'. * lib/unilbrk.in.h (u8_possible_linebreaks, u16_possible_linebreaks, u32_possible_linebreaks, ulc_possible_linebreaks, u8_width_linebreaks, u16_width_linebreaks, u32_width_linebreaks, ulc_width_linebreaks): Use '_UC_RESTRICT'. * lib/uniwbrk.in.h (ulc_wordbreaks): Use '_UC_RESTRICT'. * lib/unistdio.in.h (ulc_sprintf, ulc_snprintf, ulc_asnprintf, ulc_vsprintf, ulc_vsnprintf, ulc_vasnprintf, u8_u8_sprintf, u8_u8_snprintf, u8_u8_asnprintf, u8_u8_vsprintf, u8_u8_vsnprintf, u8_u8_vasnprintf, u16_u16_sprintf, u16_u16_snprintf, u16_u16_asnprintf, u16_u16_vsprintf, u16_u16_vsnprintf, u16_u16_vasnprintf, u32_u32_sprintf, u32_u32_snprintf, u32_u32_asnprintf, u32_u32_vsprintf, u32_u32_vsnprintf, u32_u32_vasnprintf): Use '_UC_RESTRICT'.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* unistr/base: Update comment.Bruno Haible2017-12-111-2/+2
| | | | * lib/unistr.in.h: Update comment about u*_mbtouc_unsafe functions.
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* Enable Unicode decoder safety unconditionally.Bruno Haible2016-11-191-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/unistr.in.h (u32_mbtouc_unsafe): Assume CONFIG_UNICODE_SAFETY. * lib/unistr/u8-mblen.c (u8_mblen): Likewise. * lib/unistr/u8-mbtouc-unsafe.c (u8_mbtouc_unsafe): Likewise. * lib/unistr/u8-mbtouc-unsafe-aux.c (u8_mbtouc_unsafe_aux): Likewise. * lib/unistr/u8-prev.c (u8_prev): Likewise. * lib/unistr/u8-strmblen.c (u8_strmblen): Likewise. * lib/unistr/u8-strmbtouc.c (u8_strmbtouc): Likewise. * lib/unistr/u16-mblen.c (u16_mblen): Likewise. * lib/unistr/u16-mbtouc-unsafe.c (u16_mbtouc_unsafe): Likewise. * lib/unistr/u16-mbtouc-unsafe-aux.c (u16_mbtouc_unsafe_aux): Likewise. * lib/unistr/u16-prev.c (u16_prev): Likewise. * lib/unistr/u16-strmblen.c (u16_strmblen): Likewise. * lib/unistr/u16-strmbtouc.c (u16_strmbtouc): Likewise. * lib/unistr/u32-mblen.c (u32_mblen): Likewise. * lib/unistr/u32-mbtouc-unsafe.c (u32_mbtouc_unsafe): Likewise. * lib/unistr/u32-prev.c (u32_prev): Likewise. * lib/unistr/u32-next.c (u32_next): Likewise. * lib/unistr/u32-strmblen.c (u32_strmblen): Likewise. * lib/unistr/u32-strmbtouc.c (u32_strmbtouc): Likewise. * lib/uniconv/u8-conv-to-enc.c (u8_conv_to_encoding): Likewise. * lib/uniconv/u8-strconv-to-enc.c (u8_strconv_to_encoding): Likewise. * tests/unistr/test-u16-prev.c (check_invalid): Enable the CONFIG_UNICODE_SAFETY tests unconditionally. * tests/unistr/test-u32-mblen.c (main): Likewise. * tests/unistr/test-u32-mbtouc.h (test_function): Likewise. * tests/unistr/test-u32-prev.c (check_invalid): Likewise. * tests/unistr/test-u32-next.c (main): Likewise. * tests/unistr/test-u32-strmblen.c (main): Likewise. * tests/unistr/test-u32-strmbtouc.c (main): Likewise. * tests/unistr/test-u32-mbtouc.c (FULL_SAFETY): Remove macro. * lib/unistr/u8-check.c (u8_check): Remove old dead code. * lib/unistr/u8-mbtouc.c (u8_mbtouc): Likewise. * lib/unistr/u8-mbtouc-aux.c (u8_mbtouc_aux): Likewise. * lib/unistr/u8-mbtoucr.c (u8_mbtoucr): Likewise. * lib/unistr/u8-uctomb.c (u8_uctomb): Likewise. * lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise. * lib/unistr/u16-check.c (u16_check): Update comment. * NEWS: Mention the changes that callers should be aware of.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* Enable common subexpression optimization in GCC.Bruno Haible2012-03-251-58/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/unitypes.in.h (_UC_ATTRIBUTE_CONST, _UC_ATTRIBUTE_PURE): New macros. * lib/unicase.in.h (uc_toupper, uc_tolower, uc_totitle): Declare with GCC attribute 'const'. (uc_locale_language): Declare with GCC attribute 'pure'. * lib/unicase/caseprop.h (uc_is_cased, uc_is_case_ignorable): Declare with GCC attribute 'const'. * lib/unictype.in.h (uc_is_general_category_withtable, uc_combining_class, uc_combining_class_name, uc_combining_class_long_name, uc_bidi_class_name, uc_bidi_category_name, uc_bidi_class_long_name, uc_bidi_class, uc_bidi_category, uc_is_bidi_class, uc_is_bidi_category, uc_decimal_value, uc_digit_value, uc_numeric_value, uc_joining_type_name, uc_joining_type_long_name, uc_joining_type, uc_joining_group_name, uc_joining_group, uc_is_property_*, uc_script, uc_block, uc_is_c_whitespace, uc_is_java_whitespace, uc_c_ident_category, uc_java_ident_category, uc_is_alnum, uc_is_alpha, uc_is_cntrl, uc_is_digit, uc_is_graph, uc_is_lower, uc_is_print, uc_is_punct, uc_is_space, uc_is_upper, uc_is_xdigit, uc_is_blank): Declare with GCC attribute 'const'. (uc_general_category_name, uc_general_category_long_name, uc_general_category_byname, uc_general_category, uc_is_general_category, uc_combining_class_byname, uc_bidi_class_byname, uc_bidi_category_byname, uc_joining_type_byname, uc_joining_group_byname, uc_script_byname, uc_is_script, uc_is_block): Declare with GCC attribute 'pure'. * lib/unigbrk.in.h (uc_graphemeclusterbreak_property, uc_is_grapheme_break, u8_grapheme_next, u16_grapheme_next, u32_grapheme_next, u8_grapheme_prev, u16_grapheme_prev, u32_grapheme_prev, lib/uniname.in.h (unicode_name_character): Declare with GCC attribute 'pure'. * lib/uninorm.in.h (uc_composition): Declare with GCC attribute 'const'. (uninorm_decomposing_form): Declare with GCC attribute 'pure'. * lib/unistr.in.h (): Declare with GCC attribute 'const'. (u8_check, u16_check, u32_check, u8_mblen, u16_mblen, u32_mblen, u8_cmp, u16_cmp, u32_cmp, u8_cmp2, u16_cmp2, u32_cmp2, u8_chr, u16_chr, u32_chr, u8_mbsnlen, u16_mbsnlen, u32_mbsnlen, u8_strmblen, u16_strmblen, u32_strmblen, u8_strlen, u16_strlen, u32_strlen, u8_strnlen, u16_strnlen, u32_strnlen, u8_strcmp_gnu, u8_strcmp, u16_strcmp, u32_strcmp, u8_strncmp, u16_strncmp, u32_strncmp, u8_strchr, u16_strchr, u32_strchr, u8_strrchr, u16_strrchr, u32_strrchr, u8_strcspn, u16_strcspn, u32_strcspn, u8_strspn, u16_strspn, u32_strspn, u8_strpbrk, u16_strpbrk, u32_strpbrk, u8_strstr, u16_strstr, u32_strstr, u8_startswith, u16_startswith, u32_startswith, u8_endswith, u16_endswith, u32_endswith): Declare with GCC attribute 'pure'. * lib/uniwbrk.in.h (uc_wordbreak_property): Declare with GCC attribute 'const'. * lib/uniwidth.in.h (uc_width): Simplify declaration. (u8_width, u16_width, u32_width, u8_strwidth, u16_strwidth, u32_strwidth): Declare with GCC attribute 'pure'.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* unistr/u8-strcmp: Avoid collision with libc function on Solaris 11.Bruno Haible2010-12-071-0/+7
| | | | | | * lib/unistr.in.h (u8_strcmp) [__sun]: Declare with real name u8_strcmp_gnu. * modules/unistr/u8-strcmp (configure.ac): Bump version number.
* unistr/base: Avoid link errors when module 'libunistring' is also used.Bruno Haible2010-09-151-12/+12
| | | | | | | | * lib/unistr.in.h (u8_mbtouc_unsafe, u16_mbtouc_unsafe, u32_mbtouc_unsafe, u8_mbtouc, u16_mbtouc, u32_mbtouc, u8_mbtoucr, u16_mbtoucr, u32_mbtoucr, u8_uctomb_aux, u16_uctomb_aux, u32_uctomb): Declare also when HAVE_LIBUNISTRING is set. Reported by Pádraig Brady <P@draigbrady.com>.
* New module 'libunistring-optional'.Bruno Haible2010-05-181-0/+685