Commit Graph

18 Commits

Author SHA1 Message Date
Keith Packard 9042d0ce65 Use remove-advertising-clause script to edit BSD licenses
This edits licenses held by Berkeley and NetBSD, both of which
have removed the advertising requirement from their licenses.

Signed-off-by: Keith Packard <keithp@keithp.com>
2020-01-29 19:03:31 +01:00
Yaakov Selkowitz 0bda30e1ff ansification: remove _CONST
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:08 -06:00
Corinna Vinschen e97109184a Drop global __ctype_ptr__ entirely in favor of using locale_t::ctype_ptr
Keep __ctype_ptr__ available on Cygwin only, for backward compatibility
with existing apps referencing it via the ctype macros.

Otherwise initialize __global_locale.ctype_ptr and __C_locale.ctype_ptr
and use them throughout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-25 14:18:31 +02:00
Corinna Vinschen 1498c79db8 Change loadlocale to fill a __locale_t given as parameter
Don't use global variables.  This allows to call loadlocale from
the yet to be created newlocale().

Rename _thr_locale_t to __locale_t (these locales are not restricted
to threads so the name is misleading).

Along these lines, fix _set_ctype to take a __locale_t as parameter.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15 10:56:57 +02:00
Corinna Vinschen a6a477fa81 POSIX-1.2008 per-thread locales, groundwork part 1
Introduce first cut of struct _thr_locale_t used for the locale_t definition.
Introduce global instance called __global_locale used by default.
Introduce internal inline functions __get_global_locale, __get_locale_r,
__get_current_locale.

Remove usage of global variables in favor of accessor functions pointing to
__global_locale for now.  Include all local headers in locale subdir from
setlocale.h to get single include for internal locale access.

Introduce __CTYPE_PTR macro to replace direct access to __ctype_ptr__
and use throughout in isxxx functions.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15 10:56:56 +02:00
Corinna Vinschen 1875ee55d3 Port newlib to x86_64-pc-cygwin.
* libc/include/sys/features.h: Redefine compilation environment
	definitions for Cygwin to cover 64 bit Cygwin.
	* libc/ctype/ctype_.c (_ctype_): Fix definition for 64 bit Cygwin.
	* libc/include/machine/setjmp.h: Change definition of _JBLEN to allow
	different values for 32 bit and 64 bit Cygwin.
	* libc/include/reent.h (stat64): Define as stat under Cygwin, instead
	of as __stat64.  Undef stat64 if not building Newlib.
	* libc/include/sys/stat.h (stat64): Define as stat under Cygwin.
2013-04-23 09:42:25 +00:00
Corinna Vinschen ca56076ae2 2010-06-29 Antony King <antony.king@sr.com>
* libc/ctype/ctype_.c (__ctype_ptr): Reinstate definition (guarded by
	_NEED_OLD_CTYPE_PTR_DEFINITION) for backwards compatibility with newlib
	1.16.0 and earlier.

2010-06-28  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>

	* libc/include/sys/stat.h: Add ACCESSPERMS, ALLPERMS, and DEFFILEMODE.
2010-07-01 08:45:52 +00:00
Corinna Vinschen c28545227a * libc/ctype/ctype_.c (_CTYPE_DATA_128_255): Rename from
_CTYPE_DATA_128_256.
	* libc/ctype/ctype_cp.h: Split off all character class values for
	character 255 from the rest of the definitions.
	(__ctype_cp): Use the new definitions.  Make sure that the table
	always contains 0 for EOF (-1).
	* libc/ctype/ctype_iso.h: Ditto.
2009-04-21 20:09:01 +00:00
Jeff Johnston 9c4032e768 2009-04-17 Jeff johnston <jjohnstn@redhat.com>
* configure.in: Remove _HAVE_ARRAY_ALIASING check.
        * configure: Regenerated.
        * newlib.hin: Remove _HAVE_ARRAY_ALIASING flag.
        * libc/ctype/ctype_.c: Do not check for _HAVE_ARRAY_ALIASING.
        * libm/configure.in: Change AC_TRY_COMPILE to AC_TRY_COMMAND to
        avoid executable test.
        * libm/configure: Regenerated.
2009-04-17 16:18:17 +00:00
Corinna Vinschen a29a769342 * libc/ctype/ctype_.c (_CTYPE_DATA_0_127): Remove _B flag from TAB.
* libc/ctype/ctype_cp.h: Mark non-cased letters in tables for codepages
	720, 862, 874, 1255, and 1256 to _U|_L.  Fix a couple of incorrect
	class mappings.
	* libc/ctype/ctype_iso.h: Mark non-cased letters in ISO-8859 tables
	6, 8, and 11 to _U|_L.  Fix a couple of incorrect class mappings.
	* libc/ctype/isblank.c (isblank): Special case TAB.
	* libc/ctype/islower.c (islower): Check explicitely for _L flag only
	in (_U|_L).
	* libc/ctype/isupper.c (isupper): Ditto, but check for _U flag.
	* libc/include/ctype.h (islower): Same in macro.
	(isupper): Ditto.
	(isblank): Special case TAB.  Redefine macro for GCC only.
2009-04-09 10:37:58 +00:00
Corinna Vinschen 72c79be10e * libc/ctype/ctype_c.c: Move inclusion of ctype_iso.h and
ctype_cp.h out of ALLOW_NEGATIVE_CTYPE_INDEX case.
	(__ctype_ptr__): Constify in !_MB_CAPABLE case.  Otherwise,
	de-constify in !ALLOW_NEGATIVE_CTYPE_INDEX case, too.  Add comment.
	(__set_ctype): Set __ctype_ptr__ pointer according to definition
	of ALLOW_NEGATIVE_CTYPE_INDEX.
	* libc/include/ctype.h (__ctype_ptr__): Constify in !_MB_CAPABLE case.
2009-04-02 07:53:12 +00:00
Corinna Vinschen 4bc42c05aa * libc/ctype/Makefile.am: Remove _tolower.c and _toupper.c
source files.  Add a dependency rule for ctype_o to note
	changes in ctype_iso.h and ctype_cp.h.
	* libc/ctype/Makefile.in: Regenerate.
	* libc/ctype/_tolower.c: Remove file.
	* libc/ctype/_toupper.c: Remove file.
	* libc/ctype/ctype_.c: Make sure ALLOW_NEGATIVE_CTYPE_INDEX
	is always defined on Cygwin.
	(_ctype_b): Don't make `static const' on Cygwin.
	(ctype_iso.h): Include if _MB_EXTENDED_CHARSETS_ISO is set.
	(ctype_cp.h): Include if _MB_EXTENDED_CHARSETS_WINDOWS is set.
	(__ctype_ptr): Drop definition.
	(__ctype_ptr__): De-constify.  Mark as __EXPORT symbol.
	(_ctype_): Add Cygwin-specifc asm define.
	(__set_ctype): New function to set __ctype_ptr__ according to
	current charset.
	* libc/ctype/ctype_cp.h: New file containing Windows codepage
	specific character class tables.
	* libc/ctype/ctype_iso.h: New file containing ISO-8859-x
	specific character class tables.
	* libc/ctype/tolower.c (tolower): Reimplement to support any singlebyte
	charset if one of the extended charsets is enabled.
	* libc/ctype/toupper.c (toupper): Ditto.
	* libc/include/ctype.h (_tolower): Define as macro per POSIX.
	(_toupper): Ditto.
	(__ctype_ptr__): De-constify.
	(toupper): Disable macro on systems supporting extended charsets.
	(tolower): Ditto.
	* libc/include/sys/config.h (__EXPORT): Define empty if not defined.
	* libc/locale/locale.c (__mb_cur_max): Mark as __EXPORT symbol.
	(__set_ctype): Declare unconditionally.
	(loadlocale): Remove __CYGWIN__ guard around __set_ctype call.
2009-03-31 09:31:38 +00:00
Corinna Vinschen 7ca98b4901 * libc/ctype/ctype_.c (_CTYPE_DATA_0_127): Mark TAB as blank character.
* libc/ctype/isblank.c: Replace hardcoded test with test for having _B
	marker in ctype array.
	* libc/include/ctype.h (isblank): Add macro.
2009-03-26 09:45:11 +00:00
Jeff Johnston fa914bf8ab 2008-07-21 Jeff Johnston <jjohnstn@redhat.com>
* libc/ctype/ctype_.c: Add new pointer __ctype_ptr__ which is one
        less than the old __ctype_ptr.
        * libc/ctype/isalnum.c: Use __ctype_ptr__.
        * libc/ctype/isalpha.c: Ditto.
        * libc/ctype/iscntrl.c: Ditto.
        * libc/ctype/isdigit.c: Ditto.
        * libc/ctype/islower.c: Ditto.
        * libc/ctype/isprint.c: Ditto.
        * libc/ctype/ispunct.c: Ditto.
        * libc/ctype/isspace.c: Ditto.
        * libc/ctype/isupper.c: Ditto.
        * libc/ctype/isxdigit.c: Ditto.
        * libc/include/ctype.h: Change ctype macros to use new __ctype_ptr__
        and add declaration of __ctype_ptr__.  Remove older ctype table pointers
        from here even though they can still work.
2008-07-21 21:28:34 +00:00
Jeff Johnston dd801fdabd 2005-03-17 Jeff Johnston <jjohnstn@redhat.com>
* configure.in: Add new check to see if compiler supports
        aliasing of arrays and define _HAVE_ARRAY_ALIASING if true.
        * configure: Regenerated.
        * Makefile.in: Ditto.
        * newlib.hin: Add _HAVE_ARRAY_ALIASING.
        * libc/ctype/ctype_.c: Check for _HAVE_ARRAY_ALIASING before
        aliasing the _ctype_ array to _ctype_b.
        * libc/include/ctype.h: Change macros to use __ctype_ptr.  Mark
        _ctype_ as deprecated.
2005-03-17 20:11:23 +00:00
Corinna Vinschen 8a4b4764b8 * libc/ctype/ctype_.c: Remove checks for deprecated __CYGWIN32__.
* libc/include/stdio.h: Ditto.
	* libc/include/sys/config.h: Ditto.
	* libc/stdio/mktemp.c: Ditto.
2003-05-13 09:46:48 +00:00
Jeff Johnston 371b76ef3e 2001-06-11 Egor Duda <deo@logos-m.ru>
* libc/ctype/ctype_.c: When compiled with gcc on platforms
        with signed char, make _ctype_[-128] ... _ctype[-1] refer to
        initialized memory region. Platform can define COMPACT_CTYPE
        to avoid allocation of the additional 128 bytes of data.
        Add pointer to _ctype_ array. Always initialize all _ctype_
        array elements.
2001-06-11 19:25:59 +00:00
Christopher Faylor 8a0efa53e4 import newlib-2000-02-17 snapshot 2000-02-17 19:39:52 +00:00