diff options
Diffstat (limited to 'newlib/libc/locale')
-rw-r--r-- | newlib/libc/locale/Makefile.am | 54 | ||||
-rw-r--r-- | newlib/libc/locale/Makefile.in | 567 | ||||
-rw-r--r-- | newlib/libc/locale/fix_grouping.c | 82 | ||||
-rw-r--r-- | newlib/libc/locale/ldpart.c | 187 | ||||
-rw-r--r-- | newlib/libc/locale/ldpart.h | 35 | ||||
-rw-r--r-- | newlib/libc/locale/lmessages.c | 89 | ||||
-rw-r--r-- | newlib/libc/locale/lmessages.h | 42 | ||||
-rw-r--r-- | newlib/libc/locale/lmonetary.c | 143 | ||||
-rw-r--r-- | newlib/libc/locale/lmonetary.h | 53 | ||||
-rw-r--r-- | newlib/libc/locale/lnumeric.c | 85 | ||||
-rw-r--r-- | newlib/libc/locale/lnumeric.h | 41 | ||||
-rw-r--r-- | newlib/libc/locale/locale.c | 301 | ||||
-rw-r--r-- | newlib/libc/locale/locale.tex | 123 | ||||
-rw-r--r-- | newlib/libc/locale/nl_langinfo.3 | 90 | ||||
-rw-r--r-- | newlib/libc/locale/nl_langinfo.c | 214 | ||||
-rw-r--r-- | newlib/libc/locale/setlocale.h | 37 | ||||
-rw-r--r-- | newlib/libc/locale/timelocal.c | 119 | ||||
-rw-r--r-- | newlib/libc/locale/timelocal.h | 55 |
18 files changed, 0 insertions, 2317 deletions
diff --git a/newlib/libc/locale/Makefile.am b/newlib/libc/locale/Makefile.am deleted file mode 100644 index 02b586b23..000000000 --- a/newlib/libc/locale/Makefile.am +++ /dev/null @@ -1,54 +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 -ELIX_SOURCES = -else -ELIX_SOURCES = \ - fix_grouping.c \ - ldpart.c \ - lmessages.c \ - lnumeric.c \ - lmonetary.c \ - nl_langinfo.c \ - timelocal.c -endif - -liblocale_la_LDFLAGS = -Xcompiler -nostdlib - -if USE_LIBTOOL -noinst_LTLIBRARIES = liblocale.la -liblocale_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES) -noinst_DATA = objectlist.awk.in -else -noinst_LIBRARIES = lib.a -lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES) -lib_a_CFLAGS = $(AM_CFLAGS) -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 e2e5b294a..000000000 --- a/newlib/libc/locale/Makefile.in +++ /dev/null @@ -1,567 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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. - -@SET_MAKE@ - - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am -subdir = locale -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ - $(top_srcdir)/../../ltoptions.m4 \ - $(top_srcdir)/../../ltsugar.m4 \ - $(top_srcdir)/../../ltversion.m4 \ - $(top_srcdir)/../../lt~obsolete.m4 \ - $(top_srcdir)/../acinclude.m4 $(top_srcdir)/../confsubdir.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -lib_a_AR = $(AR) $(ARFLAGS) -lib_a_LIBADD = -am__objects_1 = lib_a-locale.$(OBJEXT) -@ELIX_LEVEL_1_FALSE@am__objects_2 = lib_a-fix_grouping.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-ldpart.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-lmessages.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-lnumeric.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-lmonetary.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-nl_langinfo.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-timelocal.$(OBJEXT) -@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \ -@USE_LIBTOOL_FALSE@ $(am__objects_2) -lib_a_OBJECTS = $(am_lib_a_OBJECTS) -LTLIBRARIES = $(noinst_LTLIBRARIES) -liblocale_la_LIBADD = -am__objects_3 = locale.lo -@ELIX_LEVEL_1_FALSE@am__objects_4 = fix_grouping.lo ldpart.lo \ -@ELIX_LEVEL_1_FALSE@ lmessages.lo lnumeric.lo lmonetary.lo \ -@ELIX_LEVEL_1_FALSE@ nl_langinfo.lo timelocal.lo -@USE_LIBTOOL_TRUE@am_liblocale_la_OBJECTS = $(am__objects_3) \ -@USE_LIBTOOL_TRUE@ $(am__objects_4) -liblocale_la_OBJECTS = $(am_liblocale_la_OBJECTS) -@USE_LIBTOOL_TRUE@am_liblocale_la_rpath = -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = -am__depfiles_maybe = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib_a_SOURCES) $(liblocale_la_SOURCES) -DATA = $(noinst_DATA) -ETAGS = etags -CTAGS = ctags -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CRT0 = @CRT0@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ELIX_LEVEL_0_FALSE = @ELIX_LEVEL_0_FALSE@ -ELIX_LEVEL_0_TRUE = @ELIX_LEVEL_0_TRUE@ -ELIX_LEVEL_1_FALSE = @ELIX_LEVEL_1_FALSE@ -ELIX_LEVEL_1_TRUE = @ELIX_LEVEL_1_TRUE@ -ELIX_LEVEL_2_FALSE = @ELIX_LEVEL_2_FALSE@ -ELIX_LEVEL_2_TRUE = @ELIX_LEVEL_2_TRUE@ -ELIX_LEVEL_3_FALSE = @ELIX_LEVEL_3_FALSE@ -ELIX_LEVEL_3_TRUE = @ELIX_LEVEL_3_TRUE@ -ELIX_LEVEL_4_FALSE = @ELIX_LEVEL_4_FALSE@ -ELIX_LEVEL_4_TRUE = @ELIX_LEVEL_4_TRUE@ -ENABLE_NEWLIB_ICONV_FALSE = @ENABLE_NEWLIB_ICONV_FALSE@ -ENABLE_NEWLIB_ICONV_TRUE = @ENABLE_NEWLIB_ICONV_TRUE@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -HAVE_POSIX_DIR_FALSE = @HAVE_POSIX_DIR_FALSE@ -HAVE_POSIX_DIR_TRUE = @HAVE_POSIX_DIR_TRUE@ -HAVE_SIGNAL_DIR_FALSE = @HAVE_SIGNAL_DIR_FALSE@ -HAVE_SIGNAL_DIR_TRUE = @HAVE_SIGNAL_DIR_TRUE@ -HAVE_STDIO64_DIR_FALSE = @HAVE_STDIO64_DIR_FALSE@ -HAVE_STDIO64_DIR_TRUE = @HAVE_STDIO64_DIR_TRUE@ -HAVE_STDIO_DIR_FALSE = @HAVE_STDIO_DIR_FALSE@ -HAVE_STDIO_DIR_TRUE = @HAVE_STDIO_DIR_TRUE@ -HAVE_SYSCALL_DIR_FALSE = @HAVE_SYSCALL_DIR_FALSE@ -HAVE_SYSCALL_DIR_TRUE = @HAVE_SYSCALL_DIR_TRUE@ -HAVE_UNIX_DIR_FALSE = @HAVE_UNIX_DIR_FALSE@ -HAVE_UNIX_DIR_TRUE = @HAVE_UNIX_DIR_TRUE@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -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_STDIO_DEF = @LIBC_STDIO_DEF@ -LIBC_STDIO_LIB = @LIBC_STDIO_LIB@ -LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ -LIBC_SYS_LIB = @LIBC_SYS_LIB@ -LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MAY_SUPPLY_SYSCALLS_FALSE = @MAY_SUPPLY_SYSCALLS_FALSE@ -MAY_SUPPLY_SYSCALLS_TRUE = @MAY_SUPPLY_SYSCALLS_TRUE@ -NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -READELF = @READELF@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@ -USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@ -VERSION = @VERSION@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_AS = @ac_ct_AS@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ -ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_LIPO = @ac_ct_LIPO@ -ac_ct_NMEDIT = @ac_ct_NMEDIT@ -ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ -ac_ct_OTOOL = @ac_ct_OTOOL@ -ac_ct_OTOOL64 = @ac_ct_OTOOL64@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_READELF = @ac_ct_READELF@ -ac_ct_STRIP = @ac_ct_STRIP@ -aext = @aext@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -extra_dir = @extra_dir@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libm_machine_dir = @libm_machine_dir@ -localstatedir = @localstatedir@ -lpfx = @lpfx@ -lt_ECHO = @lt_ECHO@ -machine_dir = @machine_dir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -newlib_basedir = @newlib_basedir@ -oext = @oext@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -subdirs = @subdirs@ -sys_dir = @sys_dir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -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_FALSE@ELIX_SOURCES = \ -@ELIX_LEVEL_1_FALSE@ fix_grouping.c \ -@ELIX_LEVEL_1_FALSE@ ldpart.c \ -@ELIX_LEVEL_1_FALSE@ lmessages.c \ -@ELIX_LEVEL_1_FALSE@ lnumeric.c \ -@ELIX_LEVEL_1_FALSE@ lmonetary.c \ -@ELIX_LEVEL_1_FALSE@ nl_langinfo.c \ -@ELIX_LEVEL_1_FALSE@ timelocal.c - -@ELIX_LEVEL_1_TRUE@ELIX_SOURCES = -liblocale_la_LDFLAGS = -Xcompiler -nostdlib -@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = liblocale.la -@USE_LIBTOOL_TRUE@liblocale_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES) -@USE_LIBTOOL_FALSE@noinst_DATA = -@USE_LIBTOOL_TRUE@noinst_DATA = objectlist.awk.in -@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a -@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES) -@USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS) -CHEWOUT_FILES = locale.def -SUFFIXES = .def -CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str -TARGETDOC = ../tmp.texi -CLEANFILES = $(CHEWOUT_FILES) *.ref -all: all-am - -.SUFFIXES: -.SUFFIXES: .def .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus locale/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --cygnus locale/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) - -rm -f lib.a - $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) - $(RANLIB) lib.a - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -liblocale.la: $(liblocale_la_OBJECTS) $(liblocale_la_DEPENDENCIES) - $(LINK) $(am_liblocale_la_rpath) $(liblocale_la_LDFLAGS) $(liblocale_la_OBJECTS) $(liblocale_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -.c.o: - $(COMPILE) -c $< - -.c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: - $(LTCOMPILE) -c -o $@ $< - -lib_a-locale.o: locale.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-locale.o `test -f 'locale.c' || echo '$(srcdir)/'`locale.c - -lib_a-locale.obj: locale.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-locale.obj `if test -f 'locale.c'; then $(CYGPATH_W) 'locale.c'; else $(CYGPATH_W) '$(srcdir)/locale.c'; fi` - -lib_a-fix_grouping.o: fix_grouping.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fix_grouping.o `test -f 'fix_grouping.c' || echo '$(srcdir)/'`fix_grouping.c - -lib_a-fix_grouping.obj: fix_grouping.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fix_grouping.obj `if test -f 'fix_grouping.c'; then $(CYGPATH_W) 'fix_grouping.c'; else $(CYGPATH_W) '$(srcdir)/fix_grouping.c'; fi` - -lib_a-ldpart.o: ldpart.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ldpart.o `test -f 'ldpart.c' || echo '$(srcdir)/'`ldpart.c - -lib_a-ldpart.obj: ldpart.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ldpart.obj `if test -f 'ldpart.c'; then $(CYGPATH_W) 'ldpart.c'; else $(CYGPATH_W) '$(srcdir)/ldpart.c'; fi` - -lib_a-lmessages.o: lmessages.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lmessages.o `test -f 'lmessages.c' || echo '$(srcdir)/'`lmessages.c - -lib_a-lmessages.obj: lmessages.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lmessages.obj `if test -f 'lmessages.c'; then $(CYGPATH_W) 'lmessages.c'; else $(CYGPATH_W) '$(srcdir)/lmessages.c'; fi` - -lib_a-lnumeric.o: lnumeric.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lnumeric.o `test -f 'lnumeric.c' || echo '$(srcdir)/'`lnumeric.c - -lib_a-lnumeric.obj: lnumeric.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lnumeric.obj `if test -f 'lnumeric.c'; then $(CYGPATH_W) 'lnumeric.c'; else $(CYGPATH_W) '$(srcdir)/lnumeric.c'; fi` - -lib_a-lmonetary.o: lmonetary.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lmonetary.o `test -f 'lmonetary.c' || echo '$(srcdir)/'`lmonetary.c - -lib_a-lmonetary.obj: lmonetary.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lmonetary.obj `if test -f 'lmonetary.c'; then $(CYGPATH_W) 'lmonetary.c'; else $(CYGPATH_W) '$(srcdir)/lmonetary.c'; fi` - -lib_a-nl_langinfo.o: nl_langinfo.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-nl_langinfo.o `test -f 'nl_langinfo.c' || echo '$(srcdir)/'`nl_langinfo.c - -lib_a-nl_langinfo.obj: nl_langinfo.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-nl_langinfo.obj `if test -f 'nl_langinfo.c'; then $(CYGPATH_W) 'nl_langinfo.c'; else $(CYGPATH_W) '$(srcdir)/nl_langinfo.c'; fi` - -lib_a-timelocal.o: timelocal.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-timelocal.o `test -f 'timelocal.c' || echo '$(srcdir)/'`timelocal.c - -lib_a-timelocal.obj: timelocal.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-timelocal.obj `if test -f 'timelocal.c'; then $(CYGPATH_W) 'timelocal.c'; else $(CYGPATH_W) '$(srcdir)/timelocal.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -check-am: -check: check-am -all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ - clean-noinstLTLIBRARIES mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ - ctags distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am - -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 d48a53a87..000000000 --- a/newlib/libc/locale/locale.c +++ /dev/null @@ -1,301 +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 <newlib.h> -#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_ */ |