head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC7:1.1.1.6
	netbsd-11-0-RC6:1.1.1.6
	netbsd-11-0-RC5:1.1.1.6
	netbsd-11-0-RC4:1.1.1.6
	netbsd-11-0-RC3:1.1.1.6
	netbsd-11-0-RC2:1.1.1.6
	netbsd-11-0-RC1:1.1.1.6
	gcc-14-3-0:1.1.1.6
	perseant-exfatfs-base-20250801:1.1.1.6
	netbsd-11:1.1.1.6.0.4
	netbsd-11-base:1.1.1.6
	gcc-12-5-0:1.1.1.6
	netbsd-10-1-RELEASE:1.1.1.5
	perseant-exfatfs-base-20240630:1.1.1.6
	gcc-12-4-0:1.1.1.6
	perseant-exfatfs:1.1.1.6.0.2
	perseant-exfatfs-base:1.1.1.6
	netbsd-8-3-RELEASE:1.1.1.3
	netbsd-9-4-RELEASE:1.1.1.3
	netbsd-10-0-RELEASE:1.1.1.5
	netbsd-10-0-RC6:1.1.1.5
	netbsd-10-0-RC5:1.1.1.5
	netbsd-10-0-RC4:1.1.1.5
	netbsd-10-0-RC3:1.1.1.5
	netbsd-10-0-RC2:1.1.1.5
	netbsd-10-0-RC1:1.1.1.5
	gcc-12-3-0:1.1.1.6
	gcc-10-5-0:1.1.1.5
	netbsd-10:1.1.1.5.0.6
	netbsd-10-base:1.1.1.5
	netbsd-9-3-RELEASE:1.1.1.3
	gcc-10-4-0:1.1.1.5
	cjep_sun2x-base1:1.1.1.5
	cjep_sun2x:1.1.1.5.0.4
	cjep_sun2x-base:1.1.1.5
	cjep_staticlib_x-base1:1.1.1.5
	netbsd-9-2-RELEASE:1.1.1.3
	cjep_staticlib_x:1.1.1.5.0.2
	cjep_staticlib_x-base:1.1.1.5
	gcc-10-3-0:1.1.1.5
	netbsd-9-1-RELEASE:1.1.1.3
	gcc-9-3-0:1.1.1.4
	gcc-7-5-0:1.1.1.3
	phil-wifi-20200421:1.1.1.3
	phil-wifi-20200411:1.1.1.3
	is-mlppp:1.1.1.3.0.20
	is-mlppp-base:1.1.1.3
	phil-wifi-20200406:1.1.1.3
	netbsd-8-2-RELEASE:1.1.1.3
	gcc-8-4-0:1.1.1.3
	netbsd-9-0-RELEASE:1.1.1.3
	netbsd-9-0-RC2:1.1.1.3
	netbsd-9-0-RC1:1.1.1.3
	phil-wifi-20191119:1.1.1.3
	gcc-8-3-0:1.1.1.3
	netbsd-9:1.1.1.3.0.18
	netbsd-9-base:1.1.1.3
	phil-wifi-20190609:1.1.1.3
	netbsd-8-1-RELEASE:1.1.1.3
	netbsd-8-1-RC1:1.1.1.3
	pgoyette-compat-merge-20190127:1.1.1.3
	pgoyette-compat-20190127:1.1.1.3
	gcc-7-4-0:1.1.1.3
	pgoyette-compat-20190118:1.1.1.3
	pgoyette-compat-1226:1.1.1.3
	pgoyette-compat-1126:1.1.1.3
	gcc-6-5-0:1.1.1.3
	pgoyette-compat-1020:1.1.1.3
	pgoyette-compat-0930:1.1.1.3
	pgoyette-compat-0906:1.1.1.3
	netbsd-7-2-RELEASE:1.1.1.2
	pgoyette-compat-0728:1.1.1.3
	netbsd-8-0-RELEASE:1.1.1.3
	phil-wifi:1.1.1.3.0.16
	phil-wifi-base:1.1.1.3
	pgoyette-compat-0625:1.1.1.3
	netbsd-8-0-RC2:1.1.1.3
	pgoyette-compat-0521:1.1.1.3
	pgoyette-compat-0502:1.1.1.3
	pgoyette-compat-0422:1.1.1.3
	netbsd-8-0-RC1:1.1.1.3
	pgoyette-compat-0415:1.1.1.3
	pgoyette-compat-0407:1.1.1.3
	pgoyette-compat-0330:1.1.1.3
	pgoyette-compat-0322:1.1.1.3
	pgoyette-compat-0315:1.1.1.3
	netbsd-7-1-2-RELEASE:1.1.1.2
	pgoyette-compat:1.1.1.3.0.14
	pgoyette-compat-base:1.1.1.3
	gcc-6-4-0:1.1.1.3
	netbsd-7-1-1-RELEASE:1.1.1.2
	gcc-5-5-0:1.1.1.3
	matt-nb8-mediatek:1.1.1.3.0.12
	matt-nb8-mediatek-base:1.1.1.3
	perseant-stdc-iso10646:1.1.1.3.0.10
	perseant-stdc-iso10646-base:1.1.1.3
	netbsd-8:1.1.1.3.0.8
	netbsd-8-base:1.1.1.3
	prg-localcount2-base3:1.1.1.3
	prg-localcount2-base2:1.1.1.3
	prg-localcount2-base1:1.1.1.3
	prg-localcount2:1.1.1.3.0.6
	prg-localcount2-base:1.1.1.3
	pgoyette-localcount-20170426:1.1.1.3
	bouyer-socketcan-base1:1.1.1.3
	pgoyette-localcount-20170320:1.1.1.3
	netbsd-7-1:1.1.1.2.0.10
	netbsd-7-1-RELEASE:1.1.1.2
	netbsd-7-1-RC2:1.1.1.2
	netbsd-7-nhusb-base-20170116:1.1.1.2
	bouyer-socketcan:1.1.1.3.0.4
	bouyer-socketcan-base:1.1.1.3
	pgoyette-localcount-20170107:1.1.1.3
	netbsd-7-1-RC1:1.1.1.2
	pgoyette-localcount-20161104:1.1.1.3
	netbsd-7-0-2-RELEASE:1.1.1.2
	localcount-20160914:1.1.1.3
	netbsd-7-nhusb:1.1.1.2.0.8
	netbsd-7-nhusb-base:1.1.1.2
	pgoyette-localcount-20160806:1.1.1.3
	pgoyette-localcount-20160726:1.1.1.3
	pgoyette-localcount:1.1.1.3.0.2
	pgoyette-localcount-base:1.1.1.3
	gcc-5-4-0:1.1.1.3
	netbsd-7-0-1-RELEASE:1.1.1.2
	gcc-5-3-0:1.1.1.3
	netbsd-7-0:1.1.1.2.0.6
	netbsd-7-0-RELEASE:1.1.1.2
	gcc-4-8-5-pre-gcc-old-import:1.1.1.2
	netbsd-7-0-RC3:1.1.1.2
	netbsd-7-0-RC2:1.1.1.2
	post-gcc-4-8-5-merge:1.1.1.2
	gcc-4-8-5:1.1.1.2
	netbsd-7-0-RC1:1.1.1.2
	gcc-4-8-4:1.1.1.2
	gcc-4-8-20141009:1.1.1.2
	netbsd-6-0-6-RELEASE:1.1.1.1
	netbsd-6-1-5-RELEASE:1.1.1.1
	netbsd-7:1.1.1.2.0.4
	netbsd-7-base:1.1.1.2
	gcc-4-8-3:1.1.1.2
	yamt-pagecache-base9:1.1.1.2
	yamt-pagecache-tag8:1.1.1.1
	netbsd-6-1-4-RELEASE:1.1.1.1
	netbsd-6-0-5-RELEASE:1.1.1.1
	tls-earlyentropy:1.1.1.2.0.2
	tls-earlyentropy-base:1.1.1.2
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.2
	riastradh-drm2-base3:1.1.1.2
	gcc-4-8-3-pre-r208254:1.1.1.2
	gcc-4-8-3-pre-r206687:1.1.1.2
	imported-to-gcc-old-20140227-0107:1.1.1.1
	netbsd-6-1-3-RELEASE:1.1.1.1
	netbsd-6-0-4-RELEASE:1.1.1.1
	netbsd-6-1-2-RELEASE:1.1.1.1
	netbsd-6-0-3-RELEASE:1.1.1.1
	netbsd-6-1-1-RELEASE:1.1.1.1
	riastradh-drm2-base2:1.1.1.1
	riastradh-drm2-base1:1.1.1.1
	riastradh-drm2:1.1.1.1.0.12
	riastradh-drm2-base:1.1.1.1
	netbsd-6-1:1.1.1.1.0.16
	netbsd-6-0-2-RELEASE:1.1.1.1
	netbsd-6-1-RELEASE:1.1.1.1
	netbsd-6-1-RC4:1.1.1.1
	netbsd-6-1-RC3:1.1.1.1
	agc-symver:1.1.1.1.0.14
	agc-symver-base:1.1.1.1
	netbsd-6-1-RC2:1.1.1.1
	netbsd-6-1-RC1:1.1.1.1
	yamt-pagecache-base8:1.1.1.1
	netbsd-6-0-1-RELEASE:1.1.1.1
	yamt-pagecache-base7:1.1.1.1
	matt-nb6-plus-nbase:1.1.1.1
	yamt-pagecache-base6:1.1.1.1
	netbsd-6-0:1.1.1.1.0.10
	netbsd-6-0-RELEASE:1.1.1.1
	gcc-4-5-4:1.1.1.1
	netbsd-6-0-RC2:1.1.1.1
	tls-maxphys:1.1.1.1.0.8
	tls-maxphys-base:1.1.1.2
	matt-nb6-plus:1.1.1.1.0.6
	matt-nb6-plus-base:1.1.1.1
	netbsd-6-0-RC1:1.1.1.1
	yamt-pagecache-base5:1.1.1.1
	yamt-pagecache-base4:1.1.1.1
	netbsd-6:1.1.1.1.0.4
	netbsd-6-base:1.1.1.1
	yamt-pagecache-base3:1.1.1.1
	yamt-pagecache-base2:1.1.1.1
	yamt-pagecache:1.1.1.1.0.2
	yamt-pagecache-base:1.1.1.1
	gcc-4-5-3:1.1.1.1
	FSF:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2011.06.21.01.24.28;	author mrg;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2011.06.21.01.24.28;	author mrg;	state Exp;
branches
	1.1.1.1.2.1
	1.1.1.1.8.1;
next	1.1.1.2;

1.1.1.2
date	2014.03.01.08.41.20;	author mrg;	state Exp;
branches;
next	1.1.1.3;
commitid	TtaB91QNTknAoYqx;

1.1.1.3
date	2016.01.24.06.05.47;	author mrg;	state Exp;
branches;
next	1.1.1.4;
commitid	uWWfbLp08zOK79Sy;

1.1.1.4
date	2020.09.05.07.52.15;	author mrg;	state Exp;
branches;
next	1.1.1.5;
commitid	ZRYA7IOuwfMjAPmC;

1.1.1.5
date	2021.04.10.22.10.07;	author mrg;	state Exp;
branches;
next	1.1.1.6;
commitid	eC4g0MRpqTvEkNOC;

1.1.1.6
date	2023.07.30.05.21.23;	author mrg;	state Exp;
branches;
next	;
commitid	tk6nV4mbc9nVEMyE;

1.1.1.1.2.1
date	2014.05.22.16.37.47;	author yamt;	state Exp;
branches;
next	;
commitid	DX8bafDLmqEbpyBx;

1.1.1.1.8.1
date	2014.08.19.23.54.49;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;


desc
@@


1.1
log
@Initial revision
@
text
@<section id="manual.localization.facet.messages" xreflabel="Messages">
<?dbhtml filename="messages.html"?>

<sectioninfo>
  <keywordset>
    <keyword>
      ISO C++
    </keyword>
    <keyword>
      messages
    </keyword>
  </keywordset>
</sectioninfo>

<title>messages</title>

<para>
The std::messages facet implements message retrieval functionality
equivalent to Java's java.text.MessageFormat .using either GNU gettext
or IEEE 1003.1-200 functions.
</para>

<section id="facet.messages.req">
<title>Requirements</title>

<para>
The std::messages facet is probably the most vaguely defined facet in
the standard library. It's assumed that this facility was built into
the standard library in order to convert string literals from one
locale to the other. For instance, converting the "C" locale's
<code>const char* c = "please"</code> to a German-localized <code>"bitte"</code>
during program execution.
</para>

<blockquote>
<para>
22.2.7.1 - Template class messages [lib.locale.messages]
</para>
</blockquote>

<para>
This class has three public member functions, which directly
correspond to three protected virtual member functions.
</para>

<para>
The public member functions are:
</para>

<para>
<code>catalog open(const string&amp;, const locale&amp;) const</code>
</para>

<para>
<code>string_type get(catalog, int, int, const string_type&amp;) const</code>
</para>

<para>
<code>void close(catalog) const</code>
</para>

<para>
While the virtual functions are:
</para>

<para>
<code>catalog do_open(const string&amp;, const locale&amp;) const</code>
</para>
<blockquote>
<para>
<emphasis>
-1- Returns: A value that may be passed to get() to retrieve a
message, from the message catalog identified by the string name
according to an implementation-defined mapping. The result can be used
until it is passed to close().  Returns a value less than 0 if no such
catalog can be opened.
</emphasis>
</para>
</blockquote>

<para>
<code>string_type do_get(catalog, int, int, const string_type&amp;) const</code>
</para>
<blockquote>
<para>
<emphasis>
-3- Requires: A catalog cat obtained from open() and not yet closed.
-4- Returns: A message identified by arguments set, msgid, and dfault,
according to an implementation-defined mapping. If no such message can
be found, returns dfault.
</emphasis>
</para>
</blockquote>

<para>
<code>void do_close(catalog) const</code>
</para>
<blockquote>
<para>
<emphasis>
-5- Requires: A catalog cat obtained from open() and not yet closed.
-6- Effects: Releases unspecified resources associated with cat.
-7- Notes: The limit on such resources, if any, is implementation-defined.
</emphasis>
</para>
</blockquote>


</section>

<section id="facet.messages.design">
<title>Design</title>

<para>
A couple of notes on the standard.
</para>

<para>
First, why is <code>messages_base::catalog</code> specified as a typedef
to int? This makes sense for implementations that use
<code>catopen</code>, but not for others. Fortunately, it's not heavily
used and so only a minor irritant.
</para>

<para>
Second, by making the member functions <code>const</code>, it is
impossible to save state in them. Thus, storing away information used
in the 'open' member function for use in 'get' is impossible. This is
unfortunate.
</para>

<para>
The 'open' member function in particular seems to be oddly
designed. The signature seems quite peculiar. Why specify a <code>const
string&amp; </code> argument, for instance, instead of just <code>const
char*</code>? Or, why specify a <code>const locale&amp;</code> argument that is
to be used in the 'get' member function? How, exactly, is this locale
argument useful? What was the intent? It might make sense if a locale
argument was associated with a given default message string in the
'open' member function, for instance. Quite murky and unclear, on
reflection.
</para>

<para>
Lastly, it seems odd that messages, which explicitly require code
conversion, don't use the codecvt facet. Because the messages facet
has only one template parameter, it is assumed that ctype, and not
codecvt, is to be used to convert between character sets.
</para>

<para>
It is implicitly assumed that the locale for the default message
string in 'get' is in the "C" locale. Thus, all source code is assumed
to be written in English, so translations are always from "en_US" to
other, explicitly named locales.
</para>

</section>

<section id="facet.messages.impl">
<title>Implementation</title>

  <section id="messages.impl.models">
  <title>Models</title>
  <para>
    This is a relatively simple class, on the face of it. The standard
    specifies very little in concrete terms, so generic
    implementations that are conforming yet do very little are the
    norm. Adding functionality that would be useful to programmers and
    comparable to Java's java.text.MessageFormat takes a bit of work,
    and is highly dependent on the capabilities of the underlying
    operating system.
  </para>

  <para>
    Three different mechanisms have been provided, selectable via
    configure flags:
  </para>

<itemizedlist>
   <listitem>
     <para>
       generic
     </para>
     <para>
       This model does very little, and is what is used by default.
     </para>
   </listitem>

   <listitem>
     <para>
       gnu
     </para>
     <para>
       The gnu model is complete and fully tested. It's based on the
       GNU gettext package, which is part of glibc. It uses the
       functions <code>textdomain, bindtextdomain, gettext</code> to
       implement full functionality. Creating message catalogs is a
       relatively straight-forward process and is lightly documented
       below, and fully documented in gettext's distributed
       documentation.
     </para>
   </listitem>

   <listitem>
     <para>
       ieee_1003.1-200x
     </para>
     <para>
       This is a complete, though untested, implementation based on
       the IEEE standard. The functions <code>catopen, catgets,
       catclose</code> are used to retrieve locale-specific messages
       given the appropriate message catalogs that have been
       constructed for their use. Note, the script <code>
       po2msg.sed</code> that is part of the gettext distribution can
       convert gettext catalogs into catalogs that
       <code>catopen</code> can use.
   </para>
   </listitem>
</itemizedlist>

<para>
A new, standards-conformant non-virtual member function signature was
added for 'open' so that a directory could be specified with a given
message catalog. This simplifies calling conventions for the gnu
model.
</para>

  </section>

  <section id="messages.impl.gnu">
  <title>The GNU Model</title>

  <para>
    The messages facet, because it is retrieving and converting
    between characters sets, depends on the ctype and perhaps the
    codecvt facet in a given locale. In addition, underlying "C"
    library locale support is necessary for more than just the
    <code>LC_MESSAGES</code> mask: <code>LC_CTYPE</code> is also
    necessary. To avoid any unpleasantness, all bits of the "C" mask
    (i.e. <code>LC_ALL</code>) are set before retrieving messages.
  </para>

  <para>
    Making the message catalogs can be initially tricky, but become
    quite simple with practice. For complete info, see the gettext
    documentation. Here's an idea of what is required:
  </para>

<itemizedlist>
   <listitem>
     <para>
       Make a source file with the required string literals that need
       to be translated. See <code>intl/string_literals.cc</code> for
       an example.
     </para>
   </listitem>

   <listitem>
     <para>
       Make initial catalog (see "4 Making the PO Template File" from
       the gettext docs).</para>
   <para>
   <code> xgettext --c++ --debug string_literals.cc -o libstdc++.pot </code>
   </para>
   </listitem>

   <listitem>
     <para>Make language and country-specific locale catalogs.</para>
   <para>
   <code>cp libstdc++.pot fr_FR.po</code>
   </para>
   <para>
   <code>cp libstdc++.pot de_DE.po</code>
   </para>
   </listitem>

   <listitem>
     <para>
       Edit localized catalogs in emacs so that strings are
       translated.
     </para>
   <para>
   <code>emacs fr_FR.po</code>
   </para>
   </listitem>

   <listitem>
     <para>Make the binary mo files.</para>
   <para>
   <code>msgfmt fr_FR.po -o fr_FR.mo</code>
   </para>
   <para>
   <code>msgfmt de_DE.po -o de_DE.mo</code>
   </para>
   </listitem>

   <listitem>
     <para>Copy the binary files into the correct directory structure.</para>
   <para>
   <code>cp fr_FR.mo (dir)/fr_FR/LC_MESSAGES/libstdc++.mo</code>
   </para>
   <para>
   <code>cp de_DE.mo (dir)/de_DE/LC_MESSAGES/libstdc++.mo</code>
   </para>
   </listitem>

   <listitem>
     <para>Use the new message catalogs.</para>
   <para>
   <code>locale loc_de("de_DE");</code>
   </para>
   <para>
   <code>
   use_facet&lt;messages&lt;char&gt; &gt;(loc_de).open("libstdc++", locale(), dir);
   </code>
   </para>
   </listitem>
</itemizedlist>

  </section>
</section>

<section id="facet.messages.use">
<title>Use</title>
 <para>
   A simple example using the GNU model of message conversion.
 </para>

<programlisting>
#include &lt;iostream&gt;
#include &lt;locale&gt;
using namespace std;

void test01()
{
  typedef messages&lt;char&gt;::catalog catalog;
  const char* dir =
  "/mnt/egcs/build/i686-pc-linux-gnu/libstdc++/po/share/locale";
  const locale loc_de("de_DE");
  const messages&lt;char&gt;&amp; mssg_de = use_facet&lt;messages&lt;char&gt; &gt;(loc_de);

  catalog cat_de = mssg_de.open("libstdc++", loc_de, dir);
  string s01 = mssg_de.get(cat_de, 0, 0, "please");
  string s02 = mssg_de.get(cat_de, 0, 0, "thank you");
  cout &lt;&lt; "please in german:" &lt;&lt; s01 &lt;&lt; '\n';
  cout &lt;&lt; "thank you in german:" &lt;&lt; s02 &lt;&lt; '\n';
  mssg_de.close(cat_de);
}
</programlisting>

</section>

<section id="facet.messages.future">
<title>Future</title>

<itemizedlist>
<listitem>
  <para>
    Things that are sketchy, or remain unimplemented:
  </para>
   <itemizedlist>
      <listitem>
	<para>
	  _M_convert_from_char, _M_convert_to_char are in flux,
	  depending on how the library ends up doing character set
	  conversions. It might not be possible to do a real character
	  set based conversion, due to the fact that the template
	  parameter for messages is not enough to instantiate the
	  codecvt facet (1 supplied, need at least 2 but would prefer
	  3).
	</para>
      </listitem>

      <listitem>
	<para>
	  There are issues with gettext needing the global locale set
	  to extract a message. This dependence on the global locale
	  makes the current "gnu" model non MT-safe. Future versions
	  of glibc, i.e. glibc 2.3.x will fix this, and the C++ library
	  bits are already in place.
	</para>
      </listitem>
   </itemizedlist>
</listitem>

<listitem>
  <para>
    Development versions of the GNU "C" library, glibc 2.3 will allow
    a more efficient, MT implementation of std::messages, and will
    allow the removal of the _M_name_messages data member. If this is
    done, it will change the library ABI. The C++ parts to support
    glibc 2.3 have already been coded, but are not in use: once this
    version of the "C" library is released, the marked parts of the
    messages implementation can be switched over to the new "C"
    library functionality.
  </para>
</listitem>
<listitem>
  <para>
    At some point in the near future, std::numpunct will probably use
    std::messages facilities to implement truename/falsename
    correctly. This is currently not done, but entries in
    libstdc++.pot have already been made for "true" and "false" string
    literals, so all that remains is the std::numpunct coding and the
    configure/make hassles to make the installed library search its
    own catalog. Currently the libstdc++.mo catalog is only searched
    for the testsuite cases involving messages members.
  </para>
</listitem>

<listitem>
  <para> The following member functions:</para>

   <para>
   <code>
	catalog
	open(const basic_string&lt;char&gt;&amp; __s, const locale&amp; __loc) const
   </code>
   </para>

   <para>
   <code>
   catalog
   open(const basic_string&lt;char&gt;&amp;, const locale&amp;, const char*) const;
   </code>
   </para>

   <para>
   Don't actually return a "value less than 0 if no such catalog
   can be opened" as required by the standard in the "gnu"
   model. As of this writing, it is unknown how to query to see
   if a specified message catalog exists using the gettext
   package.
   </para>
</listitem>
</itemizedlist>

</section>

<bibliography id="facet.messages.biblio">
<title>Bibliography</title>

  <biblioentry>
    <title>
      The GNU C Library
    </title>
    <author>
      <surname>McGrath</surname>
      <firstname>Roland</firstname>
    </author>
    <author>
      <surname>Drepper</surname>
      <firstname>Ulrich</firstname>
    </author>
    <copyright>
      <year>2007</year>
      <holder>FSF</holder>
    </copyright>
    <pagenums>Chapters 6 Character Set Handling, and 7 Locales and Internationalization
    </pagenums>
  </biblioentry>

  <biblioentry>
    <title>
      Correspondence
    </title>
    <author>
      <surname>Drepper</surname>
      <firstname>Ulrich</firstname>
    </author>
    <copyright>
      <year>2002</year>
      <holder></holder>
    </copyright>
  </biblioentry>

  <biblioentry>
    <title>
      ISO/IEC 14882:1998 Programming languages - C++
    </title>
    <copyright>
      <year>1998</year>
      <holder>ISO</holder>
    </copyright>
  </biblioentry>

  <biblioentry>
    <title>
      ISO/IEC 9899:1999 Programming languages - C
    </title>

    <copyright>
      <year>1999</year>
      <holder>ISO</holder>
    </copyright>
  </biblioentry>

  <biblioentry>
    <biblioid class="uri">
      <ulink url="http://www.opengroup.org/austin/">
	<citetitle>
	  System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
	</citetitle>
      </ulink>
    </biblioid>
    <copyright>
      <year>2008</year>
      <holder>
	The Open Group/The Institute of Electrical and Electronics
	Engineers, Inc.
      </holder>
    </copyright>
  </biblioentry>

  <biblioentry>
    <title>
      The C++ Programming Language, Special Edition
    </title>
    <author>
      <surname>Stroustrup</surname>
      <firstname>Bjarne</firstname>
    </author>
    <copyright>
      <year>2000</year>
      <holder>Addison Wesley, Inc.</holder>
    </copyright>
    <pagenums>Appendix D</pagenums>
    <publisher>
      <publishername>
	Addison Wesley
      </publishername>
    </publisher>
  </biblioentry>

  <biblioentry>
    <title>
      Standard C++ IOStreams and Locales
    </title>
    <subtitle>
      Advanced Programmer's Guide and Reference
    </subtitle>
    <author>
      <surname>Langer</surname>
      <firstname>Angelika</firstname>
    </author>
    <author>
      <surname>Kreft</surname>
      <firstname>Klaus</firstname>
    </author>
    <copyright>
      <year>2000</year>
      <holder>Addison Wesley Longman, Inc.</holder>
    </copyright>
    <publisher>
      <publishername>
	Addison Wesley Longman
      </publishername>
    </publisher>
  </biblioentry>

  <biblioentry>
    <biblioid class="uri">
      <ulink url="http://java.sun.com/reference/api/index.html">
	<citetitle>
	  API Specifications, Java Platform
	</citetitle>
      </ulink>
    </biblioid>
    <pagenums>java.util.Properties, java.text.MessageFormat,
java.util.Locale, java.util.ResourceBundle
    </pagenums>
  </biblioentry>

  <biblioentry>
    <biblioid class="uri">
      <ulink url="http://www.gnu.org/software/gettext/">
	<citetitle>
	  GNU gettext tools, version 0.10.38, Native Language Support
Library and Tools.
	</citetitle>
      </ulink>
    </biblioid>
  </biblioentry>

</bibliography>

</section>
@


1.1.1.1
log
@initial import of GCC 4.5.3 sources.  changes since 4.1 are way too numerous
to review, please see http://gcc.gnu.org/gcc-4.5/changes.html (and the 4.2,
4.3 and 4.4 versions, too.)

this includes the core, c++, objc and the non java/ada/fortran parts of the
testsuite.
@
text
@@


1.1.1.1.8.1
log
@Rebase to HEAD as of a few days ago.
@
text
@d1 1
a1 2
<section xmlns="http://docbook.org/ns/docbook" version="5.0" 
	 xml:id="manual.localization.facet.messages" xreflabel="Messages">
d4 1
a4 1
<info><title>messages</title>
d6 6
a11 2
    <keyword>ISO C++</keyword>
    <keyword>messages</keyword>
d13 1
a13 2
</info>

d15 1
d23 2
a24 2
<section xml:id="facet.messages.req"><info><title>Requirements</title></info>

d111 2
a112 2
<section xml:id="facet.messages.design"><info><title>Design</title></info>

d121 2
a122 3
<code>catopen</code> and define <code>nl_catd</code> as int, but not for
others. Fortunately, it's not heavily used and so only a minor irritant. 
This has been reported as a possible defect in the standard (LWG 2028).
d160 2
a161 1
<section xml:id="facet.messages.impl"><info><title>Implementation</title></info>
d163 2
a164 3

  <section xml:id="messages.impl.models"><info><title>Models</title></info>
  
d231 2
a232 2
  <section xml:id="messages.impl.gnu"><info><title>The GNU Model</title></info>
  
d324 2
a325 2
<section xml:id="facet.messages.use"><info><title>Use</title></info>

d354 2
a355 2
<section xml:id="facet.messages.future"><info><title>Future</title></info>

d441 2
a442 2
<bibliography xml:id="facet.messages.biblio"><info><title>Bibliography</title></info>

d445 1
a445 1
    <citetitle>
d447 9
a455 3
    </citetitle>
    <author><personname><surname>McGrath</surname><firstname>Roland</firstname></personname></author>
    <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
d465 1
a465 1
    <citetitle>
d467 5
a471 2
    </citetitle>
    <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
d474 1
a474 1
      <holder/>
d479 1
a479 1
    <citetitle>
d481 1
a481 1
    </citetitle>
d489 1
a489 1
    <citetitle>
d491 1
a491 1
    </citetitle>
d500 8
a507 7
      <title>
	<link xmlns:xlink="http://www.w3.org/1999/xlink"
	      xlink:href="http://www.opengroup.org/austin/">
      System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
	</link>
      </title>
        <copyright>
d517 1
a517 1
    <citetitle>
d519 5
a523 2
    </citetitle>
    <author><personname><surname>Stroustrup</surname><firstname>Bjarne</firstname></personname></author>
d537 1
a537 1
    <citetitle>
d539 1
a539 1
    </citetitle>
d543 8
a550 2
    <author><personname><surname>Langer</surname><firstname>Angelika</firstname></personname></author>
    <author><personname><surname>Kreft</surname><firstname>Klaus</firstname></personname></author>
d563 7
a569 7
      <title>
	<link xmlns:xlink="http://www.w3.org/1999/xlink"
	      xlink:href="http://www.oracle.com/technetwork/java/api/index.html">
	API Specifications, Java Platform
	</link>
      </title>

a574 1

d576 8
a583 8
      <title>
	<link xmlns:xlink="http://www.w3.org/1999/xlink"
	      xlink:href="https://www.gnu.org/software/gettext/">
      GNU gettext tools, version 0.10.38, Native Language Support
      Library and Tools.
	</link>
      </title>

@


1.1.1.1.2.1
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d1 1
a1 2
<section xmlns="http://docbook.org/ns/docbook" version="5.0" 
	 xml:id="manual.localization.facet.messages" xreflabel="Messages">
d4 1
a4 1
<info><title>messages</title>
d6 6
a11 2
    <keyword>ISO C++</keyword>
    <keyword>messages</keyword>
d13 1
a13 2
</info>

d15 1
d23 2
a24 2
<section xml:id="facet.messages.req"><info><title>Requirements</title></info>

d111 2
a112 2
<section xml:id="facet.messages.design"><info><title>Design</title></info>

d121 2
a122 3
<code>catopen</code> and define <code>nl_catd</code> as int, but not for
others. Fortunately, it's not heavily used and so only a minor irritant. 
This has been reported as a possible defect in the standard (LWG 2028).
d160 2
a161 1
<section xml:id="facet.messages.impl"><info><title>Implementation</title></info>
d163 2
a164 3

  <section xml:id="messages.impl.models"><info><title>Models</title></info>
  
d231 2
a232 2
  <section xml:id="messages.impl.gnu"><info><title>The GNU Model</title></info>
  
d324 2
a325 2
<section xml:id="facet.messages.use"><info><title>Use</title></info>

d354 2
a355 2
<section xml:id="facet.messages.future"><info><title>Future</title></info>

d441 2
a442 2
<bibliography xml:id="facet.messages.biblio"><info><title>Bibliography</title></info>

d445 1
a445 1
    <citetitle>
d447 9
a455 3
    </citetitle>
    <author><personname><surname>McGrath</surname><firstname>Roland</firstname></personname></author>
    <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
d465 1
a465 1
    <citetitle>
d467 5
a471 2
    </citetitle>
    <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
d474 1
a474 1
      <holder/>
d479 1
a479 1
    <citetitle>
d481 1
a481 1
    </citetitle>
d489 1
a489 1
    <citetitle>
d491 1
a491 1
    </citetitle>
d500 8
a507 7
      <title>
	<link xmlns:xlink="http://www.w3.org/1999/xlink"
	      xlink:href="http://www.opengroup.org/austin/">
      System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
	</link>
      </title>
        <copyright>
d517 1
a517 1
    <citetitle>
d519 5
a523 2
    </citetitle>
    <author><personname><surname>Stroustrup</surname><firstname>Bjarne</firstname></personname></author>
d537 1
a537 1
    <citetitle>
d539 1
a539 1
    </citetitle>
d543 8
a550 2
    <author><personname><surname>Langer</surname><firstname>Angelika</firstname></personname></author>
    <author><personname><surname>Kreft</surname><firstname>Klaus</firstname></personname></author>
d563 7
a569 7
      <title>
	<link xmlns:xlink="http://www.w3.org/1999/xlink"
	      xlink:href="http://www.oracle.com/technetwork/java/api/index.html">
	API Specifications, Java Platform
	</link>
      </title>

a574 1

d576 8
a583 8
      <title>
	<link xmlns:xlink="http://www.w3.org/1999/xlink"
	      xlink:href="https://www.gnu.org/software/gettext/">
      GNU gettext tools, version 0.10.38, Native Language Support
      Library and Tools.
	</link>
      </title>

@


1.1.1.2
log
@import GCC 4.8 branch at r206687.

highlights from: http://gcc.gnu.org/gcc-4.6/changes.html

   GCC now has stricter checks for invalid command-line options
   New -Wunused-but-set-variable and -Wunused-but-set-parameter
      warnings
   Many platforms have been obsoleted
   Link-time optimization improvements
   A new switch -fstack-usage has been added
   A new function attribute leaf was introduced
   A new warning, enabled by -Wdouble-promotion
   Support for selectively enabling and disabling warnings via
      #pragma GCC diagnostic has been added
   There is now experimental support for some features from the
      upcoming C1X revision of the ISO C standard
   Improved experimental support for the upcoming C++0x ISO C++
      standard
   G++ now issues clearer diagnostics in several cases
   Updates for ARM, x86, MIPS, PPC/PPC64, SPARC
   Darwin, FreeBSD, Solaris 2, MinGW and Cygwin now all support
      __float128 on 32-bit and 64-bit x86 targets. [*1]

highlights from: http://gcc.gnu.org/gcc-4.7/changes.html

   The -fconserve-space flag has been deprecated
   Support for a new parameter --param case-values-threshold=n
      was added
   Interprocedural and Link-time optimization improvements
   A new built-in, __builtin_assume_aligned, has been added
   A new warning option -Wunused-local-typedefs was added
   A new experimental command-line option -ftrack-macro-expansion
      was added
   Support for atomic operations specifying the C++11/C11 memory
      model has been added
   There is support for some more features from the C11 revision
      of the ISO C standard
   Improved experimental support for the new ISO C++ standard,
      C++11
   Updates for ARM, x86, MIPS, PPC/PPC64, SH, SPARC, TILE*
   A new option (-grecord-gcc-switches) was added

highlights from: http://gcc.gnu.org/gcc-4.8/changes.html

   GCC now uses C++ as its implementation language.  This means
      that to build GCC from sources, you will need a C++
      compiler that understands C++ 2003
   DWARF4 is now the default when generating DWARF debug
      information
   A new general optimization level, -Og, has been introduced
   A new option -ftree-partial-pre was added
   The option -fconserve-space has been removed
   The command-line options -fipa-struct-reorg and
      -fipa-matrix-reorg have been removed
   Interprocedural and Link-time optimization improvements
   AddressSanitizer, a fast memory error detector, has been
      added  [*2]
   A new -Wsizeof-pointer-memaccess warning has been added
   G++ now supports a -std=c++1y option for experimentation
      with features proposed for the next revision of the
      standard, expected around 2014
   Improved experimental support for the new ISO C++ standard,
      C++11
   A new port has been added to support AArch64
   Updates for ARM, x86, MIPS, PPC/PPC64, SH, SPARC, TILE*


[*1] we should support this too!
[*2] we should look into this.
     https://code.google.com/p/address-sanitizer/
@
text
@d1 1
a1 2
<section xmlns="http://docbook.org/ns/docbook" version="5.0" 
	 xml:id="manual.localization.facet.messages" xreflabel="Messages">
d4 1
a4 1
<info><title>messages</title>
d6 6
a11 2
    <keyword>ISO C++</keyword>
    <keyword>messages</keyword>
d13 1
a13 2
</info>

d15 1
d23 2
a24 2
<section xml:id="facet.messages.req"><info><title>Requirements</title></info>

d111 2
a112 2
<section xml:id="facet.messages.design"><info><title>Design</title></info>

d121 2
a122 3
<code>catopen</code> and define <code>nl_catd</code> as int, but not for
others. Fortunately, it's not heavily used and so only a minor irritant. 
This has been reported as a possible defect in the standard (LWG 2028).
d160 2
a161 1
<section xml:id="facet.messages.impl"><info><title>Implementation</title></info>
d163 2
a164 3

  <section xml:id="messages.impl.models"><info><title>Models</title></info>
  
d231 2
a232 2
  <section xml:id="messages.impl.gnu"><info><title>The GNU Model</title></info>
  
d324 2
a325 2
<section xml:id="facet.messages.use"><info><title>Use</title></info>

d354 2
a355 2
<section xml:id="facet.messages.future"><info><title>Future</title></info>

d441 2
a442 2
<bibliography xml:id="facet.messages.biblio"><info><title>Bibliography</title></info>

d445 1
a445 1
    <citetitle>
d447 9
a455 3
    </citetitle>
    <author><personname><surname>McGrath</surname><firstname>Roland</firstname></personname></author>
    <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
d465 1
a465 1
    <citetitle>
d467 5
a471 2
    </citetitle>
    <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
d474 1
a474 1
      <holder/>
d479 1
a479 1
    <citetitle>
d481 1
a481 1
    </citetitle>
d489 1
a489 1
    <citetitle>
d491 1
a491 1
    </citetitle>
d500 8
a507 7
      <title>
	<link xmlns:xlink="http://www.w3.org/1999/xlink"
	      xlink:href="http://www.opengroup.org/austin/">
      System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
	</link>
      </title>
        <copyright>
d517 1
a517 1
    <citetitle>
d519 5
a523 2
    </citetitle>
    <author><personname><surname>Stroustrup</surname><firstname>Bjarne</firstname></personname></author>
d537 1
a537 1
    <citetitle>
d539 1
a539 1
    </citetitle>
d543 8
a550 2
    <author><personname><surname>Langer</surname><firstname>Angelika</firstname></personname></author>
    <author><personname><surname>Kreft</surname><firstname>Klaus</firstname></personname></author>
d563 7
a569 7
      <title>
	<link xmlns:xlink="http://www.w3.org/1999/xlink"
	      xlink:href="http://www.oracle.com/technetwork/java/api/index.html">
	API Specifications, Java Platform
	</link>
      </title>

a574 1

d576 8
a583 8
      <title>
	<link xmlns:xlink="http://www.w3.org/1999/xlink"
	      xlink:href="https://www.gnu.org/software/gettext/">
      GNU gettext tools, version 0.10.38, Native Language Support
      Library and Tools.
	</link>
      </title>

@


1.1.1.3
log
@import GCC 5.3.0.  see these urls for details which are too large to
include here:

	http://gcc.gnu.org/gcc-4.9/changes.html
	http://gcc.gnu.org/gcc-5/changes.html

(note that GCC 5.x is a release stream like GCC 4.9.x, 4.8.x, etc.)


the main issues we will have are:

The default mode for C is now -std=gnu11 instead of -std=gnu89.

ARM:
The deprecated option -mwords-little-endian has been removed.
The options -mapcs, -mapcs-frame, -mtpcs-frame and -mtpcs-leaf-frame
 which are only applicable to the old ABI have been deprecated.

MIPS:
The o32 ABI has been modified and extended. The o32 64-bit
 floating-point register support is now obsolete and has been removed.
 It has been replaced by three ABI extensions FPXX, FP64A, and FP64.
 The meaning of the -mfp64 command-line option has changed. It is now
 used to enable the FP64A and FP64 ABI extensions.
@
text
@d2 1
a2 1
	 xml:id="std.localization.facet.messages" xreflabel="Messages">
d15 2
a16 2
The <classname>std::messages</classname> facet implements message retrieval functionality
equivalent to Java's <classname>java.text.MessageFormat</classname> using either GNU <function>gettext</function>
d24 1
a24 1
The <classname>std::messages</classname> facet is probably the most vaguely defined facet in
d64 1
a64 1
<code>catalog do_open(const string&amp; name, const locale&amp; loc) const</code>
d69 2
a70 2
-1- Returns: A value that may be passed to <code>get()</code> to retrieve a
message, from the message catalog identified by the string <code>name</code>
d72 1
a72 1
until it is passed to <code>close()</code>.  Returns a value less than 0 if no such
d79 1
a79 1
<code>string_type do_get(catalog cat, int set , int msgid, const string_type&amp; dfault) const</code>
d84 2
a85 2
-3- Requires: A catalog <code>cat</code> obtained from <code>open()</code> and not yet closed.
-4- Returns: A message identified by arguments <code>set</code>, <code>msgid</code>, and <code>dfault</code>,
d87 1
a87 1
be found, returns <code>dfault</code>.
d93 1
a93 1
<code>void do_close(catalog cat) const</code>
d98 2
a99 2
-5- Requires: A catalog cat obtained from <code>open()</code> and not yet closed.
-6- Effects: Releases unspecified resources associated with <code>cat</code>.
d491 1
a491 1
	      xlink:href="http://pubs.opengroup.org/onlinepubs/9699919799/">
@


1.1.1.4
log
@initial import of GCC 9.3.0.  changes include:

- live patching support
- shell completion help
- generally better diagnostic output (less verbose/more useful)
- diagnostics and optimisation choices can be emitted in json
- asan memory usage reduction
- many general, and specific to switch, inter-procedure,
  profile and link-time optimisations.  from the release notes:
  "Overall compile time of Firefox 66 and LibreOffice 6.2.3 on
  an 8-core machine was reduced by about 5% compared to GCC 8.3"
- OpenMP 5.0 support
- better spell-guesser
- partial experimental support for c2x and c++2a
- c++17 is no longer experimental
- arm AAPCS GCC 6-8 structure passing bug fixed, may cause
  incompatibility (restored compat with GCC 5 and earlier.)
- openrisc support
@
text
@d544 1
a544 1
	      xlink:href="https://www.oracle.com/technetwork/java/api/index.html">
@


1.1.1.5
log
@initial import of GCC 10.3.0.  main changes include:

caveats:
- ABI issue between c++14 and c++17 fixed
- profile mode is removed from libstdc++
- -fno-common is now the default

new features:
- new flags -fallocation-dce, -fprofile-partial-training,
  -fprofile-reproducible, -fprofile-prefix-path, and -fanalyzer
- many new compile and link time optimisations
- enhanced drive optimisations
- openacc 2.6 support
- openmp 5.0 features
- new warnings: -Wstring-compare and -Wzero-length-bounds
- extended warnings: -Warray-bounds, -Wformat-overflow,
  -Wrestrict, -Wreturn-local-addr, -Wstringop-overflow,
  -Warith-conversion, -Wmismatched-tags, and -Wredundant-tags
- some likely C2X features implemented
- more C++20 implemented
- many new arm & intel CPUs known

hundreds of reported bugs are fixed.  full list of changes
can be found at:

   https://gcc.gnu.org/gcc-10/changes.html
@
text
@d491 1
a491 1
	      xlink:href="https://pubs.opengroup.org/onlinepubs/9699919799/">
@


1.1.1.6
log
@initial import of GCC 12.3.0.

major changes in GCC 11 included:

- The default mode for C++ is now -std=gnu++17 instead of -std=gnu++14.
- When building GCC itself, the host compiler must now support C++11,
  rather than C++98.
- Some short options of the gcov tool have been renamed: -i to -j and
  -j to -H.
- ThreadSanitizer improvements.
- Introduce Hardware-assisted AddressSanitizer support.
- For targets that produce DWARF debugging information GCC now defaults
  to DWARF version 5. This can produce up to 25% more compact debug
  information compared to earlier versions.
- Many optimisations.
- The existing malloc attribute has been extended so that it can be
  used to identify allocator/deallocator API pairs. A pair of new
  -Wmismatched-dealloc and -Wmismatched-new-delete warnings are added.
- Other new warnings:
  -Wsizeof-array-div, enabled by -Wall, warns about divisions of two
    sizeof operators when the first one is applied to an array and the
    divisor does not equal the size of the array element.
  -Wstringop-overread, enabled by default, warns about calls to string
    functions reading past the end of the arrays passed to them as
    arguments.
  -Wtsan, enabled by default, warns about unsupported features in
    ThreadSanitizer (currently std::atomic_thread_fence).
- Enchanced warnings:
  -Wfree-nonheap-object detects many more instances of calls to
    deallocation functions with pointers not returned from a dynamic
    memory allocation function.
  -Wmaybe-uninitialized diagnoses passing pointers or references to
    uninitialized memory to functions taking const-qualified arguments.
  -Wuninitialized detects reads from uninitialized dynamically
    allocated memory.
  -Warray-parameter warns about functions with inconsistent array forms.
  -Wvla-parameter warns about functions with inconsistent VLA forms.
- Several new features from the upcoming C2X revision of the ISO C
  standard are supported with -std=c2x and -std=gnu2x.
- Several C++20 features have been implemented.
- The C++ front end has experimental support for some of the upcoming
  C++23 draft.
- Several new C++ warnings.
- Enhanced Arm, AArch64, x86, and RISC-V CPU support.
- The implementation of how program state is tracked within
  -fanalyzer has been completely rewritten with many enhancements.

see https://gcc.gnu.org/gcc-11/changes.html for a full list.

major changes in GCC 12 include:

- An ABI incompatibility between C and C++ when passing or returning
  by value certain aggregates containing zero width bit-fields has
  been discovered on various targets. x86-64, ARM and AArch64
  will always ignore them (so there is a C ABI incompatibility
  between GCC 11 and earlier with GCC 12 or later), PowerPC64 ELFv2
  always take them into account (so there is a C++ ABI
  incompatibility, GCC 4.4 and earlier compatible with GCC 12 or
  later, incompatible with GCC 4.5 through GCC 11). RISC-V has
  changed the handling of these already starting with GCC 10. As
  the ABI requires, MIPS takes them into account handling function
  return values so there is a C++ ABI incompatibility with GCC 4.5
  through 11.
- STABS: Support for emitting the STABS debugging format is
  deprecated and will be removed in the next release. All ports now
  default to emit DWARF (version 2 or later) debugging info or are
  obsoleted.
- Vectorization is enabled at -O2 which is now equivalent to the
  original -O2 -ftree-vectorize -fvect-cost-model=very-cheap.
- GCC now supports the ShadowCallStack sanitizer.
- Support for __builtin_shufflevector compatible with the clang
  language extension was added.
- Support for attribute unavailable was added.
- Support for __builtin_dynamic_object_size compatible with the
  clang language extension was added.
- New warnings:
  -Wbidi-chars warns about potentially misleading UTF-8
    bidirectional control characters.
  -Warray-compare warns about comparisons between two operands of
    array type.
- Some new features from the upcoming C2X revision of the ISO C
  standard are supported with -std=c2x and -std=gnu2x.
- Several C++23 features have been implemented.
- Many C++ enhancements across warnings and -f options.

see https://gcc.gnu.org/gcc-12/changes.html for a full list.
@
text
@d1 1
a1 1
<section xmlns="http://docbook.org/ns/docbook" version="5.0"
d119 1
a119 1
others. Fortunately, it's not heavily used and so only a minor irritant.
d162 1
a162 1

d230 1
a230 1

d544 1
a544 1
	      xlink:href="https://docs.oracle.com/en/java/">
@


