stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r448754 [6/6] - /incubator/stdcxx/trunk/util/
Date Fri, 22 Sep 2006 00:42:17 GMT
Modified: incubator/stdcxx/trunk/util/localedef.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/localedef.cpp?view=diff&rev=448754&r1=448753&r2=448754
==============================================================================
--- incubator/stdcxx/trunk/util/localedef.cpp (original)
+++ incubator/stdcxx/trunk/util/localedef.cpp Thu Sep 21 17:42:16 2006
@@ -2,7 +2,7 @@
  *
  * localedef.cpp
  *
- * $Id: //stdlib/dev/source/stdlib/util/localedef.cpp#248 $
+ * $Id$
  *
  ***************************************************************************
  *
@@ -100,6 +100,7 @@
         "\t-w###\n"
         "\t\tDisable warning number ###.\n"
         "\n"
+        "\t--notes\tEnable notes (informational messages).\n"
         "\t-?\n"
         "\t--help\tPrint out this message.\n";
 
@@ -233,7 +234,7 @@
     issue_diag (I_STAGE, false, 0, "generating LC_CTYPE database\n");
     def.write_ctype (locale_dir);
 
-    issue_diag (I_STAGE, false, 0, "generating codecvt database\n");
+    issue_diag (I_STAGE, false, 0, "generating codeset database\n");
     def.write_codecvt (locale_dir);
 
     issue_diag (I_STAGE, false, 0, "generating LC_MONETARY database\n");

Modified: incubator/stdcxx/trunk/util/messages.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/messages.cpp?view=diff&rev=448754&r1=448753&r2=448754
==============================================================================
--- incubator/stdcxx/trunk/util/messages.cpp (original)
+++ incubator/stdcxx/trunk/util/messages.cpp Thu Sep 21 17:42:16 2006
@@ -2,20 +2,27 @@
  *
  * messages.cpp
  *
- * $Id: //stdlib/dev/source/stdlib/util/messages.cpp#4 $
+ * $Id$
  *
  ***************************************************************************
  *
- * Copyright (c) 1994-2005 Quovadx,  Inc., acting through its  Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License");  you may  not use this file except  in compliance with the
- * License.    You    may   obtain   a   copy   of    the   License    at
- * http://www.apache.org/licenses/LICENSE-2.0.    Unless   required    by
- * applicable law  or agreed to  in writing,  software  distributed under
- * the License is distributed on an "AS IS" BASIS,  WITHOUT WARRANTIES OR
- * CONDITIONS OF  ANY KIND, either  express or implied.  See  the License
- * for the specific language governing permissions  and limitations under
- * the License.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  "License"); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2001-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 
@@ -28,9 +35,14 @@
 #include <fstream>        // for ofstream
 
 
+static const char lc_name[] = "LC_MESSAGES";
+
+
 void Def::process_messages()
 {
-    // nexting level
+    issue_diag (I_STAGE, false, 0, "processing %s section\n", lc_name);
+
+    // nesting level
     int nesting_level = 0;
 
     messages_def_found_ = true;
@@ -76,7 +88,7 @@
                    != Scanner::tok_messages ){
                 // the LC_IDENTIFICATION section may also have a 
                 // LC_MESSAGES token that will mess up the parsing
-                if (next.token == Scanner::tok_identification) {
+                if (next.token == Scanner::tok_ident) {
                     while ((next = scanner_.next_token()).token
                            != Scanner::tok_end );
                     next = scanner_.next_token();
@@ -110,44 +122,50 @@
 {
     assert (!dir_name.empty());
     
-    if (messages_def_found_ && !messages_written_) {
+    if (messages_written_)
+        return;
+
+    if (!messages_def_found_) {
+        issue_diag (I_SKIP, false, 0,
+                    "%s section not found, skipping\n", lc_name);
+        return;
+    }
 
-        (dir_name += _RWSTD_PATH_SEP) += "LC_MESSAGES";
+    (dir_name += _RWSTD_PATH_SEP) += lc_name;
 
-        issue_diag (I_OPENWR, false, 0, "writing %s\n", dir_name.c_str ());
+    issue_diag (I_OPENWR, false, 0, "writing %s\n", dir_name.c_str ());
 
-        std::ofstream out (dir_name.c_str(), std::ios::binary);
-        out.exceptions (std::ios::failbit | std::ios::badbit);
+    std::ofstream out (dir_name.c_str(), std::ios::binary);
+    out.exceptions (std::ios::failbit | std::ios::badbit);
 
-        // now calculate the offsets for the wide string representations
-        messages_out_.yesexpr_off[1] = 0;
-        messages_out_.noexpr_off[1] = messages_out_.yesexpr_off[1] 
-            + (messages_st_.wyesexpr.size() + 1) * sizeof (wchar_t) ;
+    // now calculate the offsets for the wide string representations
+    messages_out_.yesexpr_off[1] = 0;
+    messages_out_.noexpr_off[1] = messages_out_.yesexpr_off[1] 
+        + (messages_st_.wyesexpr.size() + 1) * sizeof (wchar_t) ;
         
-        // now calculate the offsets for the narrow string representations
-        messages_out_.yesexpr_off[0] = messages_out_.noexpr_off[1] 
-            + (messages_st_.wnoexpr.size() + 1) * sizeof (wchar_t);
-        messages_out_.noexpr_off[0] = messages_out_.yesexpr_off[0] 
-            + (messages_st_.yesexpr.size() + 1) * sizeof (char);
-
-        messages_out_.codeset_off = messages_out_.noexpr_off[0] 
-            + (messages_st_.noexpr.size() + 1) * sizeof (char);
-        messages_out_.charmap_off = messages_out_.codeset_off 
-            + (charmap_.get_code_set_name().size() + 1) * sizeof (char);
-
-        // first write out the messages structure
-        out.write ((char*)&messages_out_, sizeof(messages_out_));
-
-        // now write out all the strings
-        out.write ((const char*)messages_st_.wyesexpr.c_str(), 
-                   (messages_st_.wyesexpr.size() + 1) * sizeof (wchar_t));
-        out.write ((const char*)messages_st_.wnoexpr.c_str(), 
-                   (messages_st_.wnoexpr.size() + 1) * sizeof (wchar_t));
-
-        out << messages_st_.yesexpr << std::ends;
-        out << messages_st_.noexpr << std::ends;
-        out << charmap_.get_code_set_name() << std::ends;
-        out << charmap_.get_charmap_name() << std::ends;
-        out.close();
-    }
+    // now calculate the offsets for the narrow string representations
+    messages_out_.yesexpr_off[0] = messages_out_.noexpr_off[1] 
+        + (messages_st_.wnoexpr.size() + 1) * sizeof (wchar_t);
+    messages_out_.noexpr_off[0] = messages_out_.yesexpr_off[0] 
+        + (messages_st_.yesexpr.size() + 1) * sizeof (char);
+
+    messages_out_.codeset_off = messages_out_.noexpr_off[0] 
+        + (messages_st_.noexpr.size() + 1) * sizeof (char);
+    messages_out_.charmap_off = messages_out_.codeset_off 
+        + (charmap_.get_code_set_name().size() + 1) * sizeof (char);
+
+    // first write out the messages structure
+    out.write ((char*)&messages_out_, sizeof(messages_out_));
+
+    // now write out all the strings
+    out.write ((const char*)messages_st_.wyesexpr.c_str(), 
+               (messages_st_.wyesexpr.size() + 1) * sizeof (wchar_t));
+    out.write ((const char*)messages_st_.wnoexpr.c_str(), 
+               (messages_st_.wnoexpr.size() + 1) * sizeof (wchar_t));
+
+    out << messages_st_.yesexpr << std::ends;
+    out << messages_st_.noexpr << std::ends;
+    out << charmap_.get_code_set_name() << std::ends;
+    out << charmap_.get_charmap_name() << std::ends;
+    out.close();
 }

Modified: incubator/stdcxx/trunk/util/monetary.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/monetary.cpp?view=diff&rev=448754&r1=448753&r2=448754
==============================================================================
--- incubator/stdcxx/trunk/util/monetary.cpp (original)
+++ incubator/stdcxx/trunk/util/monetary.cpp Thu Sep 21 17:42:16 2006
@@ -2,20 +2,27 @@
  *
  * monetary.cpp
  *
- * $Id: //stdlib/dev/source/stdlib/util/monetary.cpp#5 $
+ * $Id$
  *
  ***************************************************************************
  *
- * Copyright (c) 1994-2005 Quovadx,  Inc., acting through its  Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License");  you may  not use this file except  in compliance with the
- * License.    You    may   obtain   a   copy   of    the   License    at
- * http://www.apache.org/licenses/LICENSE-2.0.    Unless   required    by
- * applicable law  or agreed to  in writing,  software  distributed under
- * the License is distributed on an "AS IS" BASIS,  WITHOUT WARRANTIES OR
- * CONDITIONS OF  ANY KIND, either  express or implied.  See  the License
- * for the specific language governing permissions  and limitations under
- * the License.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  "License"); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2001-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 
@@ -30,8 +37,13 @@
 #include <locale>         // for money_base
 
 
+static const char lc_name[] = "LC_MONETARY";
+
+
 void Def::process_monetary()
 {
+    issue_diag (I_STAGE, false, 0, "processing %s section\n", lc_name);
+
     // nexting level
     int nesting_level = 0;
 
@@ -77,7 +89,7 @@
                    != Scanner::tok_monetary ){
                 // the LC_IDENTIFICATION section may also have a 
                 // LC_MONETARY token that will mess up the parsing
-                if (next.token == Scanner::tok_identification) {
+                if (next.token == Scanner::tok_ident) {
                     while ((next = scanner_.next_token()).token
                            != Scanner::tok_end );
                     next = scanner_.next_token();
@@ -456,10 +468,14 @@
 {
     assert (!dir_name.empty());
 
-    if (!mon_def_found_ || mon_written_)
+    if (mon_written_)
         return;
 
-    static const char lc_name[] = "LC_MONETARY";
+    if (!mon_def_found_) {
+        issue_diag (I_SKIP, false, 0,
+                    "%s section not found, skipping\n", lc_name);
+        return;
+    }
 
     // write out all the information in the LC_MONETARY category
     (dir_name += _RWSTD_PATH_SEP) += lc_name;

Modified: incubator/stdcxx/trunk/util/numeric.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/numeric.cpp?view=diff&rev=448754&r1=448753&r2=448754
==============================================================================
--- incubator/stdcxx/trunk/util/numeric.cpp (original)
+++ incubator/stdcxx/trunk/util/numeric.cpp Thu Sep 21 17:42:16 2006
@@ -2,20 +2,27 @@
  *
  * numeric.cpp
  *
- * $Id: //stdlib/dev/source/stdlib/util/numeric.cpp#5 $
+ * $Id$
  *
  ***************************************************************************
  *
- * Copyright (c) 1994-2005 Quovadx,  Inc., acting through its  Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License");  you may  not use this file except  in compliance with the
- * License.    You    may   obtain   a   copy   of    the   License    at
- * http://www.apache.org/licenses/LICENSE-2.0.    Unless   required    by
- * applicable law  or agreed to  in writing,  software  distributed under
- * the License is distributed on an "AS IS" BASIS,  WITHOUT WARRANTIES OR
- * CONDITIONS OF  ANY KIND, either  express or implied.  See  the License
- * for the specific language governing permissions  and limitations under
- * the License.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  "License"); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2001-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 
@@ -29,9 +36,14 @@
 #include <fstream>        // for ofstream
 
 
+static const char lc_name[] = "LC_NUMERIC";
+
+
 void Def::process_numeric ()
 {
-    // nexting level
+    issue_diag (I_STAGE, false, 0, "processing %s section\n", lc_name);
+
+    // nesting level
     int nesting_level = 0;
 
     num_def_found_ = true;
@@ -75,7 +87,7 @@
                    != Scanner::tok_numeric ){
                 // the LC_IDENTIFICATION section may also have a 
                 // LC_NUMERIC token that will mess up the parsing
-                if (next.token == Scanner::tok_identification) {
+                if (next.token == Scanner::tok_ident) {
                     while ((next = scanner_.next_token()).token
                            != Scanner::tok_end );
                     next = scanner_.next_token();
@@ -129,136 +141,140 @@
 {
     assert (!dir_name.empty ());
 
-    static const char lc_name[] = "LC_NUMERIC";
+    if (num_written_)
+        return;
+
+    if (!num_def_found_) {
+        issue_diag (I_SKIP, false, 0,
+                    "%s section not found, skipping\n", lc_name);
+        return;
+    }
 
-    if (num_def_found_ && !num_written_) {
+    (dir_name += _RWSTD_PATH_SEP) += lc_name;
 
-        (dir_name += _RWSTD_PATH_SEP) += lc_name;
+    issue_diag (I_OPENWR, false, 0, "writing %s\n", dir_name.c_str ());
 
-        issue_diag (I_OPENWR, false, 0, "writing %s\n", dir_name.c_str ());
+    std::ofstream out (dir_name.c_str (), std::ios::binary);
+    out.exceptions (std::ios::failbit | std::ios::badbit);
 
-        std::ofstream out (dir_name.c_str (), std::ios::binary);
-        out.exceptions (std::ios::failbit | std::ios::badbit);
-
-        // calculate the offsets of members of the num_punct struct
-
-        // start with wide strings to simplify dealing with their alignment
-        num_punct_out_.decimal_point_off [1] = 0;
-
-        num_punct_out_.thousands_sep_off [1] = 
-              num_punct_out_.decimal_point_off [1] 
-            + (num_st_.wdecimal_point.size () + 1) * sizeof (wchar_t);
-
-        num_punct_out_.decimal_point_off [0] = 
-              num_punct_out_.thousands_sep_off [1]
-            + (num_st_.wthousands_sep.size() + 1) * sizeof (wchar_t);
-
-        num_punct_out_.thousands_sep_off [0] = 
-              num_punct_out_.decimal_point_off [0] 
-            + num_st_.decimal_point.size () + 1;
-
-        num_punct_out_.grouping_off =
-              num_punct_out_.thousands_sep_off [0]
-            + num_st_.thousands_sep.size () + 1;
-
-        num_punct_out_.punct_ext_off =
-              num_punct_out_.grouping_off
-            + num_st_.grouping.size () + 1;
-
-        // compute the alignment requirement of any offset member
-        const std::size_t align = sizeof num_punct_out_.punct_ext_off;
-
-        // align the offset of the extension struct on the required boundary
-        const std::size_t misalign = num_punct_out_.punct_ext_off % align;
-
-        // compute the amount of padding between the two structs
-        const std::size_t pad = misalign ? align - misalign : 0;
-
-        num_punct_out_.punct_ext_off += pad;
-
-        // calculate the offsets of members of the numeric extension struct
-
-        num_out_.truename_off [1] = 0;
-
-        num_out_.falsename_off [1] =
-              num_out_.truename_off [1]
-            + (num_st_.wtruename.size() + 1) * sizeof (wchar_t);
-
-        num_out_.truename_off [0] =
-              num_out_.falsename_off [1]
-            + (num_st_.wfalsename.size() + 1) * sizeof (wchar_t);
-
-        num_out_.falsename_off [0] =
-              num_out_.truename_off [0]
-            + num_st_.truename.size() + 1;
-
-        num_out_.codeset_off =
-              num_out_.falsename_off [0]
-            + num_st_.falsename.size() + 1;
-
-        num_out_.charmap_off =
-              num_out_.codeset_off
-            + charmap_.get_code_set_name().size() + 1;
-
-        issue_diag (I_WRITE, false, 0,
-                    "%s layout:\n"
-                    "__rw_punct_t {\n"
-                    "    decimal_point_off[] = { %u, %u }\n"
-                    "    thousand_sep_off[] = { %u, %u }\n"
-                    "    grouping_off = %u\n"
-                    "    ext_off = %u\n"
-                    "}\n__rw_numpunct_t {\n"
-                    "    falsename_off[] = { %u, %u }\n"
-                    "    truename_off[] = { %u, %u }\n"
-                    "    codeset_off = %u\n"
-                    "    charmap_off = %u\n"
-                    "}\n",
-                    lc_name,
-                    num_punct_out_.decimal_point_off [0],
-                    num_punct_out_.decimal_point_off [1],
-                    num_punct_out_.thousands_sep_off [0],
-                    num_punct_out_.thousands_sep_off [1],
-                    num_punct_out_.grouping_off,
-                    num_punct_out_.punct_ext_off,
-                    num_out_.falsename_off [0],
-                    num_out_.falsename_off [1],
-                    num_out_.truename_off [0],
-                    num_out_.truename_off [1],
-                    num_out_.codeset_off,
-                    num_out_.charmap_off);
+    // calculate the offsets of members of the num_punct struct
+
+    // start with wide strings to simplify dealing with their alignment
+    num_punct_out_.decimal_point_off [1] = 0;
+
+    num_punct_out_.thousands_sep_off [1] = 
+        num_punct_out_.decimal_point_off [1] 
+        + (num_st_.wdecimal_point.size () + 1) * sizeof (wchar_t);
+
+    num_punct_out_.decimal_point_off [0] = 
+        num_punct_out_.thousands_sep_off [1]
+        + (num_st_.wthousands_sep.size() + 1) * sizeof (wchar_t);
+
+    num_punct_out_.thousands_sep_off [0] = 
+        num_punct_out_.decimal_point_off [0] 
+        + num_st_.decimal_point.size () + 1;
+
+    num_punct_out_.grouping_off =
+        num_punct_out_.thousands_sep_off [0]
+        + num_st_.thousands_sep.size () + 1;
+
+    num_punct_out_.punct_ext_off =
+        num_punct_out_.grouping_off
+        + num_st_.grouping.size () + 1;
+
+    // compute the alignment requirement of any offset member
+    const std::size_t align = sizeof num_punct_out_.punct_ext_off;
+
+    // align the offset of the extension struct on the required boundary
+    const std::size_t misalign = num_punct_out_.punct_ext_off % align;
+
+    // compute the amount of padding between the two structs
+    const std::size_t pad = misalign ? align - misalign : 0;
+
+    num_punct_out_.punct_ext_off += pad;
+
+    // calculate the offsets of members of the numeric extension struct
+
+    num_out_.truename_off [1] = 0;
+
+    num_out_.falsename_off [1] =
+        num_out_.truename_off [1]
+        + (num_st_.wtruename.size() + 1) * sizeof (wchar_t);
+
+    num_out_.truename_off [0] =
+        num_out_.falsename_off [1]
+        + (num_st_.wfalsename.size() + 1) * sizeof (wchar_t);
+
+    num_out_.falsename_off [0] =
+        num_out_.truename_off [0]
+        + num_st_.truename.size() + 1;
+
+    num_out_.codeset_off =
+        num_out_.falsename_off [0]
+        + num_st_.falsename.size() + 1;
+
+    num_out_.charmap_off =
+        num_out_.codeset_off
+        + charmap_.get_code_set_name().size() + 1;
+
+    issue_diag (I_WRITE, false, 0,
+                "%s layout:\n"
+                "__rw_punct_t {\n"
+                "    decimal_point_off[] = { %u, %u }\n"
+                "    thousand_sep_off[] = { %u, %u }\n"
+                "    grouping_off = %u\n"
+                "    ext_off = %u\n"
+                "}\n__rw_numpunct_t {\n"
+                "    falsename_off[] = { %u, %u }\n"
+                "    truename_off[] = { %u, %u }\n"
+                "    codeset_off = %u\n"
+                "    charmap_off = %u\n"
+                "}\n",
+                lc_name,
+                num_punct_out_.decimal_point_off [0],
+                num_punct_out_.decimal_point_off [1],
+                num_punct_out_.thousands_sep_off [0],
+                num_punct_out_.thousands_sep_off [1],
+                num_punct_out_.grouping_off,
+                num_punct_out_.punct_ext_off,
+                num_out_.falsename_off [0],
+                num_out_.falsename_off [1],
+                num_out_.truename_off [0],
+                num_out_.truename_off [1],
+                num_out_.codeset_off,
+                num_out_.charmap_off);
             
-        // write the num_punct struct
-        out.write ((char*)&num_punct_out_, sizeof (num_punct_out_));
+    // write the num_punct struct
+    out.write ((char*)&num_punct_out_, sizeof (num_punct_out_));
         
-        // write out the strings in the num_punct struct
-        out.write ((const char*)num_st_.wdecimal_point.c_str (),
-                   (num_st_.wdecimal_point.size() + 1) * sizeof (wchar_t));
-        out.write ((const char*)num_st_.wthousands_sep.c_str(),
-                   (num_st_.wthousands_sep.size() + 1) * sizeof(wchar_t));
+    // write out the strings in the num_punct struct
+    out.write ((const char*)num_st_.wdecimal_point.c_str (),
+               (num_st_.wdecimal_point.size() + 1) * sizeof (wchar_t));
+    out.write ((const char*)num_st_.wthousands_sep.c_str(),
+               (num_st_.wthousands_sep.size() + 1) * sizeof(wchar_t));
         
-        out << num_st_.decimal_point << std::ends
-            << num_st_.thousands_sep << std::ends
-            << num_st_.grouping << std::ends;
-
-        // pad the structure up to the next alignment boundary
-        out.write ("\0\0\0\0\0\0\0\0", pad);
-
-        // write the numeric offset extension struct
-        out.write ((char*)&num_out_, sizeof (num_out_));
-
-        // write all the wide character strings
-        out.write ((const char*)num_st_.wtruename.c_str(),
-                   (num_st_.wtruename.size() + 1) * sizeof (wchar_t));
-        out.write ((const char*)num_st_.wfalsename.c_str(),
-                   (num_st_.wfalsename.size() + 1) * sizeof (wchar_t));
+    out << num_st_.decimal_point << std::ends
+        << num_st_.thousands_sep << std::ends
+        << num_st_.grouping << std::ends;
+
+    // pad the structure up to the next alignment boundary
+    out.write ("\0\0\0\0\0\0\0\0", pad);
+
+    // write the numeric offset extension struct
+    out.write ((char*)&num_out_, sizeof (num_out_));
+
+    // write all the wide character strings
+    out.write ((const char*)num_st_.wtruename.c_str(),
+               (num_st_.wtruename.size() + 1) * sizeof (wchar_t));
+    out.write ((const char*)num_st_.wfalsename.c_str(),
+               (num_st_.wfalsename.size() + 1) * sizeof (wchar_t));
         
 
-        // write the narrow strings and codeset name
-        out << num_st_.truename << std::ends
-            << num_st_.falsename << std::ends
-            << charmap_.get_code_set_name() << std::ends
-            << charmap_.get_charmap_name() << std::ends;
+    // write the narrow strings and codeset name
+    out << num_st_.truename << std::ends
+        << num_st_.falsename << std::ends
+        << charmap_.get_code_set_name() << std::ends
+        << charmap_.get_charmap_name() << std::ends;
 
-        out.close();
-    }
+    out.close();
 }

Modified: incubator/stdcxx/trunk/util/scanner.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/scanner.cpp?view=diff&rev=448754&r1=448753&r2=448754
==============================================================================
--- incubator/stdcxx/trunk/util/scanner.cpp (original)
+++ incubator/stdcxx/trunk/util/scanner.cpp Thu Sep 21 17:42:16 2006
@@ -44,7 +44,6 @@
 struct ScannerContext
 {
     ScannerContext (const char*, char = '#', char = '\\');
-    ScannerContext (const ScannerContext&);
  
     std::ifstream file;		// file stream object
     std::string   filename;	// filename
@@ -60,7 +59,9 @@
     std::string line_;
     const char* pos_;
 
-protected:
+private:
+    // not defined (not copy constructible or assignable)
+    ScannerContext (const ScannerContext&);
     void operator= (ScannerContext&);
 };
 
@@ -100,18 +101,6 @@
     issue_diag (I_OPENRD, false, 0, "reading %s\n", name);
 }
 
-
-ScannerContext::
-ScannerContext (const ScannerContext& scanner)
-    : file (scanner.filename.c_str(), std::ios::binary), 
-      filename (scanner.filename),
-      comment_char (scanner.comment_char),
-      escape_char (scanner.escape_char),
-      line (scanner.line)
-      // column (scanner.column)
-{
-}
-
 /**************************************************************************/
 // Scanner class definitions
 
@@ -119,6 +108,7 @@
 Scanner ()
     : context_ (0), nlines_ (0), ntokens_ (0), escaped_newline_ (false)
 {
+    // no-op
 }
 
 
@@ -201,16 +191,13 @@
     assert (0 != name);
 
     if (*name == context_->escape_char) {
-
         switch (name [1]) {
-
-        case 'd':
-            return tok_decimal_value;
-        case 'x':
-            return tok_hex_value;
         case '0': case '1': case '2': case '3':
         case '4': case '5': case '6': case '7':
-            return tok_octal_value;
+        case 'd':
+        case 'x':
+            // escaped numeric character value
+            return tok_char_value;
         default:
             break;
         }
@@ -224,93 +211,98 @@
         const char*       name;
         Scanner::token_id token;
     } tok_map [] = {
-        { "CHARMAP", Scanner::tok_charmap },
-        { "END", Scanner::tok_end },
-        { "IGNORE", Scanner::tok_ignore },
-        { "LC_COLLATE", Scanner::tok_collate },
-        { "LC_CTYPE", Scanner::tok_ctype },
-        { "LC_IDENTIFICATION", Scanner::tok_identification },
-        { "LC_MESSAGES", Scanner::tok_messages },
-        { "LC_MONETARY", Scanner::tok_monetary },
-        { "LC_NUMERIC", Scanner::tok_numeric },
-        { "LC_TIME", Scanner::tok_time },
-        { "UNDEFINED", Scanner::tok_undefined },
-        { "WIDTH", Scanner::tok_width },
-        { "abday", Scanner::tok_abday },
-        { "abmon", Scanner::tok_abmon },
-        { "alpha", Scanner::tok_alpha },
-        { "alt_digits", Scanner::tok_alt_digits },
-        { "am_pm", Scanner::tok_am_pm },
-        { "backward", Scanner::tok_backward },
-        { "blank", Scanner::tok_blank },
-        { "cntrl", Scanner::tok_cntrl },
-        { "collating-element", Scanner::tok_collating_element },
-        { "collating-symbol", Scanner::tok_collating_symbol },
-        { "comment_char", Scanner::tok_comment_char },
-        { "copy", Scanner::tok_copy },
-        { "currency_symbol", Scanner::tok_currency_symbol },
-        { "d_fmt", Scanner::tok_d_fmt },
-        { "d_t_fmt", Scanner::tok_d_t_fmt },
-        { "day", Scanner::tok_day },
-        { "decimal_point", Scanner::tok_decimal_point },
-        { "digit", Scanner::tok_digit },
-        { "era", Scanner::tok_era },
-        { "era_d_fmt", Scanner::tok_era_d_fmt },
-        { "era_d_t_fmt", Scanner::tok_era_d_t_fmt },
-        { "era_t_fmt", Scanner::tok_era_t_fmt },
-        { "escape_char", Scanner::tok_escape_char },
-        { "falsename", Scanner::tok_falsename },
-        { "forward", Scanner::tok_forward },
-        { "frac_digits", Scanner::tok_frac_digits },
-        { "from", Scanner::tok_from },
-        { "graph", Scanner::tok_graph },
-        { "grouping", Scanner::tok_grouping },
-        { "include", Scanner::tok_include },
-        { "int_curr_symbol", Scanner::tok_int_curr_symbol },
-        { "int_frac_digits", Scanner::tok_int_frac_digits },
-        { "int_n_cs_precedes", Scanner::tok_int_n_cs_precedes },
-        { "int_n_sep_by_space", Scanner::tok_int_n_sep_by_space },
-        { "int_n_sign_posn", Scanner::tok_int_n_sign_posn },
-        { "int_p_cs_precedes", Scanner::tok_int_p_cs_precedes },
-        { "int_p_sep_by_space", Scanner::tok_int_p_sep_by_space },
-        { "int_p_sign_posn", Scanner::tok_int_p_sign_posn },
-        { "lower", Scanner::tok_lower },
-        { "mon", Scanner::tok_mon },
-        { "mon_decimal_point", Scanner::tok_mon_decimal_point },
-        { "mon_grouping", Scanner::tok_mon_grouping },
-        { "mon_thousands_sep", Scanner::tok_mon_thousands_sep },
-        { "noexpr", Scanner::tok_noexpr },
-        { "n_cs_precedes", Scanner::tok_n_cs_precedes },
-        { "n_sep_by_space", Scanner::tok_n_sep_by_space },
-        { "n_sign_posn", Scanner::tok_n_sign_posn },
-        { "negative_sign", Scanner::tok_negative_sign },
-        { "order_end", Scanner::tok_order_end },
-        { "order_start", Scanner::tok_order_start },
-        { "p_cs_precedes", Scanner::tok_p_cs_precedes },
-        { "p_sep_by_space", Scanner::tok_p_sep_by_space },
-        { "p_sign_posn", Scanner::tok_p_sign_posn },
-        { "position", Scanner::tok_position },
-        { "positive_sign", Scanner::tok_positive_sign },
-        { "print", Scanner::tok_print },
-        { "punct", Scanner::tok_punct },
-        { "reorder-after", Scanner::tok_reorder },
-        { "reorder-end", Scanner::tok_reorder_end },
-        { "reorder-section-after", Scanner::tok_reorder_section },
-        { "reorder-section-end", Scanner::tok_reorder_section_end },
-        { "space", Scanner::tok_space },
-        { "script", Scanner::tok_script },
-        { "t_fmt", Scanner::tok_t_fmt },
-        { "t_fmt_ampm", Scanner::tok_t_fmt_ampm },
-        { "thousands_sep", Scanner::tok_thousands_sep },
-        { "tolower", Scanner::tok_tolower },
-        { "toupper", Scanner::tok_toupper },
-        { "translit_end", Scanner::tok_translit_end },
-        { "translit_start", Scanner::tok_translit_start },
-        { "truename", Scanner::tok_truename },
-        { "upper", Scanner::tok_upper },
-        { "xdigit", Scanner::tok_xdigit },
-        { "yesexpr", Scanner::tok_yesexpr },
-        { "eof", Scanner::tok_eof }
+        // elements must be sorted in ascending order
+        { "CHARMAP", tok_charmap },
+        { "END", tok_end },
+        { "IGNORE", tok_ignore },
+        { "LC_ADDRESS", tok_addr },
+        { "LC_COLLATE", tok_collate },
+        { "LC_CTYPE", tok_ctype },
+        { "LC_IDENTIFICATION", tok_ident },
+        { "LC_MEASUREMENT", tok_measure },
+        { "LC_MESSAGES", tok_messages },
+        { "LC_MONETARY", tok_monetary },
+        { "LC_NAME", tok_name },
+        { "LC_NUMERIC", tok_numeric },
+        { "LC_PAPER", tok_paper },
+        { "LC_TELEPHONE", tok_phone },
+        { "LC_TIME", tok_time },
+        { "UNDEFINED", tok_undefined },
+        { "WIDTH", tok_width },
+        { "abday", tok_abday },
+        { "abmon", tok_abmon },
+        { "alpha", tok_alpha },
+        { "alt_digits", tok_alt_digits },
+        { "am_pm", tok_am_pm },
+        { "backward", tok_backward },
+        { "blank", tok_blank },
+        { "cntrl", tok_cntrl },
+        { "collating-element", tok_coll_elem },
+        { "collating-symbol", tok_coll_sym },
+        { "comment_char", tok_comment_char },
+        { "copy", tok_copy },
+        { "currency_symbol", tok_currency_symbol },
+        { "d_fmt", tok_d_fmt },
+        { "d_t_fmt", tok_d_t_fmt },
+        { "day", tok_day },
+        { "decimal_point", tok_decimal_point },
+        { "digit", tok_digit },
+        { "era", tok_era },
+        { "era_d_fmt", tok_era_d_fmt },
+        { "era_d_t_fmt", tok_era_d_t_fmt },
+        { "era_t_fmt", tok_era_t_fmt },
+        { "escape_char", tok_escape_char },
+        { "falsename", tok_falsename },
+        { "forward", tok_forward },
+        { "frac_digits", tok_frac_digits },
+        { "from", tok_from },
+        { "graph", tok_graph },
+        { "grouping", tok_grouping },
+        { "include", tok_include },
+        { "int_curr_symbol", tok_int_curr_symbol },
+        { "int_frac_digits", tok_int_frac_digits },
+        { "int_n_cs_precedes", tok_int_n_cs_precedes },
+        { "int_n_sep_by_space", tok_int_n_sep_by_space },
+        { "int_n_sign_posn", tok_int_n_sign_posn },
+        { "int_p_cs_precedes", tok_int_p_cs_precedes },
+        { "int_p_sep_by_space", tok_int_p_sep_by_space },
+        { "int_p_sign_posn", tok_int_p_sign_posn },
+        { "lower", tok_lower },
+        { "mon", tok_mon },
+        { "mon_decimal_point", tok_mon_decimal_point },
+        { "mon_grouping", tok_mon_grouping },
+        { "mon_thousands_sep", tok_mon_thousands_sep },
+        { "n_cs_precedes", tok_n_cs_precedes },
+        { "n_sep_by_space", tok_n_sep_by_space },
+        { "n_sign_posn", tok_n_sign_posn },
+        { "negative_sign", tok_negative_sign },
+        { "noexpr", tok_noexpr },
+        { "order_end", tok_order_end },
+        { "order_start", tok_order_start },
+        { "p_cs_precedes", tok_p_cs_precedes },
+        { "p_sep_by_space", tok_p_sep_by_space },
+        { "p_sign_posn", tok_p_sign_posn },
+        { "position", tok_position },
+        { "positive_sign", tok_positive_sign },
+        { "print", tok_print },
+        { "punct", tok_punct },
+        { "reorder-after", tok_reorder },
+        { "reorder-end", tok_reorder_end },
+        { "reorder-section-after", tok_reorder_section },
+        { "reorder-section-end", tok_reorder_section_end },
+        { "script", tok_script },
+        { "space", tok_space },
+        { "t_fmt", tok_t_fmt },
+        { "t_fmt_ampm", tok_t_fmt_ampm },
+        { "thousands_sep", tok_thousands_sep },
+        { "tolower", tok_tolower },
+        { "toupper", tok_toupper },
+        { "translit_end", tok_xlit_end },
+        { "translit_start", tok_xlit_start },
+        { "truename", tok_truename },
+        { "upper", tok_upper },
+        { "xdigit", tok_xdigit },
+        { "yesexpr", tok_yesexpr }
     };
 
     int low  = 0;
@@ -332,7 +324,7 @@
             low = cur + 1;
     }
 
-    return Scanner::tok_ndef;
+    return tok_ndef;
 }
 
 
@@ -525,7 +517,6 @@
                         issue_diag (E_SYNTAX, true, &next_tok, 
                                     " unterminated symbolic name");
 
-                    // increment the pointer
                     ++next;
                 }
                 else {
@@ -543,31 +534,40 @@
             break;
         } 
         else if (*next == '.') {
+            // ellipsis (see ISO/IEC TR 14652)
             int ellipsis_count = 0;
             // start of an interval
             while (*next == '.') {
                 next_tok.name.push_back (*next++);
                 ++ellipsis_count;
             }
+
             switch (ellipsis_count) {
-            case 2 : 
-            {
+            case 2: {
                 const char* tmp = next;
                 if (*tmp++ == '(' && *tmp++ == '2' && *tmp++ == ')'
                     && *tmp++ == '.' && *tmp++ == '.') {
-                    next_tok.token = tok_doub_inc_ellipsis;
+                    // double increment hexadecimal symbolic ellipsis
+                    next_tok.token = tok_dbl_ellipsis;
                     next = tmp;
                 }
-                else
-                    next_tok.token = tok_dellipsis;
+                else {
+                    // hexadecimal symbolic ellipsis
+                    next_tok.token = tok_hex_ellipsis;
+                }
                 break;
             }
+
             case 3:
-                next_tok.token = tok_ellipsis;
+                // absolute symbolic ellipsis
+                next_tok.token = tok_abs_ellipsis;
                 break;
+
             case 4:
-                next_tok.token = tok_qellipsis;
+                // decimal symbolic ellipsis
+                next_tok.token = tok_dec_ellipsis;
                 break;
+
             default:
                 issue_diag (E_SYNTAX, true, &next_tok, "illegal ellipsis\n");
             }
@@ -712,7 +712,7 @@
 
     if (escape != *esc)
         issue_diag (E_SYNTAX, true, 0,
-                    "expected the escape character ('%c'): %s\n",
+                    "expected the escape character ('%c'), got \"%s\"\n",
                     escape, esc);
 
     unsigned long value = 0;
@@ -738,12 +738,12 @@
                         "the escape character: %s\n", esc);
         }
 
-        const char *end = 0;
+        char *end = 0;
 
-        if (!pend)
-            pend = &end;
+        const unsigned long byte = std::strtoul (s, &end, base);
 
-        const unsigned long byte = std::strtoul (s, (char**)pend, base);
+        if (pend)
+            *pend = end;
 
         if (!multi && pend == &end && **pend)
             issue_diag (E_SYNTAX, true, 0,

Modified: incubator/stdcxx/trunk/util/scanner.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/scanner.h?view=diff&rev=448754&r1=448753&r2=448754
==============================================================================
--- incubator/stdcxx/trunk/util/scanner.h (original)
+++ incubator/stdcxx/trunk/util/scanner.h Thu Sep 21 17:42:16 2006
@@ -44,39 +44,130 @@
     // enumeration of all tokens in the character map 
     // and locale definition file
     enum token_id {
-        tok_charmap, tok_code_set_name, tok_mb_cur_max,
-        tok_mb_cur_min, tok_ctype, tok_upper, tok_lower, 
-        tok_digit, tok_space, tok_alpha, tok_graph, tok_print,
-        tok_cntrl, tok_punct, tok_xdigit, tok_blank, tok_tolower,
-        tok_toupper, tok_end, tok_collate, tok_monetary,
-        tok_numeric, tok_time, tok_messages, tok_sym_name, 
+        tok_code_set_name,   // <code_set_name>
+        tok_mb_cur_max,      // <mb_cur_max>
+        tok_mb_cur_min,      // <mb_cur_min>
+        // sections
+        tok_charmap,         // beginning of CHARMAP section
+        tok_collate,         // beginning of LC_COLLATE section
+        tok_ctype,           // beginning of LC_CTYPE section
+        tok_messages,        // beginning of LC_MESSAGES section
+        tok_monetary,        // beginning of LC_MONETARY section
+        tok_numeric,         // beginning of LC_NUMERIC section
+        tok_time,            // beginning of LC_TIME section
+        // ISO/IEC TR 14652 extensions:
+        tok_addr,            // beginning of LC_ADDRESS section
+        tok_ident,           // beginning of LC_IDENTIFICATION section
+        tok_measure,         // beginning of LC_MEASUREMENT section
+        tok_name,            // beginning of LC_NAME section
+        tok_paper,           // beginning of LC_PAPER section
+        tok_phone,           // beginning of LC_TELEPHONE section
+        //
+        tok_end,             // END of a section
+        // LC_CTYPE-specific tokens
+        tok_upper,           // upper section of LC_CTYPE
+        tok_lower,           // lower section of LC_CTYPE
+        tok_digit,           // digit section of LC_CTYPE
+        tok_space,           // space section of LC_CTYPE
+        tok_alpha,           // alpha section of LC_CTYPE
+        tok_graph,           // graph section of LC_CTYPE
+        tok_print,           // print section of LC_CTYPE
+        tok_cntrl,           // cntrl section of LC_CTYPE
+        tok_punct,           // punct section of LC_CTYPE
+        tok_xdigit,          // xdigit section of LC_CTYPE
+        tok_blank,           // blank section of LC_CTYPE
+        tok_tolower,         // tolower section of LC_CTYPE
+        tok_toupper,         // toupper section of LC_CTYPE
+        // LC_COLLATE-specific tokens
         tok_script,
-        tok_collating_element, tok_from, tok_collating_symbol, 
-        tok_translit_start, tok_translit_end,
-        tok_reorder, tok_reorder_end,
-        tok_reorder_section, tok_reorder_section_end,
-        tok_order_start, tok_order_end, tok_forward, tok_backward,
-        tok_position, tok_undefined, tok_string, tok_ignore,
-        tok_int_curr_symbol, tok_currency_symbol, 
-        tok_mon_decimal_point, tok_mon_thousands_sep, 
-        tok_mon_grouping, tok_positive_sign, tok_negative_sign,
-        tok_int_frac_digits, tok_frac_digits, tok_p_cs_precedes,
-        tok_p_sep_by_space, tok_n_cs_precedes, tok_n_sep_by_space,
-        tok_p_sign_posn, tok_n_sign_posn,
-        tok_int_p_cs_precedes, tok_int_n_cs_precedes,
-        tok_int_p_sep_by_space, tok_int_n_sep_by_space,
-        tok_int_p_sign_posn, tok_int_n_sign_posn,
-        tok_decimal_point, tok_thousands_sep, tok_grouping,
-        tok_abday, tok_day, tok_abmon, tok_mon, tok_d_t_fmt,
-        tok_d_fmt, tok_t_fmt, tok_am_pm, tok_t_fmt_ampm, tok_era,
-        tok_era_d_fmt, tok_era_t_fmt, tok_era_d_t_fmt, 
-        tok_alt_digits, tok_ellipsis, tok_dellipsis, tok_qellipsis,
-        tok_truename, tok_falsename,
-        tok_yesexpr, tok_noexpr, tok_identification,
-        tok_decimal_value, tok_hex_value, tok_octal_value,
-        tok_comment, tok_comment_char, tok_escape_char, tok_pair,
-        tok_copy, tok_include, tok_cont_line, tok_nl, tok_ndef, 
-        tok_eof, tok_end_tokens, tok_doub_inc_ellipsis, tok_width
+        tok_coll_elem,       // collating-element
+        tok_coll_sym,        // collating symbol
+        tok_from,
+        tok_xlit_start,      // translit_start
+        tok_xlit_end,        // translit_end
+        tok_reorder,
+        tok_reorder_end,
+        tok_reorder_section,
+        tok_reorder_section_end,
+        tok_order_start,
+        tok_order_end,
+        tok_forward,
+        tok_backward,
+        tok_position,
+        tok_undefined,
+        // 
+        tok_string,
+        tok_ignore,
+        // absolute, hexadecimal, decimal, and double-increment
+        // ellipses (see ISO/IEC TR 14652)
+        tok_abs_ellipsis,    // "..."
+        tok_hex_ellipsis,    // ".."
+        tok_dec_ellipsis,    // "...."
+        tok_dbl_ellipsis,    // "..(N).."
+        tok_width,
+        // LC_MONETARY-specific tokens
+        tok_int_curr_symbol,
+        tok_currency_symbol, 
+        tok_mon_decimal_point,
+        tok_mon_thousands_sep, 
+        tok_mon_grouping,
+        tok_positive_sign,
+        tok_negative_sign,
+        tok_int_frac_digits,
+        tok_frac_digits,
+        tok_p_cs_precedes,
+        tok_p_sep_by_space,
+        tok_n_cs_precedes,
+        tok_n_sep_by_space,
+        tok_p_sign_posn,
+        tok_n_sign_posn,
+        tok_int_p_cs_precedes,
+        tok_int_n_cs_precedes,
+        tok_int_p_sep_by_space,
+        tok_int_n_sep_by_space,
+        tok_int_p_sign_posn,
+        tok_int_n_sign_posn,
+        // LC_NUMERIC-specific tokens
+        tok_decimal_point,   // decimal point
+        tok_thousands_sep,   // thousands_sep
+        tok_grouping,        // grouping
+        tok_truename,        // truename (C++ extension)
+        tok_falsename,       // falsename (C++ extension)
+        // LC_TIME-specific tokens
+        tok_abday,
+        tok_day,
+        tok_abmon,
+        tok_mon,
+        tok_d_t_fmt,
+        tok_d_fmt,
+        tok_t_fmt,
+        tok_am_pm,
+        tok_t_fmt_ampm,
+        tok_era,
+        tok_era_d_fmt,
+        tok_era_t_fmt,
+        tok_era_d_t_fmt, 
+        tok_alt_digits,
+        // LC_MESSAGES-specific tokens
+        tok_yesexpr,
+        tok_noexpr,
+        // LC_ADDRESS-specific tokens
+        // LC_IDENTIFICATION-specific tokens
+        // LC_MEASUREMENT-specific tokens
+        // LC_NAME-specific tokens
+        // LC_PAPER-specific tokens
+        // LC_TELEPHONE-specific tokens
+        // other:
+        tok_sym_name,        // symbolic character name
+        tok_char_value,      // character value (octal, decimal, or hex)
+        tok_comment,         // comment
+        tok_comment_char,    // <comment_char>
+        tok_escape_char,     // <escape_char>
+        tok_copy,            // copy directive
+        tok_include,         // include directive
+        tok_nl,              // newline
+        tok_ndef,            // unknown/undefined token
+        tok_end_tokens       // end of input
     };
 
     // scanner states

Modified: incubator/stdcxx/trunk/util/time.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/time.cpp?view=diff&rev=448754&r1=448753&r2=448754
==============================================================================
--- incubator/stdcxx/trunk/util/time.cpp (original)
+++ incubator/stdcxx/trunk/util/time.cpp Thu Sep 21 17:42:16 2006
@@ -6,16 +6,23 @@
  *
  ***************************************************************************
  *
- * Copyright (c) 1994-2005 Quovadx,  Inc., acting through its  Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License");  you may  not use this file except  in compliance with the
- * License.    You    may   obtain   a   copy   of    the   License    at
- * http://www.apache.org/licenses/LICENSE-2.0.    Unless   required    by
- * applicable law  or agreed to  in writing,  software  distributed under
- * the License is distributed on an "AS IS" BASIS,  WITHOUT WARRANTIES OR
- * CONDITIONS OF  ANY KIND, either  express or implied.  See  the License
- * for the specific language governing permissions  and limitations under
- * the License.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  "License"); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2001-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 
@@ -30,28 +37,33 @@
 #include <fstream>        // for ofstream
 
 
-void Def::parse_era (const token_t& t) 
-{
-    // get the name of the era token
-    std::string era_str (t.name);
+static const char lc_name[] = "LC_TIME";
+
 
-    // to make processing the era a little easier, first convert the era_str
-    // with possible symbolic names to a narrow string without symbolic names
-    era_st tmp_era;
-    std::string era = convert_string (era_str);
+void Def::
+parse_era (const token_t& tok) 
+{
+    // to make processing the era a little easier, first convert
+    // the era_str with possible symbolic names to a narrow string
+    // without symbolic names
+    std::string era = convert_string (tok.name);
     
+    if (era.empty ())
+        return;
+
     // we need to also parse the wide version of this string so that we
     // may get the wide version of the era name and format
-    std::wstring wera = convert_wstring (t);
+    const std::wstring wera = convert_wstring (tok);
 
-    char*    erap  = _RWSTD_CONST_CAST (char*, era.c_str());
-    wchar_t* werap = _RWSTD_CONST_CAST (wchar_t*, wera.c_str());
+    char* const erap = _RWSTD_CONST_CAST (char*, era.c_str ());
 
-    char* tokp;
+    const wchar_t* const werap = wera.c_str ();
 
     // first get the direction
-    tokp = std::strtok (erap, ":");
-    char direction = *tokp;
+    char* tokp = std::strtok (erap, ":");
+    const char direction = tokp ? *tokp : '\0';
+
+    era_st tmp_era = era_st ();
 
     // now get the offset
     tokp = std::strtok (0, ":");
@@ -100,7 +112,7 @@
 
     // FIXME: check the values
     //advance to name of the era inside the wide char string
-    wchar_t *wtokp = werap;
+    const wchar_t *wtokp = werap;
     for (int i = 0; i < 4 && *wtokp; i++) 
         while (*wtokp && *(wtokp++) != L':');
 
@@ -120,32 +132,61 @@
 }
 
 
+Scanner::token_t Def::
+extract_string_array (std::string  *str,
+                      std::wstring *wstr,
+                      std::size_t   nelems)
+{
+    assert (0 != str);
+    assert (0 != wstr);
+
+    Scanner::token_t tok;
+
+    for (std::size_t i = 0; i != nelems; ++i) {
+
+        tok = scanner_.next_token ();
+
+        if (tok.token != Scanner::tok_string) {
+            issue_diag (W_MISSING, false, &tok, "expected string");
+            break;
+        }
+
+        str  [i] = convert_string (tok.name);
+        wstr [i] = convert_wstring (tok);
+    }
+
+    return tok;
+}
+
+
 void Def::process_time ()
 {
+    issue_diag (I_STAGE, false, 0, "processing %s section\n", lc_name);
+
     // nesting level
     int nesting_level = 0;
 
     time_def_found_ = true;
 
-    while((next = scanner_.next_token()).token != Scanner::tok_time) {
+    while ((next = scanner_.next_token ()).token != Scanner::tok_time) {
 
-        int i;
+        switch (next.token) {
 
-        switch(next.token) {
         case Scanner::tok_end:
-            next = scanner_.next_token();
+            next = scanner_.next_token ();
             if (next.token == Scanner::tok_time) {
                 // end of numeric block
                 if (nesting_level == 0) 
                     return;
 
-                nesting_level--;
+                --nesting_level;
                 scanner_.close ();
-            } else
+            }
+            else
                 issue_diag (E_SYNTAX, true, &next,
                             "wrong section name in END directive\n");
-
             break;
+
         case Scanner::tok_copy: {
             next = scanner_.next_token();
             if (next.token != Scanner::tok_string)
@@ -153,58 +194,75 @@
                             "expected string following \"copy\" directive\n");
 
             // bump up the nesting level
-            nesting_level++;
+            ++nesting_level;
 
             // open the file
             scanner_.open (get_pathname (strip_quotes (next.name), next.file));
 
             // get comment char and escape char; 
             // these informations are stored by the scanner
-            while ((next = scanner_.next_token ()).token 
-                   != Scanner::tok_time ){
+            while ((next = scanner_.next_token ()).token != Scanner::tok_time) {
                 // the LC_IDENTIFICATION section may also have a 
                 // LC_TIME token that will mess up the parsing
-                if (next.token == Scanner::tok_identification) {
-                    while ((next = scanner_.next_token()).token
-                           != Scanner::tok_end );
-                    next = scanner_.next_token();
+                if (next.token == Scanner::tok_ident) {
+                    while ((next = scanner_.next_token ()).token
+                           != Scanner::tok_end);
+                    next = scanner_.next_token ();
                 }
             }
             break;
         }
-        case Scanner::tok_abday:
-            for (i = 0; i < 7; i++) {
-                next = scanner_.next_token();
-                time_st_.abday[i] = convert_string (next.name);
-                time_st_.wabday[i] = convert_wstring (next);
-            }
+
+        case Scanner::tok_abday: {
+
+            const std::size_t nelems =
+                sizeof time_st_.abday / sizeof *time_st_.abday;
+
+            next = extract_string_array (time_st_.abday,
+                                         time_st_.wabday,
+                                         nelems);
             break;
-        case Scanner::tok_day:
-            for (i = 0; i < 7; i++) {
-                next = scanner_.next_token(); 
-                time_st_.day[i] = convert_string (next.name);
-                time_st_.wday[i] = convert_wstring (next);
-            }
+        }
+
+        case Scanner::tok_day: {
+
+            const std::size_t nelems =
+                sizeof time_st_.day / sizeof *time_st_.day;
+
+            next = extract_string_array (time_st_.day,
+                                         time_st_.wday,
+                                         nelems);
             break;
-        case Scanner::tok_abmon:
-            for (i = 0; i < 12; i++) {
-                next = scanner_.next_token(); 
-                time_st_.abmon[i] = convert_string (next.name);
-                time_st_.wabmon[i] = convert_wstring (next);
-            }
+        }
+
+        case Scanner::tok_abmon: {
+
+            const std::size_t nelems =
+                sizeof time_st_.abmon / sizeof *time_st_.abmon;
+
+            next = extract_string_array (time_st_.abmon,
+                                         time_st_.wabmon,
+                                         nelems);
             break;
-        case Scanner::tok_mon:
-            for (i = 0; i < 12; i++) {
-                next = scanner_.next_token(); 
-                time_st_.mon[i] = convert_string (next.name);
-                time_st_.wmon[i] = convert_wstring (next);
-            }
+        }
+
+        case Scanner::tok_mon: {
+
+            const std::size_t nelems =
+                sizeof time_st_.mon / sizeof *time_st_.mon;
+
+            next = extract_string_array (time_st_.mon,
+                                         time_st_.wmon,
+                                         nelems);
             break;
+        }
+
         case Scanner::tok_d_t_fmt:
-            next = scanner_.next_token(); 
+            next = scanner_.next_token();
             time_st_.d_t_fmt = convert_string (next.name);
             time_st_.wd_t_fmt = convert_wstring (next);
             break;
+
         case Scanner::tok_d_fmt:
             next = scanner_.next_token(); 
             time_st_.d_fmt = convert_string (next.name);
@@ -215,13 +273,17 @@
             time_st_.t_fmt = convert_string (next.name);
             time_st_.wt_fmt = convert_wstring (next);
             break;
-        case Scanner::tok_am_pm:
-            for (i = 0; i < 2; i++) {
-                next = scanner_.next_token(); 
-                time_st_.am_pm[i] = convert_string (next.name);
-                time_st_.wam_pm[i] = convert_wstring (next);
-            }
+
+        case Scanner::tok_am_pm: {
+            const std::size_t nelems =
+                sizeof time_st_.am_pm / sizeof *time_st_.am_pm;
+
+            next = extract_string_array (time_st_.am_pm,
+                                         time_st_.wam_pm,
+                                         nelems);
             break;
+        }
+
         case Scanner::tok_t_fmt_ampm:
             next = scanner_.next_token(); 
             time_st_.t_fmt_ampm = convert_string (next.name);
@@ -272,278 +334,284 @@
 {
     assert (!dir_name.empty());
 
-    if (time_def_found_ && !time_written_) {
-        // write out all the information in the LC_TIME category
+    if (time_written_)
+        return;
+
+    if (!time_def_found_) {
+        issue_diag (I_SKIP, false, 0,
+                    "%s section not found, skipping\n", lc_name);
+        return;
+    }
+
+    // write out all the information in the LC_TIME category
 
-        (dir_name += _RWSTD_PATH_SEP) += "LC_TIME";
+    (dir_name += _RWSTD_PATH_SEP) += lc_name;
 
-        issue_diag (I_OPENWR, false, 0, "writing %s\n", dir_name.c_str ());
+    issue_diag (I_OPENWR, false, 0, "writing %s\n", dir_name.c_str ());
 
-        std::ofstream out (dir_name.c_str(), std::ios::binary);
-        out.exceptions (std::ios::failbit | std::ios::badbit);
+    std::ofstream out (dir_name.c_str(), std::ios::binary);
+    out.exceptions (std::ios::failbit | std::ios::badbit);
 
-        int i;
+    int i;
 
-        time_out_.num_alt_digits = alt_digits_.size();
-        time_out_.era_off = 0;
+    time_out_.num_alt_digits = alt_digits_.size();
+    time_out_.era_off = 0;
 
-        time_out_.alt_digits_off = time_out_.era_off +
-            sizeof (_RW::__rw_time_t::era_t) * era_list_.size();
+    time_out_.alt_digits_off = time_out_.era_off +
+        sizeof (_RW::__rw_time_t::era_t) * era_list_.size();
 
-        // now calculate all the offsets for the wide string representations
-        time_out_.abday_off[1][0] = time_out_.alt_digits_off +
-            2 * sizeof (unsigned int) * time_out_.num_alt_digits;
+    // now calculate all the offsets for the wide string representations
+    time_out_.abday_off[1][0] = time_out_.alt_digits_off +
+        2 * sizeof (unsigned int) * time_out_.num_alt_digits;
         
-        for (i = 1; i < 7; i++) {
-            time_out_.abday_off[1][i] = time_out_.abday_off[1][i-1]
-                + (time_st_.wabday[i-1].size() * sizeof (wchar_t)) 
-                + sizeof(wchar_t);
-        }
+    for (i = 1; i < 7; i++) {
+        time_out_.abday_off[1][i] = time_out_.abday_off[1][i-1]
+            + (time_st_.wabday[i-1].size() * sizeof (wchar_t)) 
+            + sizeof(wchar_t);
+    }
 
-        time_out_.day_off[1][0] = time_out_.abday_off[1][6] 
-            + time_st_.wabday[6].size() * sizeof (wchar_t) 
+    time_out_.day_off[1][0] = time_out_.abday_off[1][6] 
+        + time_st_.wabday[6].size() * sizeof (wchar_t) 
+        + sizeof (wchar_t);
+    for (i = 1; i < 7; i++) {
+        time_out_.day_off[1][i] = time_out_.day_off[1][i-1]
+            + time_st_.wday[i-1].size() * sizeof (wchar_t) 
             + sizeof (wchar_t);
-        for (i = 1; i < 7; i++) {
-            time_out_.day_off[1][i] = time_out_.day_off[1][i-1]
-                + time_st_.wday[i-1].size() * sizeof (wchar_t) 
-                + sizeof (wchar_t);
-        }
+    }
 
-        time_out_.abmon_off[1][0] = time_out_.day_off[1][6] 
-            + time_st_.wday[6].size() * sizeof (wchar_t) + sizeof (wchar_t);
-        for (i = 1; i < 12; i++) {
-            time_out_.abmon_off[1][i] = time_out_.abmon_off[1][i-1]
-                + time_st_.wabmon[i-1].size() * sizeof (wchar_t) 
-                + sizeof (wchar_t);
-        }
+    time_out_.abmon_off[1][0] = time_out_.day_off[1][6] 
+        + time_st_.wday[6].size() * sizeof (wchar_t) + sizeof (wchar_t);
+    for (i = 1; i < 12; i++) {
+        time_out_.abmon_off[1][i] = time_out_.abmon_off[1][i-1]
+            + time_st_.wabmon[i-1].size() * sizeof (wchar_t) 
+            + sizeof (wchar_t);
+    }
 
-        time_out_.mon_off[1][0] = time_out_.abmon_off[1][11] 
-            + time_st_.wabmon[11].size() * sizeof (wchar_t) 
+    time_out_.mon_off[1][0] = time_out_.abmon_off[1][11] 
+        + time_st_.wabmon[11].size() * sizeof (wchar_t) 
+        + sizeof (wchar_t);
+    for (i = 1; i < 12; i++) {
+        time_out_.mon_off[1][i] = time_out_.mon_off[1][i-1]
+            + time_st_.wmon[i-1].size() * sizeof (wchar_t) 
             + sizeof (wchar_t);
-        for (i = 1; i < 12; i++) {
-            time_out_.mon_off[1][i] = time_out_.mon_off[1][i-1]
-                + time_st_.wmon[i-1].size() * sizeof (wchar_t) 
-                + sizeof (wchar_t);
-        }
+    }
         
-        time_out_.am_pm_off[1][0] = time_out_.mon_off[1][11] 
-            + time_st_.wmon[11].size() * sizeof (wchar_t) + sizeof (wchar_t);
-        time_out_.am_pm_off[1][1] = time_out_.am_pm_off[1][0] 
-            + time_st_.wam_pm[0].size() * sizeof (wchar_t) + sizeof (wchar_t);
+    time_out_.am_pm_off[1][0] = time_out_.mon_off[1][11] 
+        + time_st_.wmon[11].size() * sizeof (wchar_t) + sizeof (wchar_t);
+    time_out_.am_pm_off[1][1] = time_out_.am_pm_off[1][0] 
+        + time_st_.wam_pm[0].size() * sizeof (wchar_t) + sizeof (wchar_t);
         
-        time_out_.d_t_fmt_off[1] = time_out_.am_pm_off[1][1] 
-            + time_st_.wam_pm[1].size() * sizeof (wchar_t) 
-            + sizeof (wchar_t);
-        time_out_.d_fmt_off[1] = time_out_.d_t_fmt_off[1]
-            + time_st_.wd_t_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
-        time_out_.t_fmt_off[1] = time_out_.d_fmt_off[1] 
-            + time_st_.wd_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
-        time_out_.t_fmt_ampm_off[1] = time_out_.t_fmt_off[1]
-            + time_st_.wt_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
+    time_out_.d_t_fmt_off[1] = time_out_.am_pm_off[1][1] 
+        + time_st_.wam_pm[1].size() * sizeof (wchar_t) 
+        + sizeof (wchar_t);
+    time_out_.d_fmt_off[1] = time_out_.d_t_fmt_off[1]
+        + time_st_.wd_t_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
+    time_out_.t_fmt_off[1] = time_out_.d_fmt_off[1] 
+        + time_st_.wd_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
+    time_out_.t_fmt_ampm_off[1] = time_out_.t_fmt_off[1]
+        + time_st_.wt_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
         
-        time_out_.era_d_t_fmt_off[1] = time_out_.t_fmt_ampm_off[1]
-            + time_st_.wt_fmt_ampm.size() * sizeof (wchar_t) 
-            + sizeof (wchar_t);
-        time_out_.era_d_fmt_off[1] = time_out_.era_d_t_fmt_off[1]
-            + time_st_.wera_d_t_fmt.size() * sizeof (wchar_t) 
-            + sizeof (wchar_t);
-        time_out_.era_t_fmt_off[1] = time_out_.era_d_fmt_off[1] 
-            + time_st_.wera_d_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
-
-        unsigned int next_off = time_out_.era_t_fmt_off[1]
-            + time_st_.wera_t_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);  
-        era_list_iter era_list_it;
-        for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
-             era_list_it ++) {
-            era_list_it->era_out.name_off[1] = next_off;
-            next_off += era_list_it->wname.size() 
-                * sizeof (wchar_t) + sizeof (wchar_t);
-            era_list_it->era_out.fmt_off[1] = next_off;
-            next_off += era_list_it->wfmt.size() 
-                * sizeof (wchar_t) + sizeof (wchar_t);
-        }
+    time_out_.era_d_t_fmt_off[1] = time_out_.t_fmt_ampm_off[1]
+        + time_st_.wt_fmt_ampm.size() * sizeof (wchar_t) 
+        + sizeof (wchar_t);
+    time_out_.era_d_fmt_off[1] = time_out_.era_d_t_fmt_off[1]
+        + time_st_.wera_d_t_fmt.size() * sizeof (wchar_t) 
+        + sizeof (wchar_t);
+    time_out_.era_t_fmt_off[1] = time_out_.era_d_fmt_off[1] 
+        + time_st_.wera_d_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
+
+    unsigned int next_off = time_out_.era_t_fmt_off[1]
+        + time_st_.wera_t_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);  
+    era_list_iter era_list_it;
+    for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
+         era_list_it ++) {
+        era_list_it->era_out.name_off[1] = next_off;
+        next_off += era_list_it->wname.size() 
+            * sizeof (wchar_t) + sizeof (wchar_t);
+        era_list_it->era_out.fmt_off[1] = next_off;
+        next_off += era_list_it->wfmt.size() 
+            * sizeof (wchar_t) + sizeof (wchar_t);
+    }
 
-        alt_digits_iter alt_digits_it;
-        for (alt_digits_it = alt_digits_.begin(); 
-             alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
-            alt_digits_it->w_offset = next_off;
-            next_off += (alt_digits_it->w_alt_digit.size() + 1) 
-                * sizeof(wchar_t);
-        }
+    alt_digits_iter alt_digits_it;
+    for (alt_digits_it = alt_digits_.begin(); 
+         alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
+        alt_digits_it->w_offset = next_off;
+        next_off += (alt_digits_it->w_alt_digit.size() + 1) 
+            * sizeof(wchar_t);
+    }
 
-        time_out_.abday_off[0][0] = next_off;
+    time_out_.abday_off[0][0] = next_off;
         
-        for (i = 1; i < 7; i++) {
-            // calculate the offsets for the abreviated days
-            time_out_.abday_off[0][i] = time_out_.abday_off[0][i-1]
-                + time_st_.abday[i - 1].size() + 1;
-        }
+    for (i = 1; i < 7; i++) {
+        // calculate the offsets for the abreviated days
+        time_out_.abday_off[0][i] = time_out_.abday_off[0][i-1]
+            + time_st_.abday[i - 1].size() + 1;
+    }
 
-        time_out_.day_off[0][0] = time_out_.abday_off[0][6] 
-            + time_st_.abday[6].size() + 1;
-        for (i = 1; i < 7; i++) {
-            // calculate the offsets for the days
-            time_out_.day_off[0][i] = time_out_.day_off[0][i-1]
-                + time_st_.day[i-1].size() + 1;
-        }
+    time_out_.day_off[0][0] = time_out_.abday_off[0][6] 
+        + time_st_.abday[6].size() + 1;
+    for (i = 1; i < 7; i++) {
+        // calculate the offsets for the days
+        time_out_.day_off[0][i] = time_out_.day_off[0][i-1]
+            + time_st_.day[i-1].size() + 1;
+    }
 
-        time_out_.abmon_off[0][0] = time_out_.day_off[0][6] 
-            + time_st_.day[6].size() + 1;
-        for (i = 1; i < 12; i++) {
-            // calculate the offsets for the abreviated months
-            time_out_.abmon_off[0][i] = time_out_.abmon_off[0][i-1]
-                + time_st_.abmon[i-1].size() + 1;
-        }
+    time_out_.abmon_off[0][0] = time_out_.day_off[0][6] 
+        + time_st_.day[6].size() + 1;
+    for (i = 1; i < 12; i++) {
+        // calculate the offsets for the abreviated months
+        time_out_.abmon_off[0][i] = time_out_.abmon_off[0][i-1]
+            + time_st_.abmon[i-1].size() + 1;
+    }
 
-        time_out_.mon_off[0][0] = time_out_.abmon_off[0][11] 
-            + time_st_.abmon[11].size() + 1;
-        for (i = 1; i < 12; i++) {
-            // calculate the offsets for the months
-            time_out_.mon_off[0][i] = time_out_.mon_off[0][i-1]
-                + time_st_.mon[i-1].size() + 1;
-        }
+    time_out_.mon_off[0][0] = time_out_.abmon_off[0][11] 
+        + time_st_.abmon[11].size() + 1;
+    for (i = 1; i < 12; i++) {
+        // calculate the offsets for the months
+        time_out_.mon_off[0][i] = time_out_.mon_off[0][i-1]
+            + time_st_.mon[i-1].size() + 1;
+    }
         
-        // calculate the offsets for am and pm
-        time_out_.am_pm_off[0][0] = time_out_.mon_off[0][11] 
-            + time_st_.mon[11].size() + 1;
-        time_out_.am_pm_off[0][1] = time_out_.am_pm_off[0][0] 
-            + time_st_.am_pm[0].size() + 1;
+    // calculate the offsets for am and pm
+    time_out_.am_pm_off[0][0] = time_out_.mon_off[0][11] 
+        + time_st_.mon[11].size() + 1;
+    time_out_.am_pm_off[0][1] = time_out_.am_pm_off[0][0] 
+        + time_st_.am_pm[0].size() + 1;
         
-        time_out_.d_t_fmt_off[0] = time_out_.am_pm_off[0][1] 
-            + time_st_.am_pm[1].size() + 1;
-        time_out_.d_fmt_off[0] = time_out_.d_t_fmt_off[0] 
-            + time_st_.d_t_fmt.size() + 1;
-        time_out_.t_fmt_off[0] = time_out_.d_fmt_off[0] 
-            + time_st_.d_fmt.size() + 1;
-        time_out_.t_fmt_ampm_off[0] = time_out_.t_fmt_off[0]
-            + time_st_.t_fmt.size() + 1;
-
-        time_out_.era_d_t_fmt_off[0] = time_out_.t_fmt_ampm_off[0] 
-            + time_st_.t_fmt_ampm.size() + 1;
-        time_out_.era_d_fmt_off[0] = time_out_.era_d_t_fmt_off[0] 
-            + time_st_.era_d_t_fmt.size() + 1;
-        time_out_.era_t_fmt_off[0] = time_out_.era_d_fmt_off[0] 
-            + time_st_.era_d_fmt.size() + 1;
+    time_out_.d_t_fmt_off[0] = time_out_.am_pm_off[0][1] 
+        + time_st_.am_pm[1].size() + 1;
+    time_out_.d_fmt_off[0] = time_out_.d_t_fmt_off[0] 
+        + time_st_.d_t_fmt.size() + 1;
+    time_out_.t_fmt_off[0] = time_out_.d_fmt_off[0] 
+        + time_st_.d_fmt.size() + 1;
+    time_out_.t_fmt_ampm_off[0] = time_out_.t_fmt_off[0]
+        + time_st_.t_fmt.size() + 1;
+
+    time_out_.era_d_t_fmt_off[0] = time_out_.t_fmt_ampm_off[0] 
+        + time_st_.t_fmt_ampm.size() + 1;
+    time_out_.era_d_fmt_off[0] = time_out_.era_d_t_fmt_off[0] 
+        + time_st_.era_d_t_fmt.size() + 1;
+    time_out_.era_t_fmt_off[0] = time_out_.era_d_fmt_off[0] 
+        + time_st_.era_d_fmt.size() + 1;
 
 
 
-        next_off = time_out_.era_t_fmt_off[0]
-            + time_st_.era_t_fmt.size() + 1;
-
-        for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
-             era_list_it ++) {
-            era_list_it->era_out.name_off[0] = next_off;
-            next_off += era_list_it->name.size() + 1;
-            era_list_it->era_out.fmt_off[0] = next_off;
-            next_off += era_list_it->fmt.size() + 1;
-        }
+    next_off = time_out_.era_t_fmt_off[0]
+        + time_st_.era_t_fmt.size() + 1;
+
+    for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
+         era_list_it ++) {
+        era_list_it->era_out.name_off[0] = next_off;
+        next_off += era_list_it->name.size() + 1;
+        era_list_it->era_out.fmt_off[0] = next_off;
+        next_off += era_list_it->fmt.size() + 1;
+    }
 
-        for (alt_digits_it = alt_digits_.begin(); 
-             alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
-            alt_digits_it->n_offset = next_off;
-            next_off += alt_digits_it->n_alt_digit.size() + 1;
-        }
+    for (alt_digits_it = alt_digits_.begin(); 
+         alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
+        alt_digits_it->n_offset = next_off;
+        next_off += alt_digits_it->n_alt_digit.size() + 1;
+    }
 
 
-        time_out_.codeset_off = next_off;
+    time_out_.codeset_off = next_off;
       
-        time_out_.charmap_off = time_out_.codeset_off
-            + charmap_.get_code_set_name().size() + 1;
+    time_out_.charmap_off = time_out_.codeset_off
+        + charmap_.get_code_set_name().size() + 1;
         
-        // write the time struct    
-        out.write ((char*)&time_out_, sizeof(time_out_));
+    // write the time struct    
+    out.write ((char*)&time_out_, sizeof(time_out_));
         
-        // first write out the era structs
-        for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
-             era_list_it ++) {
-            out.write ((const char*) &era_list_it->era_out,
-                       sizeof (era_list_it->era_out));
-        }
-
-        // next write out the offsets to where the alternate digits are stored
-        for (alt_digits_it = alt_digits_.begin(); 
-             alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
-            out.write ((const char*) &alt_digits_it->n_offset,
-                       sizeof (alt_digits_it->n_offset));
-            out.write ((const char*) &alt_digits_it->w_offset,
-                       sizeof (alt_digits_it->w_offset));
-        }
-
-        // now write out the wchar_t version of LC_TIME
-        for (i = 0; i < 7; i++){
-            out.write ((const char*)time_st_.wabday[i].c_str(), 
-                       (time_st_.wabday[i].size() + 1) * sizeof (wchar_t));
-        }
-        for (i = 0; i < 7; i++)
-            out.write ((const char*)time_st_.wday[i].c_str(), 
-                       (time_st_.wday[i].size() + 1) * sizeof (wchar_t));
-        for (i = 0; i < 12; i++)
-            out.write ((const char*)time_st_.wabmon[i].c_str(),
-                       (time_st_.wabmon[i].size() + 1) * sizeof (wchar_t));
-        for (i = 0; i < 12; i++)
-            out.write ((const char*)time_st_.wmon[i].c_str(), 
-                       (time_st_.wmon[i].size() + 1) * sizeof (wchar_t));
-        for (i = 0; i < 2; i++)
-            out.write ((const char*)time_st_.wam_pm[i].c_str(),
-                       (time_st_.wam_pm[i].size() + 1) * sizeof (wchar_t));
-        out.write ((const char*)time_st_.wd_t_fmt.c_str(), 
-                   (time_st_.wd_t_fmt.size() + 1) * sizeof (wchar_t));
-        out.write ((const char*)time_st_.wd_fmt.c_str(),
-                   (time_st_.wd_fmt.size() + 1) * sizeof (wchar_t));
-        out.write ((const char*)time_st_.wt_fmt.c_str(), 
-                   (time_st_.wt_fmt.size() + 1) * sizeof (wchar_t));
-        out.write ((const char*)time_st_.wt_fmt_ampm.c_str(), 
-                   (time_st_.wt_fmt_ampm.size() + 1) * sizeof (wchar_t));
-        out.write ((const char*)time_st_.wera_d_t_fmt.c_str(), 
-                   (time_st_.wera_d_t_fmt.size() + 1) * sizeof (wchar_t));
-        out.write ((const char*)time_st_.wera_d_fmt.c_str(),
-                   (time_st_.wera_d_fmt.size() + 1) * sizeof (wchar_t));
-        out.write ((const char*)time_st_.wera_t_fmt.c_str(), 
-                   (time_st_.wera_t_fmt.size() + 1) * sizeof (wchar_t));
-        for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
-             era_list_it ++) {
-            out.write ((const char*) era_list_it->wname.c_str(),
-                       (era_list_it->wname.size() + 1) * sizeof (wchar_t));
-            out.write ((const char*) era_list_it->wfmt.c_str(),
-                       (era_list_it->wfmt.size() + 1) * sizeof (wchar_t));
-        }
-        for (alt_digits_it = alt_digits_.begin(); 
-             alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
-            out.write ((const char*) alt_digits_it->w_alt_digit.c_str(),
-                       (alt_digits_it->w_alt_digit.size() + 1) 
-                       * sizeof (wchar_t));
-        }
+    // first write out the era structs
+    for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
+         era_list_it ++) {
+        out.write ((const char*) &era_list_it->era_out,
+                   sizeof (era_list_it->era_out));
+    }
 
-        // write out the char version of LC_TIME
-        for (i = 0; i < 7; i++)
-            out << time_st_.abday[i] << std::ends;
-        for (i = 0; i < 7; i++)
-            out << time_st_.day[i] << std::ends;
-        for (i = 0; i < 12; i++)
-            out << time_st_.abmon[i] << std::ends;
-        for (i = 0; i < 12; i++)
-            out << time_st_.mon[i] << std::ends;
-        for (i = 0; i < 2; i++)
-            out << time_st_.am_pm[i] << std::ends;
-        out << time_st_.d_t_fmt << std::ends;
-        out << time_st_.d_fmt << std::ends;
-        out << time_st_.t_fmt << std::ends;
-        out << time_st_.t_fmt_ampm << std::ends;
-        out << time_st_.era_d_t_fmt << std::ends;
-        out << time_st_.era_d_fmt << std::ends;
-        out << time_st_.era_t_fmt << std::ends;
-        for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
-             era_list_it ++) {
-            out << era_list_it->name << std::ends;
-            out << era_list_it->fmt << std::ends;
-        }
-        for (alt_digits_it = alt_digits_.begin(); 
-             alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
-            out << alt_digits_it->n_alt_digit << std::ends;
-        }
+    // next write out the offsets to where the alternate digits are stored
+    for (alt_digits_it = alt_digits_.begin(); 
+         alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
+        out.write ((const char*) &alt_digits_it->n_offset,
+                   sizeof (alt_digits_it->n_offset));
+        out.write ((const char*) &alt_digits_it->w_offset,
+                   sizeof (alt_digits_it->w_offset));
+    }
 
+    // now write out the wchar_t version of LC_TIME
+    for (i = 0; i < 7; i++){
+        out.write ((const char*)time_st_.wabday[i].c_str(), 
+                   (time_st_.wabday[i].size() + 1) * sizeof (wchar_t));
+    }
+    for (i = 0; i < 7; i++)
+        out.write ((const char*)time_st_.wday[i].c_str(), 
+                   (time_st_.wday[i].size() + 1) * sizeof (wchar_t));
+    for (i = 0; i < 12; i++)
+        out.write ((const char*)time_st_.wabmon[i].c_str(),
+                   (time_st_.wabmon[i].size() + 1) * sizeof (wchar_t));
+    for (i = 0; i < 12; i++)
+        out.write ((const char*)time_st_.wmon[i].c_str(), 
+                   (time_st_.wmon[i].size() + 1) * sizeof (wchar_t));
+    for (i = 0; i < 2; i++)
+        out.write ((const char*)time_st_.wam_pm[i].c_str(),
+                   (time_st_.wam_pm[i].size() + 1) * sizeof (wchar_t));
+    out.write ((const char*)time_st_.wd_t_fmt.c_str(), 
+               (time_st_.wd_t_fmt.size() + 1) * sizeof (wchar_t));
+    out.write ((const char*)time_st_.wd_fmt.c_str(),
+               (time_st_.wd_fmt.size() + 1) * sizeof (wchar_t));
+    out.write ((const char*)time_st_.wt_fmt.c_str(), 
+               (time_st_.wt_fmt.size() + 1) * sizeof (wchar_t));
+    out.write ((const char*)time_st_.wt_fmt_ampm.c_str(), 
+               (time_st_.wt_fmt_ampm.size() + 1) * sizeof (wchar_t));
+    out.write ((const char*)time_st_.wera_d_t_fmt.c_str(), 
+               (time_st_.wera_d_t_fmt.size() + 1) * sizeof (wchar_t));
+    out.write ((const char*)time_st_.wera_d_fmt.c_str(),
+               (time_st_.wera_d_fmt.size() + 1) * sizeof (wchar_t));
+    out.write ((const char*)time_st_.wera_t_fmt.c_str(), 
+               (time_st_.wera_t_fmt.size() + 1) * sizeof (wchar_t));
+    for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
+         era_list_it ++) {
+        out.write ((const char*) era_list_it->wname.c_str(),
+                   (era_list_it->wname.size() + 1) * sizeof (wchar_t));
+        out.write ((const char*) era_list_it->wfmt.c_str(),
+                   (era_list_it->wfmt.size() + 1) * sizeof (wchar_t));
+    }
+    for (alt_digits_it = alt_digits_.begin(); 
+         alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
+        out.write ((const char*) alt_digits_it->w_alt_digit.c_str(),
+                   (alt_digits_it->w_alt_digit.size() + 1) 
+                   * sizeof (wchar_t));
+    }
 
-        out << charmap_.get_code_set_name() << std::ends;
-        out << charmap_.get_charmap_name() << std::ends;
+    // write out the char version of LC_TIME
+    for (i = 0; i < 7; i++)
+        out << time_st_.abday[i] << std::ends;
+    for (i = 0; i < 7; i++)
+        out << time_st_.day[i] << std::ends;
+    for (i = 0; i < 12; i++)
+        out << time_st_.abmon[i] << std::ends;
+    for (i = 0; i < 12; i++)
+        out << time_st_.mon[i] << std::ends;
+    for (i = 0; i < 2; i++)
+        out << time_st_.am_pm[i] << std::ends;
+    out << time_st_.d_t_fmt << std::ends;
+    out << time_st_.d_fmt << std::ends;
+    out << time_st_.t_fmt << std::ends;
+    out << time_st_.t_fmt_ampm << std::ends;
+    out << time_st_.era_d_t_fmt << std::ends;
+    out << time_st_.era_d_fmt << std::ends;
+    out << time_st_.era_t_fmt << std::ends;
+    for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
+         era_list_it ++) {
+        out << era_list_it->name << std::ends;
+        out << era_list_it->fmt << std::ends;
+    }
+    for (alt_digits_it = alt_digits_.begin(); 
+         alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
+        out << alt_digits_it->n_alt_digit << std::ends;
     }
+
+    out << charmap_.get_code_set_name() << std::ends;
+    out << charmap_.get_charmap_name() << std::ends;
 }



Mime
View raw message