Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/locale')
-rw-r--r--newlib/libc/locale/Makefile.am56
-rw-r--r--newlib/libc/locale/Makefile.in398
-rw-r--r--newlib/libc/locale/fix_grouping.c82
-rw-r--r--newlib/libc/locale/ldpart.c187
-rw-r--r--newlib/libc/locale/ldpart.h35
-rw-r--r--newlib/libc/locale/lmessages.c89
-rw-r--r--newlib/libc/locale/lmessages.h42
-rw-r--r--newlib/libc/locale/lmonetary.c143
-rw-r--r--newlib/libc/locale/lmonetary.h53
-rw-r--r--newlib/libc/locale/lnumeric.c85
-rw-r--r--newlib/libc/locale/lnumeric.h41
-rw-r--r--newlib/libc/locale/locale.c300
-rw-r--r--newlib/libc/locale/locale.tex123
-rw-r--r--newlib/libc/locale/nl_langinfo.390
-rw-r--r--newlib/libc/locale/nl_langinfo.c214
-rw-r--r--newlib/libc/locale/setlocale.h37
-rw-r--r--newlib/libc/locale/timelocal.c119
-rw-r--r--newlib/libc/locale/timelocal.h55
18 files changed, 0 insertions, 2149 deletions
diff --git a/newlib/libc/locale/Makefile.am b/newlib/libc/locale/Makefile.am
deleted file mode 100644
index bffe9be9b..000000000
--- a/newlib/libc/locale/Makefile.am
+++ /dev/null
@@ -1,56 +0,0 @@
-## Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus
-
-INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-
-GENERAL_SOURCES = timelocal.h ldpart.h locale.c lnumeric.h lmonetary.h lmessages.h
-
-## The following interfaces are EL/IX level 2
-if ELIX_LEVEL_1
-LIB_OBJS =
-else
-LIB_OBJS = \
- fix_grouping.$(oext) \
- ldpart.$(oext) \
- lmessages.$(oext) \
- lnumeric.$(oext) \
- lmonetary.$(oext) \
- nl_langinfo.$(oext) \
- timelocal.$(oext)
-endif
-
-liblocale_la_LDFLAGS = -Xcompiler -nostdlib
-
-if USE_LIBTOOL
-noinst_LTLIBRARIES = liblocale.la
-liblocale_la_SOURCES = $(GENERAL_SOURCES)
-liblocale_la_LIBADD = $(LIB_OBJS)
-liblocale_la_DEPENDENCIES = $(LIB_OBJS)
-noinst_DATA = objectlist.awk.in
-else
-noinst_LIBRARIES = lib.a
-lib_a_SOURCES = $(GENERAL_SOURCES)
-lib_a_LIBADD = $(LIB_OBJS)
-lib_a_DEPENDENCIES = $(LIB_OBJS)
-noinst_DATA =
-endif # USE_LIBTOOL
-
-include $(srcdir)/../../Makefile.shared
-
-CHEWOUT_FILES = locale.def
-
-SUFFIXES = .def
-
-CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str
-
-.c.def:
- $(CHEW) < $< > $*.def 2> $*.ref
- touch stmp-def
-
-TARGETDOC = ../tmp.texi
-
-doc: $(CHEWOUT_FILES)
- cat $(srcdir)/locale.tex >> $(TARGETDOC)
-
-CLEANFILES = $(CHEWOUT_FILES) *.ref
diff --git a/newlib/libc/locale/Makefile.in b/newlib/libc/locale/Makefile.in
deleted file mode 100644
index 8d6d0f61d..000000000
--- a/newlib/libc/locale/Makefile.in
+++ /dev/null
@@ -1,398 +0,0 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
-
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-
-SHELL = @SHELL@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_alias = @build_alias@
-build_triplet = @build@
-host_alias = @host_alias@
-host_triplet = @host@
-target_alias = @target_alias@
-target_triplet = @target@
-AR = @AR@
-AS = @AS@
-CC = @CC@
-CPP = @CPP@
-CRT0 = @CRT0@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-DLLTOOL = @DLLTOOL@
-EXEEXT = @EXEEXT@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBC_EXTRA_DEF = @LIBC_EXTRA_DEF@
-LIBC_EXTRA_LIB = @LIBC_EXTRA_LIB@
-LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@
-LIBC_POSIX_LIB = @LIBC_POSIX_LIB@
-LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@
-LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@
-LIBC_STDIO64_DEF = @LIBC_STDIO64_DEF@
-LIBC_STDIO64_LIB = @LIBC_STDIO64_LIB@
-LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@
-LIBC_SYS_LIB = @LIBC_SYS_LIB@
-LIBC_UNIX_LIB = @LIBC_UNIX_LIB@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-RANLIB = @RANLIB@
-STRIP = @STRIP@
-VERSION = @VERSION@
-aext = @aext@
-extra_dir = @extra_dir@
-libm_machine_dir = @libm_machine_dir@
-machine_dir = @machine_dir@
-newlib_basedir = @newlib_basedir@
-oext = @oext@
-sys_dir = @sys_dir@
-
-AUTOMAKE_OPTIONS = cygnus
-
-INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-
-GENERAL_SOURCES = timelocal.h ldpart.h locale.c lnumeric.h lmonetary.h lmessages.h
-@ELIX_LEVEL_1_TRUE@LIB_OBJS =
-@ELIX_LEVEL_1_FALSE@LIB_OBJS = @ELIX_LEVEL_1_FALSE@\
-@ELIX_LEVEL_1_FALSE@ fix_grouping.$(oext) \
-@ELIX_LEVEL_1_FALSE@ ldpart.$(oext) \
-@ELIX_LEVEL_1_FALSE@ lmessages.$(oext) \
-@ELIX_LEVEL_1_FALSE@ lnumeric.$(oext) \
-@ELIX_LEVEL_1_FALSE@ lmonetary.$(oext) \
-@ELIX_LEVEL_1_FALSE@ nl_langinfo.$(oext) \
-@ELIX_LEVEL_1_FALSE@ timelocal.$(oext)
-
-liblocale_la_LDFLAGS = -Xcompiler -nostdlib
-
-@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = @USE_LIBTOOL_TRUE@liblocale.la
-@USE_LIBTOOL_TRUE@liblocale_la_SOURCES = @USE_LIBTOOL_TRUE@$(GENERAL_SOURCES)
-@USE_LIBTOOL_TRUE@liblocale_la_LIBADD = @USE_LIBTOOL_TRUE@$(LIB_OBJS)
-@USE_LIBTOOL_TRUE@liblocale_la_DEPENDENCIES = @USE_LIBTOOL_TRUE@$(LIB_OBJS)
-@USE_LIBTOOL_TRUE@noinst_DATA = @USE_LIBTOOL_TRUE@objectlist.awk.in
-@USE_LIBTOOL_FALSE@noinst_DATA =
-@USE_LIBTOOL_FALSE@noinst_LIBRARIES = @USE_LIBTOOL_FALSE@lib.a
-@USE_LIBTOOL_FALSE@lib_a_SOURCES = @USE_LIBTOOL_FALSE@$(GENERAL_SOURCES)
-@USE_LIBTOOL_FALSE@lib_a_LIBADD = @USE_LIBTOOL_FALSE@$(LIB_OBJS)
-@USE_LIBTOOL_FALSE@lib_a_DEPENDENCIES = @USE_LIBTOOL_FALSE@$(LIB_OBJS)
-
-CHEWOUT_FILES = locale.def
-
-SUFFIXES = .def
-
-CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str
-
-TARGETDOC = ../tmp.texi
-
-CLEANFILES = $(CHEWOUT_FILES) *.ref
-mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
-CONFIG_CLEAN_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir)
-CPPFLAGS = @CPPFLAGS@
-LIBS = @LIBS@
-@USE_LIBTOOL_FALSE@lib_a_OBJECTS = locale.$(OBJEXT)
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-
-@USE_LIBTOOL_TRUE@liblocale_la_OBJECTS = locale.lo
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-DATA = $(noinst_DATA)
-
-DIST_COMMON = Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = gtar
-GZIP_ENV = --best
-SOURCES = $(lib_a_SOURCES) $(liblocale_la_SOURCES)
-OBJECTS = $(lib_a_OBJECTS) $(liblocale_la_OBJECTS)
-
-all: all-redirect
-.SUFFIXES:
-.SUFFIXES: .S .c .def .lo .o .obj .s
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(srcdir)/../../Makefile.shared
- cd $(top_srcdir) && $(AUTOMAKE) --cygnus locale/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-mostlyclean-noinstLIBRARIES:
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-
-distclean-noinstLIBRARIES:
-
-maintainer-clean-noinstLIBRARIES:
-
-.c.o:
- $(COMPILE) -c $<
-
-# FIXME: We should only use cygpath when building on Windows,
-# and only if it is available.
-.c.obj:
- $(COMPILE) -c `cygpath -w $<`
-
-.s.o:
- $(COMPILE) -c $<
-
-.S.o:
- $(COMPILE) -c $<
-
-mostlyclean-compile:
- -rm -f *.o core *.core
- -rm -f *.$(OBJEXT)
-
-clean-compile:
-
-distclean-compile:
- -rm -f *.tab.c
-
-maintainer-clean-compile:
-
-.c.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
-
-.s.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
-
-.S.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
-
-maintainer-clean-libtool:
-
-lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES)
- -rm -f lib.a
- $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
- $(RANLIB) lib.a
-
-mostlyclean-noinstLTLIBRARIES:
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-
-distclean-noinstLTLIBRARIES:
-
-maintainer-clean-noinstLTLIBRARIES:
-
-liblocale.la: $(liblocale_la_OBJECTS) $(liblocale_la_DEPENDENCIES)
- $(LINK) $(liblocale_la_LDFLAGS) $(liblocale_la_OBJECTS) $(liblocale_la_LIBADD) $(LIBS)
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = locale
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
- else \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
- fi; \
- done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
-check-am:
-check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
-install-exec-am:
-install-exec: install-exec-am
-
-install-data-am:
-install-data: install-data-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am:
-uninstall: uninstall-am
-all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA)
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
-
-
-mostlyclean-generic:
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
-
-maintainer-clean-generic:
-mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
- mostlyclean-libtool mostlyclean-noinstLTLIBRARIES \
- mostlyclean-tags mostlyclean-generic
-
-mostlyclean: mostlyclean-am
-
-clean-am: clean-noinstLIBRARIES clean-compile clean-libtool \
- clean-noinstLTLIBRARIES clean-tags clean-generic \
- mostlyclean-am
-
-clean: clean-am
-
-distclean-am: distclean-noinstLIBRARIES distclean-compile \
- distclean-libtool distclean-noinstLTLIBRARIES \
- distclean-tags distclean-generic clean-am
- -rm -f libtool
-
-distclean: distclean-am
-
-maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
- maintainer-clean-compile maintainer-clean-libtool \
- maintainer-clean-noinstLTLIBRARIES \
- maintainer-clean-tags maintainer-clean-generic \
- distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
-
-maintainer-clean: maintainer-clean-am
-
-.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
-clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile mostlyclean-libtool distclean-libtool \
-clean-libtool maintainer-clean-libtool mostlyclean-noinstLTLIBRARIES \
-distclean-noinstLTLIBRARIES clean-noinstLTLIBRARIES \
-maintainer-clean-noinstLTLIBRARIES tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
-check-am installcheck-am installcheck install-info-am install-info \
-install-exec-am install-exec install-data-am install-data install-am \
-install uninstall-am uninstall all-redirect all-am all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-objectlist.awk.in: $(noinst_LTLIBRARIES)
- -rm -f objectlist.awk.in
- for i in `ls *.lo` ; \
- do \
- echo $$i `pwd`/$$i >> objectlist.awk.in ; \
- done
-
-.c.def:
- $(CHEW) < $< > $*.def 2> $*.ref
- touch stmp-def
-
-doc: $(CHEWOUT_FILES)
- cat $(srcdir)/locale.tex >> $(TARGETDOC)
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/newlib/libc/locale/fix_grouping.c b/newlib/libc/locale/fix_grouping.c
deleted file mode 100644
index c44fc331e..000000000
--- a/newlib/libc/locale/fix_grouping.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-#include <ctype.h>
-#include <limits.h>
-#include <stddef.h>
-
-static const char nogrouping[] = { CHAR_MAX, '\0' };
-
-/*
- * "3;3;-1" -> "\003\003\177"
- */
-
-const char *
-__fix_locale_grouping_str(const char *str) {
-
- char *src, *dst;
- char n;
-
- if (str == NULL || *str == '\0') {
- return nogrouping;
- }
-
- for (src = (char*)str, dst = (char*)str; *src != '\0'; src++) {
-
- /* input string examples: "3;3", "3;2;-1" */
- if (*src == ';')
- continue;
-
- if (*src == '-' && *(src+1) == '1') {
- *dst++ = CHAR_MAX;
- src++;
- continue;
- }
-
- if (!isdigit((unsigned char)*src)) {
- /* broken grouping string */
- return nogrouping;
- }
-
- /* assume all numbers <= 99 */
- n = *src - '0';
- if (isdigit((unsigned char)*(src+1))) {
- src++;
- n *= 10;
- n += *src - '0';
- }
-
- *dst = n;
- /* NOTE: assume all input started with "0" as 'no grouping' */
- if (*dst == '\0')
- return (dst == (char*)str) ? nogrouping : str;
- dst++;
- }
- *dst = '\0';
- return str;
-}
diff --git a/newlib/libc/locale/ldpart.c b/newlib/libc/locale/ldpart.c
deleted file mode 100644
index a284b9db2..000000000
--- a/newlib/libc/locale/ldpart.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/syslimits.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "setlocale.h"
-#include "ldpart.h"
-
-static int split_lines(char *, const char *);
-static void set_from_buf(const char *, int, const char **);
-
-int
-__part_load_locale(const char *name,
- int *using_locale,
- char *locale_buf,
- const char *category_filename,
- int locale_buf_size_max,
- int locale_buf_size_min,
- const char **dst_localebuf) {
-
- static char locale_buf_C[] = "C";
- static int num_lines;
-
- int fd;
- char *lbuf;
- char *p;
- const char *plim;
- char filename[PATH_MAX];
- struct stat st;
- size_t namesize;
- size_t bufsize;
- int save_using_locale;
- char *nptr;
-
- save_using_locale = *using_locale;
- *using_locale = 0;
-
- if (name == NULL)
- goto no_locale;
-
- if (!strcmp(name, "C") || !strcmp(name, "POSIX"))
- return 0;
-
- /*
- * If the locale name is the same as our cache, use the cache.
- */
- lbuf = locale_buf;
- if (lbuf != NULL && strcmp(name, lbuf) == 0) {
- set_from_buf(lbuf, num_lines, dst_localebuf);
- *using_locale = 1;
- return 0;
- }
-
- /*
- * Slurp the locale file into the cache.
- */
- namesize = strlen(name) + 1;
-
- if (!_PathLocale)
- goto no_locale;
- /* Range checking not needed, 'name' size is limited */
- strcpy(filename, _PathLocale);
- strcat(filename, "/");
- strcat(filename, name);
- strcat(filename, "/");
- strcat(filename, category_filename);
- fd = open(filename, O_RDONLY);
- if (fd < 0)
- goto no_locale;
-#ifdef __USE_INTERNAL_STAT64
- if (fstat64(fd, &st) != 0)
-#else
- if (fstat(fd, &st) != 0)
-#endif
- goto bad_locale;
- if (st.st_size <= 0)
- goto bad_locale;
- bufsize = namesize + st.st_size;
- locale_buf = NULL;
-
- if (lbuf == NULL || lbuf == locale_buf_C)
- {
- lbuf = malloc(bufsize);
- }
- else
- {
- nptr = realloc(lbuf, bufsize);
- if (!nptr && lbuf)
- free (lbuf);
- lbuf = nptr;
- }
-
- if (lbuf == NULL)
- goto bad_locale;
- (void) strcpy(lbuf, name);
- p = lbuf + namesize;
- plim = p + st.st_size;
- if (read(fd, p, (size_t) st.st_size) != st.st_size)
- goto bad_lbuf;
- if (close(fd) != 0)
- goto bad_lbuf;
- /*
- * Parse the locale file into localebuf.
- */
- if (plim[-1] != '\n')
- goto bad_lbuf;
- num_lines = split_lines(p, plim);
- if (num_lines >= locale_buf_size_max)
- num_lines = locale_buf_size_max;
- else if (num_lines >= locale_buf_size_min)
- num_lines = locale_buf_size_min;
- else
- goto reset_locale;
- set_from_buf(lbuf, num_lines, dst_localebuf);
- /*
- * Record the successful parse in the cache.
- */
- locale_buf = lbuf;
-
- *using_locale = 1;
- return 0;
-
-reset_locale:
- locale_buf = locale_buf_C;
- save_using_locale = 0;
-bad_lbuf:
- free(lbuf);
-bad_locale:
- (void)close(fd);
-no_locale:
- *using_locale = save_using_locale;
- return -1;
-}
-
-static int
-split_lines(char *p, const char *plim) {
-
- int i;
-
- for (i = 0; p < plim; i++) {
- p = strchr(p, '\n');
- *p++ = '\0';
- }
- return i;
-}
-
-static void
-set_from_buf(const char *p, int num_lines, const char **dst_localebuf) {
-
- const char **ap;
- int i;
-
- for (ap = dst_localebuf, i = 0; i < num_lines; ++ap, ++i)
- *ap = p += strlen(p) + 1;
-}
-
diff --git a/newlib/libc/locale/ldpart.h b/newlib/libc/locale/ldpart.h
deleted file mode 100644
index 86031fd33..000000000
--- a/newlib/libc/locale/ldpart.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/locale/ldpart.h,v 1.4 2001/12/20 18:28:52 phantom Exp $
- */
-
-#ifndef _LDPART_H_
-#define _LDPART_H_
-
-int __part_load_locale(const char *, int*, char *, const char *,
- int, int, const char **);
-
-#endif /* !_LDPART_H_ */
diff --git a/newlib/libc/locale/lmessages.c b/newlib/libc/locale/lmessages.c
deleted file mode 100644
index 9a4bb799a..000000000
--- a/newlib/libc/locale/lmessages.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-#include <stddef.h>
-
-#include "lmessages.h"
-#include "ldpart.h"
-
-#define LCMESSAGES_SIZE_FULL (sizeof(struct lc_messages_T) / sizeof(char *))
-#define LCMESSAGES_SIZE_MIN \
- (offsetof(struct lc_messages_T, yesstr) / sizeof(char *))
-
-static char empty[] = "";
-
-static const struct lc_messages_T _C_messages_locale = {
- "^[yY]" , /* yesexpr */
- "^[nN]" , /* noexpr */
- "yes" , /* yesstr */
- "no" /* nostr */
-};
-
-static struct lc_messages_T _messages_locale;
-static int _messages_using_locale;
-static char *_messages_locale_buf;
-
-int
-__messages_load_locale(const char *name) {
-
- /*
- * Propose that we can have incomplete locale file (w/o "{yes,no}str").
- * Initialize them before loading. In case of complete locale, they'll
- * be initialized to loaded value, otherwise they'll not be touched.
- */
- _messages_locale.yesstr = empty;
- _messages_locale.nostr = empty;
-
- return __part_load_locale(name, &_messages_using_locale,
- _messages_locale_buf, "LC_MESSAGES",
- LCMESSAGES_SIZE_FULL, LCMESSAGES_SIZE_MIN,
- (const char **)&_messages_locale);
-}
-
-struct lc_messages_T *
-__get_current_messages_locale(void) {
-
- return (_messages_using_locale
- ? &_messages_locale
- : (struct lc_messages_T *)&_C_messages_locale);
-}
-
-#ifdef LOCALE_DEBUG
-void
-msgdebug() {
-printf( "yesexpr = %s\n"
- "noexpr = %s\n"
- "yesstr = %s\n"
- "nostr = %s\n",
- _messages_locale.yesexpr,
- _messages_locale.noexpr,
- _messages_locale.yesstr,
- _messages_locale.nostr
-);
-}
-#endif /* LOCALE_DEBUG */
diff --git a/newlib/libc/locale/lmessages.h b/newlib/libc/locale/lmessages.h
deleted file mode 100644
index ee690ae7c..000000000
--- a/newlib/libc/locale/lmessages.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/locale/lmessages.h,v 1.3 2001/12/20 18:28:52 phantom Exp $
- */
-
-#ifndef _LMESSAGES_H_
-#define _LMESSAGES_H_
-
-struct lc_messages_T {
- const char *yesexpr;
- const char *noexpr;
- const char *yesstr;
- const char *nostr;
-};
-
-struct lc_messages_T *__get_current_messages_locale(void);
-int __messages_load_locale(const char *);
-
-#endif /* !_LMESSAGES_H_ */
diff --git a/newlib/libc/locale/lmonetary.c b/newlib/libc/locale/lmonetary.c
deleted file mode 100644
index d31e88ccd..000000000
--- a/newlib/libc/locale/lmonetary.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include "lmonetary.h"
-#include "ldpart.h"
-
-extern int __mlocale_changed;
-extern const char * __fix_locale_grouping_str(const char *);
-
-#define LCMONETARY_SIZE (sizeof(struct lc_monetary_T) / sizeof(char *))
-
-static char empty[] = "";
-static char numempty[] = { CHAR_MAX, '\0'};
-
-static const struct lc_monetary_T _C_monetary_locale = {
- empty, /* int_curr_symbol */
- empty, /* currency_symbol */
- empty, /* mon_decimal_point */
- empty, /* mon_thousands_sep */
- numempty, /* mon_grouping */
- empty, /* positive_sign */
- empty, /* negative_sign */
- numempty, /* int_frac_digits */
- numempty, /* frac_digits */
- numempty, /* p_cs_precedes */
- numempty, /* p_sep_by_space */
- numempty, /* n_cs_precedes */
- numempty, /* n_sep_by_space */
- numempty, /* p_sign_posn */
- numempty /* n_sign_posn */
-};
-
-static struct lc_monetary_T _monetary_locale;
-static int _monetary_using_locale;
-static char *_monetary_locale_buf;
-
-static char
-cnv(const char *str) {
- int i = strtol(str, NULL, 10);
- if (i == -1)
- i = CHAR_MAX;
- return (char)i;
-}
-
-int
-__monetary_load_locale(const char *name) {
-
- int ret;
- __mlocale_changed = 1;
- ret = __part_load_locale(name, &_monetary_using_locale,
- _monetary_locale_buf, "LC_MONETARY",
- LCMONETARY_SIZE, LCMONETARY_SIZE,
- (const char **)&_monetary_locale);
- if (ret == 0 && _monetary_using_locale) {
- _monetary_locale.mon_grouping =
- __fix_locale_grouping_str(_monetary_locale.mon_grouping);
-
-#define M_ASSIGN_CHAR(NAME) (((char *)_monetary_locale.NAME)[0] = \
- cnv(_monetary_locale.NAME))
-
- M_ASSIGN_CHAR(int_frac_digits);
- M_ASSIGN_CHAR(frac_digits);
- M_ASSIGN_CHAR(p_cs_precedes);
- M_ASSIGN_CHAR(p_sep_by_space);
- M_ASSIGN_CHAR(n_cs_precedes);
- M_ASSIGN_CHAR(n_sep_by_space);
- M_ASSIGN_CHAR(p_sign_posn);
- M_ASSIGN_CHAR(n_sign_posn);
- }
- return ret;
-}
-
-struct lc_monetary_T *
-__get_current_monetary_locale(void) {
-
- return (_monetary_using_locale
- ? &_monetary_locale
- : (struct lc_monetary_T *)&_C_monetary_locale);
-}
-
-#ifdef LOCALE_DEBUG
-void
-monetdebug() {
-printf( "int_curr_symbol = %s\n"
- "currency_symbol = %s\n"
- "mon_decimal_point = %s\n"
- "mon_thousands_sep = %s\n"
- "mon_grouping = %s\n"
- "positive_sign = %s\n"
- "negative_sign = %s\n"
- "int_frac_digits = %d\n"
- "frac_digits = %d\n"
- "p_cs_precedes = %d\n"
- "p_sep_by_space = %d\n"
- "n_cs_precedes = %d\n"
- "n_sep_by_space = %d\n"
- "p_sign_posn = %d\n"
- "n_sign_posn = %d\n",
- _monetary_locale.int_curr_symbol,
- _monetary_locale.currency_symbol,
- _monetary_locale.mon_decimal_point,
- _monetary_locale.mon_thousands_sep,
- _monetary_locale.mon_grouping,
- _monetary_locale.positive_sign,
- _monetary_locale.negative_sign,
- _monetary_locale.int_frac_digits[0],
- _monetary_locale.frac_digits[0],
- _monetary_locale.p_cs_precedes[0],
- _monetary_locale.p_sep_by_space[0],
- _monetary_locale.n_cs_precedes[0],
- _monetary_locale.n_sep_by_space[0],
- _monetary_locale.p_sign_posn[0],
- _monetary_locale.n_sign_posn[0]
-);
-}
-#endif /* LOCALE_DEBUG */
diff --git a/newlib/libc/locale/lmonetary.h b/newlib/libc/locale/lmonetary.h
deleted file mode 100644
index bbe77db42..000000000
--- a/newlib/libc/locale/lmonetary.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/locale/lmonetary.h,v 1.3 2001/12/20 18:28:52 phantom Exp $
- */
-
-#ifndef _LMONETARY_H_
-#define _LMONETARY_H_
-
-struct lc_monetary_T {
- const char *int_curr_symbol;
- const char *currency_symbol;
- const char *mon_decimal_point;
- const char *mon_thousands_sep;
- const char *mon_grouping;
- const char *positive_sign;
- const char *negative_sign;
- const char *int_frac_digits;
- const char *frac_digits;
- const char *p_cs_precedes;
- const char *p_sep_by_space;
- const char *n_cs_precedes;
- const char *n_sep_by_space;
- const char *p_sign_posn;
- const char *n_sign_posn;
-};
-
-struct lc_monetary_T *__get_current_monetary_locale(void);
-int __monetary_load_locale(const char *);
-
-#endif /* !_LMONETARY_H_ */
diff --git a/newlib/libc/locale/lnumeric.c b/newlib/libc/locale/lnumeric.c
deleted file mode 100644
index 90b404ca2..000000000
--- a/newlib/libc/locale/lnumeric.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-#include <limits.h>
-#include "lnumeric.h"
-#include "ldpart.h"
-
-extern int __nlocale_changed;
-extern const char *__fix_locale_grouping_str(const char *);
-
-#define LCNUMERIC_SIZE (sizeof(struct lc_numeric_T) / sizeof(char *))
-
-static char numempty[] = { CHAR_MAX, '\0' };
-
-static const struct lc_numeric_T _C_numeric_locale = {
- ".", /* decimal_point */
- "", /* thousands_sep */
- numempty /* grouping */
-};
-
-static struct lc_numeric_T _numeric_locale;
-static int _numeric_using_locale;
-static char *_numeric_locale_buf;
-
-int
-__numeric_load_locale(const char *name) {
-
- int ret;
-
- __nlocale_changed = 1;
- ret = __part_load_locale(name, &_numeric_using_locale,
- _numeric_locale_buf, "LC_NUMERIC",
- LCNUMERIC_SIZE, LCNUMERIC_SIZE,
- (const char **)&_numeric_locale);
- if (ret == 0 && _numeric_using_locale)
- _numeric_locale.grouping =
- __fix_locale_grouping_str(_numeric_locale.grouping);
- return ret;
-}
-
-struct lc_numeric_T *
-__get_current_numeric_locale(void) {
-
- return (_numeric_using_locale
- ? &_numeric_locale
- : (struct lc_numeric_T *)&_C_numeric_locale);
-}
-
-#ifdef LOCALE_DEBUG
-void
-numericdebug(void) {
-printf( "decimal_point = %s\n"
- "thousands_sep = %s\n"
- "grouping = %s\n",
- _numeric_locale.decimal_point,
- _numeric_locale.thousands_sep,
- _numeric_locale.grouping
-);
-}
-#endif /* LOCALE_DEBUG */
diff --git a/newlib/libc/locale/lnumeric.h b/newlib/libc/locale/lnumeric.h
deleted file mode 100644
index 9678c1f02..000000000
--- a/newlib/libc/locale/lnumeric.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/locale/lnumeric.h,v 1.3 2001/12/20 18:28:52 phantom Exp $
- */
-
-#ifndef _LNUMERIC_H_
-#define _LNUMERIC_H_
-
-struct lc_numeric_T {
- const char *decimal_point;
- const char *thousands_sep;
- const char *grouping;
-};
-
-struct lc_numeric_T *__get_current_numeric_locale(void);
-int __numeric_load_locale(const char *);
-
-#endif /* !_LNUMERIC_H_ */
diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c
deleted file mode 100644
index 66c93d740..000000000
--- a/newlib/libc/locale/locale.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
-FUNCTION
-<<setlocale>>, <<localeconv>>---select or query locale
-
-INDEX
- setlocale
-INDEX
- localeconv
-INDEX
- _setlocale_r
-INDEX
- _localeconv_r
-
-ANSI_SYNOPSIS
- #include <locale.h>
- char *setlocale(int <[category]>, const char *<[locale]>);
- lconv *localeconv(void);
-
- char *_setlocale_r(void *<[reent]>,
- int <[category]>, const char *<[locale]>);
- lconv *_localeconv_r(void *<[reent]>);
-
-TRAD_SYNOPSIS
- #include <locale.h>
- char *setlocale(<[category]>, <[locale]>)
- int <[category]>;
- char *<[locale]>;
-
- lconv *localeconv();
-
- char *_setlocale_r(<[reent]>, <[category]>, <[locale]>)
- char *<[reent]>;
- int <[category]>;
- char *<[locale]>;
-
- lconv *_localeconv_r(<[reent]>);
- char *<[reent]>;
-
-DESCRIPTION
-<<setlocale>> is the facility defined by ANSI C to condition the
-execution environment for international collating and formatting
-information; <<localeconv>> reports on the settings of the current
-locale.
-
-This is a minimal implementation, supporting only the required <<"C">>
-value for <[locale]>; strings representing other locales are not
-honored unless MB_CAPABLE is defined in which case three new
-extensions are allowed for LC_CTYPE or LC_MESSAGES only: <<"C-JIS">>,
-<<"C-EUCJP">>, <<"C-SJIS">>, or <<"C-ISO-8859-1">>. (<<"">> is
-also accepted; it represents the default locale
-for an implementation, here equivalent to <<"C">>.)
-
-If you use <<NULL>> as the <[locale]> argument, <<setlocale>> returns
-a pointer to the string representing the current locale (always
-<<"C">> in this implementation). The acceptable values for
-<[category]> are defined in `<<locale.h>>' as macros beginning with
-<<"LC_">>, but this implementation does not check the values you pass
-in the <[category]> argument.
-
-<<localeconv>> returns a pointer to a structure (also defined in
-`<<locale.h>>') describing the locale-specific conventions currently
-in effect.
-
-<<_localeconv_r>> and <<_setlocale_r>> are reentrant versions of
-<<localeconv>> and <<setlocale>> respectively. The extra argument
-<[reent]> is a pointer to a reentrancy structure.
-
-RETURNS
-<<setlocale>> returns either a pointer to a string naming the locale
-currently in effect (always <<"C">> for this implementation, or, if
-the locale request cannot be honored, <<NULL>>.
-
-<<localeconv>> returns a pointer to a structure of type <<lconv>>,
-which describes the formatting and collating conventions in effect (in
-this implementation, always those of the C locale).
-
-PORTABILITY
-ANSI C requires <<setlocale>>, but the only locale required across all
-implementations is the C locale.
-
-No supporting OS subroutines are required.
-*/
-
-/*
- * setlocale, localeconv : internationalize your locale.
- * (Only "C" or null supported).
- */
-
-#include <locale.h>
-#include <string.h>
-#include <limits.h>
-#include <reent.h>
-
-#ifdef __CYGWIN__
-int __declspec(dllexport) __mb_cur_max = 1;
-#else
-int __mb_cur_max = 1;
-#endif
-
-int __nlocale_changed = 0;
-int __mlocale_changed = 0;
-char *_PathLocale = NULL;
-
-static _CONST struct lconv lconv =
-{
- ".", "", "", "", "", "", "", "", "", "",
- CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX,
- CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX,
-};
-
-
-char * _EXFUN(__locale_charset,(_VOID));
-
-static char *charset = "ISO-8859-1";
-char __lc_ctype[12] = "C";
-
-char *
-_DEFUN(_setlocale_r, (p, category, locale),
- struct _reent *p _AND
- int category _AND
- _CONST char *locale)
-{
-#ifndef MB_CAPABLE
- if (locale)
- {
- if (strcmp (locale, "C") && strcmp (locale, ""))
- return 0;
- p->_current_category = category;
- p->_current_locale = locale;
- }
- return "C";
-#else
- static char last_lc_ctype[12] = "C";
- static char lc_messages[12] = "C";
- static char last_lc_messages[12] = "C";
-
- if (locale)
- {
- char *locale_name = (char *)locale;
- if (category != LC_CTYPE && category != LC_MESSAGES)
- {
- if (strcmp (locale, "C") && strcmp (locale, ""))
- return 0;
- if (category == LC_ALL)
- {
- strcpy (last_lc_ctype, __lc_ctype);
- strcpy (__lc_ctype, "C");
- strcpy (last_lc_messages, lc_messages);
- strcpy (lc_messages, "C");
- __mb_cur_max = 1;
- }
- }
- else
- {
- if (locale[0] == 'C' && locale[1] == '-')
- {
- switch (locale[2])
- {
- case 'U':
- if (strcmp (locale, "C-UTF-8"))
- return 0;
- break;
- case 'J':
- if (strcmp (locale, "C-JIS"))
- return 0;
- break;
- case 'E':
- if (strcmp (locale, "C-EUCJP"))
- return 0;
- break;
- case 'S':
- if (strcmp (locale, "C-SJIS"))
- return 0;
- break;
- case 'I':
- if (strcmp (locale, "C-ISO-8859-1"))
- return 0;
- break;
- default:
- return 0;
- }
- }
- else
- {
- if (strcmp (locale, "C") && strcmp (locale, ""))
- return 0;
- locale_name = "C"; /* C is always the default locale */
- }
-
- if (category == LC_CTYPE)
- {
- strcpy (last_lc_ctype, __lc_ctype);
- strcpy (__lc_ctype, locale_name);
-
- __mb_cur_max = 1;
- if (locale[1] == '-')
- {
- switch (locale[2])
- {
- case 'U':
- __mb_cur_max = 6;
- break;
- case 'J':
- __mb_cur_max = 8;
- break;
- case 'E':
- __mb_cur_max = 2;
- break;
- case 'S':
- __mb_cur_max = 2;
- break;
- case 'I':
- default:
- __mb_cur_max = 1;
- }
- }
- }
- else
- {
- strcpy (last_lc_messages, lc_messages);
- strcpy (lc_messages, locale_name);
-
- charset = "ISO-8859-1";
- if (locale[1] == '-')
- {
- switch (locale[2])
- {
- case 'U':
- charset = "UTF-8";
- break;
- case 'J':
- charset = "JIS";
- break;
- case 'E':
- charset = "EUCJP";
- break;
- case 'S':
- charset = "SJIS";
- break;
- case 'I':
- charset = "ISO-8859-1";
- break;
- default:
- return 0;
- }
- }
- }
- }
- p->_current_category = category;
- p->_current_locale = locale;
-
- if (category == LC_CTYPE)
- return last_lc_ctype;
- else if (category == LC_MESSAGES)
- return last_lc_messages;
- }
- else
- {
- if (category == LC_CTYPE)
- return __lc_ctype;
- else if (category == LC_MESSAGES)
- return lc_messages;
- }
-
- return "C";
-#endif
-
-}
-
-char *
-_DEFUN_VOID(__locale_charset)
-{
- return charset;
-}
-
-struct lconv *
-_DEFUN(_localeconv_r, (data),
- struct _reent *data)
-{
- return (struct lconv *) &lconv;
-}
-
-#ifndef _REENT_ONLY
-
-char *
-_DEFUN(setlocale, (category, locale),
- int category _AND
- _CONST char *locale)
-{
- return _setlocale_r (_REENT, category, locale);
-}
-
-
-struct lconv *
-_DEFUN_VOID(localeconv)
-{
- return _localeconv_r (_REENT);
-}
-
-#endif
diff --git a/newlib/libc/locale/locale.tex b/newlib/libc/locale/locale.tex
deleted file mode 100644
index 20dc5d2bc..000000000
--- a/newlib/libc/locale/locale.tex
+++ /dev/null
@@ -1,123 +0,0 @@
-@node Locale
-@chapter Locale (@file{locale.h})
-
-A @dfn{locale} is the name for a collection of parameters (affecting
-collating sequences and formatting conventions) that may be different
-depending on location or culture. The @code{"C"} locale is the only
-one defined in the ANSI C standard.
-
-This is a minimal implementation, supporting only the required @code{"C"}
-value for locale; strings representing other locales are not
-honored. (@code{""} is also accepted; it represents the default locale
-for an implementation, here equivalent to @code{"C"}.
-
-
-@file{locale.h} defines the structure @code{lconv} to collect the
-information on a locale, with the following fields:
-
-@table @code
-@item char *decimal_point
-The decimal point character used to format ``ordinary'' numbers (all
-numbers except those referring to amounts of money). @code{"."} in the
-C locale.
-
-@item char *thousands_sep
-The character (if any) used to separate groups of digits, when
-formatting ordinary numbers.
-@code{""} in the C locale.
-
-@item char *grouping
-Specifications for how many digits to group (if any grouping is done at
-all) when formatting ordinary numbers. The @emph{numeric value} of each
-character in the string represents the number of digits for the next
-group, and a value of @code{0} (that is, the string's trailing
-@code{NULL}) means to continue grouping digits using the last value
-specified. Use @code{CHAR_MAX} to indicate that no further grouping is
-desired. @code{""} in the C locale.
-
-@item char *int_curr_symbol
-The international currency symbol (first three characters), if any, and
-the character used to separate it from numbers.
-@code{""} in the C locale.
-
-@item char *currency_symbol
-The local currency symbol, if any.
-@code{""} in the C locale.
-
-@item char *mon_decimal_point
-The symbol used to delimit fractions in amounts of money.
-@code{""} in the C locale.
-
-@item char *mon_thousands_sep
-Similar to @code{thousands_sep}, but used for amounts of money.
-@code{""} in the C locale.
-
-@item char *mon_grouping
-Similar to @code{grouping}, but used for amounts of money.
-@code{""} in the C locale.
-
-@item char *positive_sign
-A string to flag positive amounts of money when formatting.
-@code{""} in the C locale.
-
-@item char *negative_sign
-A string to flag negative amounts of money when formatting.
-@code{""} in the C locale.
-
-@item char int_frac_digits
-The number of digits to display when formatting amounts of money to
-international conventions.
-@code{CHAR_MAX} (the largest number representable as a @code{char}) in
-the C locale.
-
-@item char frac_digits
-The number of digits to display when formatting amounts of money to
-local conventions.
-@code{CHAR_MAX} in the C locale.
-
-@item char p_cs_precedes
-@code{1} indicates the local currency symbol is used before a
-@emph{positive or zero} formatted amount of money; @code{0} indicates
-the currency symbol is placed after the formatted number.
-@code{CHAR_MAX} in the C locale.
-
-@item char p_sep_by_space
-@code{1} indicates the local currency symbol must be separated from
-@emph{positive or zero} numbers by a space; @code{0} indicates that it
-is immediately adjacent to numbers.
-@code{CHAR_MAX} in the C locale.
-
-@item char n_cs_precedes
-@code{1} indicates the local currency symbol is used before a
-@emph{negative} formatted amount of money; @code{0} indicates
-the currency symbol is placed after the formatted number.
-@code{CHAR_MAX} in the C locale.
-
-@item char n_sep_by_space
-@code{1} indicates the local currency symbol must be separated from
-@emph{negative} numbers by a space; @code{0} indicates that it
-is immediately adjacent to numbers.
-@code{CHAR_MAX} in the C locale.
-
-@item char p_sign_posn
-Controls the position of the @emph{positive} sign for
-numbers representing money. @code{0} means parentheses surround the
-number; @code{1} means the sign is placed before both the number and the
-currency symbol; @code{2} means the sign is placed after both the number
-and the currency symbol; @code{3} means the sign is placed just before
-the currency symbol; and @code{4} means the sign is placed just after
-the currency symbol.
-@code{CHAR_MAX} in the C locale.
-
-@item char n_sign_posn
-Controls the position of the @emph{negative} sign for numbers
-representing money, using the same rules as @code{p_sign_posn}.
-@code{CHAR_MAX} in the C locale.
-@end table
-
-@menu
-* setlocale:: Select or query locale
-@end menu
-
-@page
-@include locale/locale.def
diff --git a/newlib/libc/locale/nl_langinfo.3 b/newlib/libc/locale/nl_langinfo.3
deleted file mode 100644
index 96819e1c7..000000000
--- a/newlib/libc/locale/nl_langinfo.3
+++ /dev/null
@@ -1,90 +0,0 @@
-.\" Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD: src/lib/libc/locale/nl_langinfo.3,v 1.4 2002/04/13 04:25:56 dd Exp $
-.\"
-.Dd May 3, 2001
-.Dt NL_LANGINFO 3
-.Os
-.Sh NAME
-.Nm nl_langinfo
-.Nd language information
-.Sh LIBRARY
-.Lb libc
-.Sh SYNOPSIS
-.In langinfo.h
-.Ft char *
-.Fn nl_langinfo "nl_item item"
-.Sh DESCRIPTION
-The
-.Fn nl_langinfo
-function returns a pointer to a string containing information relevant to
-the particular language or cultural area defined in the program's locale.
-The manifest constant names and values of
-.Fa item
-are defined in
-.Aq Pa langinfo.h .
-.Pp
-Calls to
-.Fn setlocale
-with a category corresponding to the category of
-.Fa item ,
-or to the
-category
-.Dv LC_ALL ,
-may overwrite buffer pointed by the return value.
-.Sh EXAMPLES
-For example:
-.Pp
-.Dl nl_langinfo(ABDAY_1)
-.Pp
-would return a pointer to the string
-.Qq Li Dom
-if the identified language was
-Portuguese, and
-.Qq Li Sun
-if the identified language was English.
-.Sh RETURN VALUES
-In a locale where langinfo data is not defined,
-.Fn nl_langinfo
-returns a pointer to the corresponding string in the
-.Tn POSIX
-locale.
-In all locales,
-.Fn nl_langinfo
-returns a pointer to an empty string if
-.Fa item
-contains an invalid setting.
-.Sh SEE ALSO
-.Xr setlocale 3
-.Sh STANDARDS
-The
-.Fn nl_langinfo
-function conforms to
-.St -susv2 .
-.Sh HISTORY
-The
-.Fn nl_langinfo
-function first appeared in
-.Fx 4.6 .
diff --git a/newlib/libc/locale/nl_langinfo.c b/newlib/libc/locale/nl_langinfo.c
deleted file mode 100644
index b2923bd65..000000000
--- a/newlib/libc/locale/nl_langinfo.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*-
- * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-#include <locale.h>
-#include <langinfo.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "timelocal.h"
-#include "lnumeric.h"
-#include "lmonetary.h"
-#include "lmessages.h"
-
-#define TRANSITION_PERIOD_HACK
-
-#define _REL(BASE) ((int)item-BASE)
-
-char *
-_DEFUN(nl_langinfo, (item),
- nl_item item) {
-
- char *ret, *s, *cs;
- static char *csym = NULL;
-#ifdef TRANSITION_PERIOD_HACK
- static char *cset = NULL;
-#endif /* TRANSITION_PERIOD_HACK */
- char *nptr;
-
- switch (item) {
- case CODESET:
- ret = "";
- if ((s = setlocale(LC_CTYPE, NULL)) != NULL) {
- if ((cs = strchr(s, '.')) != NULL) {
- ret = cs + 1;
-#ifdef TRANSITION_PERIOD_HACK
- if (strncmp(ret, "ISO_", 4) == 0) {
- int slen = strlen(ret);
-
- nptr = realloc(cset, slen);
-
- if (!nptr && cset)
- free (cset);
-
- cset = nptr;
- if (cset != NULL) {
- strcpy(cset, "ISO");
- strcat(cset, ret + 4);
- ret = cset;
- } else
- ret = "";
- } else if (strcmp(ret, "EUC") == 0) {
- if (strncmp(s, "ja_JP", 5) == 0)
- ret = "eucJP";
- else if (strncmp(s, "ko_KR", 5) == 0)
- ret = "eucKR";
- else if (strncmp(s, "zh_CN", 5) == 0)
- ret = "eucCN";
- } else if (strcmp(ret, "ASCII") == 0)
- ret = "US-ASCII";
-#endif /* TRANSITION_PERIOD_HACK */
- } else if (strcmp(s, "C") == 0 ||
- strcmp(s, "POSIX") == 0
-#ifdef TRANSITION_PERIOD_HACK
- || strstr(s, "ASCII") != NULL
-#endif /* TRANSITION_PERIOD_HACK */
- )
- ret = "US-ASCII";
- }
- break;
- case D_T_FMT:
- ret = (char *) __get_current_time_locale()->c_fmt;
- break;
- case D_FMT:
- ret = (char *) __get_current_time_locale()->x_fmt;
- break;
- case T_FMT:
- ret = (char *) __get_current_time_locale()->X_fmt;
- break;
- case T_FMT_AMPM:
- ret = (char *) __get_current_time_locale()->ampm_fmt;
- break;
- case AM_STR:
- ret = (char *) __get_current_time_locale()->am;
- break;
- case PM_STR:
- ret = (char *) __get_current_time_locale()->pm;
- break;
- case DAY_1: case DAY_2: case DAY_3:
- case DAY_4: case DAY_5: case DAY_6: case DAY_7:
- ret = (char*) __get_current_time_locale()->weekday[_REL(DAY_1)];
- break;
- case ABDAY_1: case ABDAY_2: case ABDAY_3:
- case ABDAY_4: case ABDAY_5: case ABDAY_6: case ABDAY_7:
- ret = (char*) __get_current_time_locale()->wday[_REL(ABDAY_1)];
- break;
- case MON_1: case MON_2: case MON_3: case MON_4:
- case MON_5: case MON_6: case MON_7: case MON_8:
- case MON_9: case MON_10: case MON_11: case MON_12:
- ret = (char*) __get_current_time_locale()->month[_REL(MON_1)];
- break;
- case ABMON_1: case ABMON_2: case ABMON_3: case ABMON_4:
- case ABMON_5: case ABMON_6: case ABMON_7: case ABMON_8:
- case ABMON_9: case ABMON_10: case ABMON_11: case ABMON_12:
- ret = (char*) __get_current_time_locale()->mon[_REL(ABMON_1)];
- break;
- case ERA:
- /* XXX: need to be implemented */
- ret = "";
- break;
- case ERA_D_FMT:
- /* XXX: need to be implemented */
- ret = "";
- break;
- case ERA_D_T_FMT:
- /* XXX: need to be implemented */
- ret = "";
- break;
- case ERA_T_FMT:
- /* XXX: need to be implemented */
- ret = "";
- break;
- case ALT_DIGITS:
- /* XXX: need to be implemented */
- ret = "";
- break;
- case RADIXCHAR:
- ret = (char*) __get_current_numeric_locale()->decimal_point;
- break;
- case THOUSEP:
- ret = (char*) __get_current_numeric_locale()->thousands_sep;
- break;
- case YESEXPR:
- ret = (char*) __get_current_messages_locale()->yesexpr;
- break;
- case NOEXPR:
- ret = (char*) __get_current_messages_locale()->noexpr;
- break;
- /*
- * All items marked with LEGACY are available, but not recomended
- * by SUSv2 to be used in portable applications since they're subject
- * to remove in future specification editions
- */
- case YESSTR: /* LEGACY */
- ret = (char*) __get_current_messages_locale()->yesstr;
- break;
- case NOSTR: /* LEGACY */
- ret = (char*) __get_current_messages_locale()->nostr;
- break;
- case CRNCYSTR:
- ret = "";
- cs = (char*) __get_current_monetary_locale()->currency_symbol;
- if (*cs != '\0') {
- char pos = localeconv()->p_cs_precedes;
-
- if (pos == localeconv()->n_cs_precedes) {
- char psn = '\0';
-
- if (pos == CHAR_MAX) {
- if (strcmp(cs, __get_current_monetary_locale()->mon_decimal_point) == 0)
- psn = '.';
- } else
- psn = pos ? '-' : '+';
- if (psn != '\0') {
- int clen = strlen(cs);
-
- nptr = realloc(csym, clen + 2);
- if (!nptr && csym)
- free (csym);
-
- csym = nptr;
-
- if (csym != NULL) {
- *csym = psn;
- strcpy(csym + 1, cs);
- ret = csym;
- }
- }
- }
- }
- break;
- case D_MD_ORDER: /* local extension */
- ret = (char *) __get_current_time_locale()->md_order;
- break;
- default:
- ret = "";
- }
- return (ret);
-}
diff --git a/newlib/libc/locale/setlocale.h b/newlib/libc/locale/setlocale.h
deleted file mode 100644
index 3eb769863..000000000
--- a/newlib/libc/locale/setlocale.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * Copyright (C) 1997 by Andrey A. Chernov, Moscow, Russia.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/locale/setlocale.h,v 1.4 2001/12/20 18:28:52 phantom Exp $
- */
-
-#ifndef _SETLOCALE_H_
-#define _SETLOCALE_H_
-
-#define ENCODING_LEN 31
-#define CATEGORY_LEN 11
-
-extern char *_PathLocale;
-
-#endif /* !_SETLOCALE_H_ */
diff --git a/newlib/libc/locale/timelocal.c b/newlib/libc/locale/timelocal.c
deleted file mode 100644
index 5b097ad7c..000000000
--- a/newlib/libc/locale/timelocal.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*-
- * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
- * Copyright (c) 1997 FreeBSD Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-#include <stddef.h>
-
-#include "ldpart.h"
-#include "timelocal.h"
-
-static struct lc_time_T _time_locale;
-static int _time_using_locale;
-static char *time_locale_buf;
-
-#define LCTIME_SIZE (sizeof(struct lc_time_T) / sizeof(char *))
-
-static const struct lc_time_T _C_time_locale = {
- {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
- }, {
- "January", "February", "March", "April", "May", "June",
- "July", "August", "September", "October", "November", "December"
- }, {
- "Sun", "Mon", "Tue", "Wed",
- "Thu", "Fri", "Sat"
- }, {
- "Sunday", "Monday", "Tuesday", "Wednesday",
- "Thursday", "Friday", "Saturday"
- },
-
- /* X_fmt */
- "%H:%M:%S",
-
- /*
- * x_fmt
- * Since the C language standard calls for
- * "date, using locale's date format," anything goes.
- * Using just numbers (as here) makes Quakers happier;
- * it's also compatible with SVR4.
- */
- "%m/%d/%y",
-
- /*
- * c_fmt
- */
- "%a %b %e %H:%M:%S %Y",
-
- /* am */
- "AM",
-
- /* pm */
- "PM",
-
- /* date_fmt */
- "%a %b %e %H:%M:%S %Z %Y",
-
- /* alt_month
- * Standalone months forms for %OB
- */
- {
- "January", "February", "March", "April", "May", "June",
- "July", "August", "September", "October", "November", "December"
- },
-
- /* md_order
- * Month / day order in dates
- */
- "md",
-
- /* ampm_fmt
- * To determine 12-hour clock format time (empty, if N/A)
- */
- "%I:%M:%S %p"
-};
-
-struct lc_time_T *
-__get_current_time_locale(void) {
- return (_time_using_locale
- ? &_time_locale
- : (struct lc_time_T *)&_C_time_locale);
-}
-
-int
-__time_load_locale(const char *name) {
-
- int ret;
-
- ret = __part_load_locale(name, &_time_using_locale,
- time_locale_buf, "LC_TIME",
- LCTIME_SIZE, LCTIME_SIZE,
- (const char **)&_time_locale);
-
- return (ret);
-}
diff --git a/newlib/libc/locale/timelocal.h b/newlib/libc/locale/timelocal.h
deleted file mode 100644
index 0b0a59a48..000000000
--- a/newlib/libc/locale/timelocal.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 1997-2002 FreeBSD Project.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/stdtime/timelocal.h,v 1.11 2002/01/24 15:07:44 phantom Exp $
- */
-
-#ifndef _TIMELOCAL_H_
-#define _TIMELOCAL_H_
-
-/*
- * Private header file for the strftime and strptime localization
- * stuff.
- */
-struct lc_time_T {
- const char *mon[12];
- const char *month[12];
- const char *wday[7];
- const char *weekday[7];
- const char *X_fmt;
- const char *x_fmt;
- const char *c_fmt;
- const char *am;
- const char *pm;
- const char *date_fmt;
- const char *alt_month[12];
- const char *md_order;
- const char *ampm_fmt;
-};
-
-struct lc_time_T *__get_current_time_locale(void);
-int __time_load_locale(const char *);
-
-#endif /* !_TIMELOCAL_H_ */