Add Unicode 5.1 based Myanmar.
[m17n/m17n-lib.git] / src / chartab.c
index d17f4dc..947b575 100644 (file)
@@ -1,5 +1,5 @@
 /* chartab.h -- character table module.
-   Copyright (C) 2003, 2004
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
@@ -17,7 +17,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the m17n library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    02111-1307, USA.  */
 
 /***en
@@ -600,14 +600,13 @@ dump_sub_chartab (MSubCharTable *table, void *default_value,
 int
 mchartable__init ()
 {
-  chartable_table.count = 0;
+  M17N_OBJECT_ADD_ARRAY (chartable_table, "Chartable");
   return 0;
 }
 
 void
 mchartable__fini ()
 {
-  mdebug__report_object ("Chartable", &chartable_table);
 }
 
 void *
@@ -674,7 +673,7 @@ mchartable (MSymbol key, void *default_value)
   M17N_OBJECT (table, free_chartable, MERROR_CHARTABLE);
   M17N_OBJECT_REGISTER (chartable_table, table);
   table->key = key;
-  table->min_char = 0;
+  table->min_char = -1;
   table->max_char = -1;
   SET_DEPTH_MIN_CHAR (&table->subtable, 0, 0);
   table->subtable.default_value = default_value;
@@ -687,6 +686,38 @@ mchartable (MSymbol key, void *default_value)
 /*=*/
 
 /***en
+    @brief Return the minimum character whose value is set in a chartabe.
+
+    The mchartable_min_char () function return the minimum character
+    whose value is set in chartable $TABLE.  No character is set its
+    value, the function returns -1.
+ */
+
+int
+mchartable_min_char (MCharTable *table)
+{
+  return table->min_char;
+}
+
+/*=*/
+
+/***en
+    @brief Return the maximum character whose value is set in a chartabe.
+
+    The mchartable_max_char () function return the maximum character
+    whose value is set in chartable $TABLE.  No character is set its
+    value, the function returns -1.
+ */
+
+int
+mchartable_max_char (MCharTable *table)
+{
+  return table->max_char;
+}
+
+/*=*/
+
+/***en
     @brief Return the assigned value of a character in a chartable.
 
     The mchartable_lookup () function returns the value assigned to