head	1.5;
access;
symbols
	isolib-2:1.1.1.1
	isolib:1.1.1;
locks; strict;
comment	@# @;


1.5
date	2000.02.03.06.24.57;	author bkoz;	state dead;
branches;
next	1.4;

1.4
date	99.02.25.11.20.22;	author bkoz;	state Exp;
branches;
next	1.3;

1.3
date	98.12.31.23.15.38;	author bkoz;	state Exp;
branches;
next	1.2;

1.2
date	98.07.15.19.00.43;	author ncm;	state Exp;
branches;
next	1.1;

1.1
date	98.04.15.04.57.47;	author ncm;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	98.04.15.04.57.47;	author ncm;	state Exp;
branches;
next	;


desc
@@


1.5
log
@
2000-02-02  Benjamin Kosnik  <bkoz@@cygnus.com>

	* configure.in (LIBS): Remove unused subdirs.
	* configure: Regenerate.
	* Makefile.am (SUBDIRS): And here.
	* Makefile.in: Regenerate.
	* src/Makefile.am (sources): And here.
	* src/Makefile.in: Regenerate.
	* string/*: Remove.
	* amm1/*: Remove.
	* generic/*: Remove.
	* glibc/*: Remove.
	* mkcheck.in (INC_PATH): Include $BUILD_DIR before any source dirs.

	* libtool: Update to libtool-1.3.4.
	* ltconfig: Same
	* ltmain.sh: Same
	* config.sub: Same.
	* config.guess: Same.
@
text
@// Locale support -*- C++ -*-

// Copyright (C) 1997-1999 Cygnus Solutions
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING.  If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.

// As a special exception, you may use this file as part of a free software
// library without restriction.  Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License.  This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.

// XXX not used.

//
// ISO C++ 14882: 22.1  Locales
//

#ifndef __LOCALE__
#define __LOCALE__	1

#ifdef __GNUG__
# pragma interface "locale"
#endif

#include <clocale>

extern "C++" {

namespace std {

  class locale
  {
  public:
    // types:
    class facet;
    class id;
    typedef int category;
    static const category none = 0;
    static const category collate  = 1 << LC_COLLATE;
    static const category ctype = 1 << LC_CTYPE;
    static const category monetary = 1 << LC_MONETARY;
    static const category numeric = 1 << LC_NUMERIC;
    static const category time = 1 << LC_TIME;
    static const category messages = 1 << LC_MESSAGES;
    static const category all = (collate | ctype | monetary | numeric
				 | time  | messages);

    // construct/copy/destroy:
    locale () throw ();
    locale (const locale &other) throw ();
    explicit locale (const char *std_name);
    locale (const locale &other, const char *std_name, category);
#ifdef _G_USE_MEMBER_TEMPLATES
    template<class Facet> locale (const locale &other, Facet *f);
    template<class Facet> locale (const locale &other, const locale &one);
#endif
    locale (const locale &other, const locale &one, category);

    ~locale () throw ();  // non-virtual

    const locale &operator = (const locale &other) throw ();

    // locale operations:
    basic_string<char> name () const;
    bool operator == (const locale &other) const;
    bool operator != (const locale &other) const;
#ifdef _G_USE_MEMBER_TEMPLATES
    template<class charT, class Traits, class Allocator>
    bool operator () (const basic_string<charT, Traits, Allocator> &s1,
		      const basic_string<charT, Traits, Allocator> &s2) const;
#endif

    // global locale objects:
    static locale global (const locale &);
    static const locale &classic ();
  };

  template<class Facet> const Facet &use_facet (const locale &);
  template<class Facet> bool has_facet (const locale &) throw();


  // subclauses ctype:
  class ctype_base
  {
    enum mask
    {
      space = _ISspace,
      print = _ISprint,
      cntrl = _IScntrl,
      upper = _ISupper,
      lower = _ISlower,
      alpha = _ISalpha,
      digit = _ISdigit,
      punct = _ISpunct,
      xdigit = _ISxdigit,
      alnum = _ISalnum,
      graph = _ISgraph
    };
  };

  template<class charT>
  class ctype : public locale::facet, public ctype_base
  {
  public:
    typedef charT char_type;

    explicit ctype (size_t refs = 0);

    bool is (mask m, charT c) const
      { return do_is (m, c); }
    const charT *is (const charT *low, const charT *high, mask *vec) const
      { return do_is (low, high, vec); }

    const charT *scan_is (mask m, const charT *low, const charT *high) const
      { return do_scan_is (m, low, high); }

    const charT *scan_not (mask m, const charT *low, const charT *high) const
      { return do_scan_not (m, low, high); }

    charT toupper (charT c) const
      { return do_toupper (c); }
    const charT *toupper (charT *low, const charT *high) const
      { return do_toupper (low, high); }

    charT tolower (charT c) const
      { return do_tolower (c); }
    const charT *tolower (charT *low, const charT *high) const
      { return do_tolower (low, high); }

    charT widen (char c) const
      { return do_widen (c); }
    const char *widen (const char *low, const char *high, charT *to) const
      { return do_widen (low, high, to); }

    char narrow (charT c, char dfault) const
      { return do_narrow (c, dfault); }
    const charT *narrow (const charT *low, const charT *, char dfault,
			 char* to) const
      { return do_narrow (low, high, dfault, to); }

    static locale::id id;

  protected:
    ~ctype ();  // virtual

    virtual bool do_is (mask m, charT c) const;
    virtual const charT *do_is (const charT *low, const charT *high,
				mask *vec) const;

    virtual const charT *do_scan_is (mask m, const charT *low,
				     const charT *high) const;

    virtual const charT *do_scan_not (mask m, const charT *low,
				      const charT *high) const;

    virtual charT do_toupper (charT) const;
    virtual const charT *do_toupper (charT *low, const charT *high) const;

    virtual charT do_tolower (charT) const;
    virtual const charT *do_tolower (charT *low, const charT *high) const;

    virtual charT do_widen (char) const;
    virtual const char *do_widen (const char *low, const char *high,
				  charT *dest) const;

    virtual char do_narrow (charT, char dfault) const;
    virtual const charT *do_narrow (const charT *low, const charT *high,
				    char dfault, char *dest) const;
  };


  template<> class ctype<char>;        // specialization
  template<class charT> class ctype_byname;
  template<> class ctype_byname<char>; // specialization
  class codecvt_base;
  template<class internT, class externT, class stateT> class codecvt;
  template<class internT, class externT, class stateT> class codecvt_byname;


  // subclause convenience interfaces:
  template<class charT>
  bool isspace (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::space, c); }
  template<class charT>
  bool isprint (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::print, c); }
  template<class charT>
  bool iscntrl (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::cntrl, c); }
  template<class charT>
  bool isupper (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::upper, c); }
  template<class charT>
  bool islower (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::lower, c); }
  template<class charT>
  bool isalpha (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::alpha, c); }
  template<class charT>
  bool isdigit (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::digit, c); }
  template<class charT>
  bool ispunct (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::punct, c); }
  template<class charT>
  bool isxdigit (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::xdigit, c); }
  template<class charT>
  bool isalnum (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::alnum, c); }
  template<class charT>
  bool isgraph (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).is (ctype_base::graph, c); }

  template<class charT>
  charT toupper (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).toupper (c); }
  template<class charT>
  charT tolower (charT c, const locale &loc)
    { return use_facet<ctype<charT> > (loc).tolower (c); }


  // subclauses numeric:
  template<class charT, class InputIterator> class num_get;
  template<class charT, class OutputIterator> class num_put;
  template<class charT> class numpunct;
  template<class charT> class numpunct_byname;

  // subclause collation:
  template<class charT> class collate;
  template<class charT> class collate_byname;

  // subclause date and time:
  class time_base;
  template<class charT, class InputIterator> class time_get;
  template<class charT, class InputIterator> class time_get_byname;
  template<class charT, class OutputIterator> class time_put;
  template<class charT, class OutputIterator> class time_put_byname;

  // subclauses money:
  class money_base;
  template<class charT, class InputIterator>  class money_get;
  template<class charT, class OutputIterator> class money_put;
  template<class charT, bool Intl> class moneypunct;
  template<class charT, bool Intl> class moneypunct_byname;

  // subclause message retrieval:
  class messages_base;
  template<class charT> class messages;
  template<class charT> class messages_byname;

} // namespace std

} // extern "C++"

#endif	// __LOCALE__
@


1.4
log
@d
1999-02-25  Benjamin Kosnik  <bkoz@@cygnus.com>
	* stl/bits/stl_config.h (__STL_USE_STD_ALLOCATORS): Minor tweaking.
	* bits/c++config.h: Clean. Remove _G_NO_STREAMBUF_ITERATORS and
	_G_USE_NAMESPACE.
	* amm1/locale: Remove unused defines.
	* generic/locale: Ditto.
	* src/ios.cc: Ditto.
	* src/locale.cc: Ditto.
	* src/locale-inst.cc: Ditto.
	* src/localename.cc: Ditto.
	* src/stdstreams.cc: And here.
	* bits/c++config.h (_G_USE_WCHAR_T): Fix.
	* bits/loccore.h: Simplify, clean, add wchar_t guards.
	* bits/loccore.tcc: Ditto.
	* bits/locfacets.h: Ditto.
	* src/locale-inst.cc: Ditto.
	* bits/locfacets.tcc: Add do_put long long here.
@
text
@@


1.3
log
@

1998-12-31  Benjamin Kosnik  <bkoz@@loony.cygnus.com>

	* COPYING: New file (GPL v 2).
	* LICENSE.STD: Remove.

	* testsuite/27/27stringstream.C: Change license.
	* testsuite/27/27stringbuf.C:
	* testsuite/27/27octfmt.C:
	* testsuite/27/27boolfmt.C:
	* testsuite/21/21nonmember.C:
	* testsuite/21/21compare.C:

	* string/wmemset.c:
	* string/wmemmove.c:
	* string/wmemcpy.c:
	* string/wmemcmp.c:
	* string/wmemchr.c:
	* string/wcslen.c:

	* src/wstring.cc:
	* src/string.cc:
	* src/stdstreams.cc:
	* src/stdexcept.cc:
	* src/os_raw.cc:
	* src/misc-inst.cc:
	* src/localename.cc:
	* src/locale.cc:
	* src/ios.cc:
	* src/complex.cc:
	* src/bitset.cc:

	* shadow/bits/wrap_unistd.h:
	* shadow/bits/wrap_libio.h:
	* shadow/bits/std_cwctype.h:
	* shadow/bits/std_cwchar.h:
	* shadow/bits/std_ctime.h:
	* shadow/bits/std_cstring.h:
	* shadow/bits/std_cstdlib.h:
	* shadow/bits/std_cstdio.h:
	* shadow/bits/std_cstddef.h:
	* shadow/bits/std_cstdarg.h:
	* shadow/bits/std_csignal.h:
	* shadow/bits/std_csetjmp.h:
	* shadow/bits/std_cmath.h:
	* shadow/bits/std_clocale.h:
	* shadow/bits/std_climits.h:
	* shadow/bits/std_cfloat.h:
	* shadow/bits/std_cerrno.h:
	* shadow/bits/std_cctype.h:
	* shadow/bits/std_cassert.h:
	* shadow/sys/cdefs.h:
	* shadow/wctype.h:
	* shadow/wchar.h:
	* shadow/time.h:
	* shadow/stdlib.h:
	* shadow/stdio.h:
	* shadow/stddef.h:
	* shadow/stdarg.h:
	* shadow/signal.h:
	* shadow/setjmp.h:
	* shadow/math.h:
	* shadow/locale.h:
	* shadow/limits.h:
	* shadow/libio.h:
	* shadow/float.h:
	* shadow/errno.h:
	* shadow/ctype.h:
	* shadow/assert.h:

	* math/signbitl.c:
	* math/signbitf.c:
	* math/signbit.c:
	* math/nan.c:
	* math/mycabsl.c:
	* math/mycabsf.c:
	* math/mycabs.c:
	* math/mathconf.h:
	* math/ctanl.c:
	* math/ctanhl.c:
	* math/ctanhf.c:
	* math/ctanh.c:
	* math/ctanf.c:
	* math/ctan.c:
	* math/csqrtl.c:
	* math/csqrtf.c:
	* math/csqrt.c:
	* math/csinl.c:
	* math/csinhl.c:
	* math/csinh.c:
	* math/csinf.c:
	* math/cpowf.c:
	* math/cpow.c:
	* math/complex-stub.h:
	* math/clogl.c:
	* math/clogf.c:
	* math/clog10l.c:
	* math/clog10f.c:
	* math/clog10.c:
	* math/clog.c:
	* math/cexpl.c:
	* math/cexpf.c:
	* math/cexp.c:
	* math/ccosl.c:
	* math/ccoshl.c:
	* math/ccoshf.c:
	* math/ccosh.c:
	* math/ccosf.c:
	* math/ccos.c:
	* math/cargl.c:
	* math/cargf.c:
	* math/carg.c:

	* glibc/clocale:

	* backward/new.h:
	* backward/iostream.h:

	* amm1/locale.cc:
	* amm1/locale:
	* amm1/clocale:

	* generic/locale.cc:
	* generic/locale:
	* generic/clocale:

	* bits/valarray_meta.h:
	* bits/valarray_array.tcc:
	* bits/valarray_array.h:
	* bits/utility.h:
	* bits/string.tcc
	* bits/streambuf.tcc:
	* bits/std_valarray.h:
	* bits/std_typeinfo.h:
	* bits/std_string.h:
	* bits/std_streambuf.h:
	* bits/std_sstream.h:
	* bits/std_ostream.h:
	* bits/std_new.h:
	* bits/std_istream.h:
	* bits/std_iostream.h:
	* bits/std_iosfwd.h:
	* bits/std_ios.h:
	* bits/std_iomanip.h:
	* bits/std_exception.h:
	* bits/std_cwchar.h:
	* bits/std_ctime.h:
	* bits/std_cstring.h:
	* bits/std_cstdlib.h:
	* bits/std_cstdio.h:
	* bits/std_cstdarg.h:
	* bits/std_csignal.h:
	* bits/std_csetjmp.h:
	* bits/std_complex.h:
	* bits/std_cmath.h:
	* bits/std_clocale.h:
	* bits/std_climits.h:
	* bits/std_cfloat.h:
	* bits/std_cerrno.h:
	* bits/std_cctype.h:
	* bits/std_cassert.h:
	* bits/sstream.tcc:
	* bits/slice_array.h:
	* bits/slice.h:
	* bits/sbuf_iter.h:
	* bits/ostream.tcc:
	* bits/os_raw.h:
	* bits/missing.h:
	* bits/mask_array.h:
	* bits/locfacets.tcc:
	* bits/locfacets.h:
	* bits/loccore.tcc:
	* bits/loccore.h:
	* bits/ios_base.h:
	* bits/indirect_array.h:
	* bits/gslice_array.h:
	* bits/gslice.h:
	* bits/generic_shadow.h:
	* bits/fstream.tcc:
	* bits/char_traits.h:
	* bits/c++config.h:
	* bits/basic_string.h:
	* bits/basic_ios.h:
	* bits/std_fstream.h:
@
text
@a46 1
#if _G_USE_NAMESPACE
a47 1
#endif
a269 1
#if _G_USE_NAMESPACE
a270 1
#endif
@


1.2
log
@RELEASE-NOTES: add note about compiler version & flags, clarify
  license description
other files: fix up copyright notice
bits/std_cwchar.h: move "#include" above use of wchar_t.
bits/std_iomanip.h: fix typos.
@
text
@d2 27
a28 1
// (C) Copyright 1998 Cygnus Solutions
d33 1
a33 1
// ISO C++ working draft paper: 22.1  Locales
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
// Copyright (C) 1997 Free Software Foundation, Inc.
d4 1
a4 21
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING.  If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307,
// USA.

// As a special exception, if you link this library with files
// compiled with a GNU compiler to produce an executable, this does not cause
// the resulting executable to be covered by the GNU General Public License.
// This exception does not however invalidate any other reasons why
// the executable file might be covered by the GNU General Public License.
@


1.1.1.1
log
@everything renamed
@
text
@@

