/* 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
if (! table->contents.tables && table->default_value == default_value)
return;
- fprintf (stderr, "\n%s(sub%d (U+%04X U+%04X) ",
+ fprintf (mdebug__output, "\n%s(sub%d (U+%04X U+%04X) ",
prefix, depth, min_char, max_char);
if (key == Msymbol)
{
if (table->default_value)
- fprintf (stderr, "(default %s)",
+ fprintf (mdebug__output, "(default %s)",
((MSymbol) table->default_value)->name);
else
- fprintf (stderr, "(default nil)");
+ fprintf (mdebug__output, "(default nil)");
}
else
- fprintf (stderr, "(default #x%X)", (unsigned) table->default_value);
+ fprintf (mdebug__output, "(default #x%X)", (unsigned) table->default_value);
default_value = table->default_value;
if (table->contents.tables)
if (val == default_value)
continue;
default_value = *val;
- fprintf (stderr, "\n%s (U+%04X", prefix, min_char);
+ fprintf (mdebug__output, "\n%s (U+%04X", prefix, min_char);
while (i + 1 < chartab_slots[depth]
&& val[1] == default_value)
i++, val++, min_char++;
- fprintf (stderr, "-U+%04X ", min_char);
+ fprintf (mdebug__output, "-U+%04X ", min_char);
if (key == Msymbol)
{
if (default_value)
- fprintf (stderr, "%s)", ((MSymbol) default_value)->name);
+ fprintf (mdebug__output, "%s)",
+ ((MSymbol) default_value)->name);
else
- fprintf (stderr, "nil)");
+ fprintf (mdebug__output, "nil)");
}
else
- fprintf (stderr, " #xx%X)", (unsigned) default_value);
+ fprintf (mdebug__output, " #xx%X)", (unsigned) default_value);
}
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
\f
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;
/*=*/
/***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
@brief Dump a chartable.
The mdebug_dump_chartab () function prints a chartable $TABLE in a
- human readable way to the stderr. $INDENT specifies how many
- columns to indent the lines but the first one.
+ human readable way to the stderr or to what specified by the
+ environment variable MDEBUG_OUTPUT_FILE. $INDENT specifies how
+ many columns to indent the lines but the first one.
@return
This function returns $TABLE. */
/***ja
@brief ʸ»ú¥Æ¡¼¥Ö¥ë¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_chartab () ¤Ïʸ»ú¥Æ¡¼¥Ö¥ë $TABLE ¤ò stderr
- ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£$INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+ ´Ø¿ô mdebug_dump_chartab () ¤Ïʸ»ú¥Æ¡¼¥Ö¥ë $TABLE ¤òɸ½à¥¨¥é¡¼½ÐÎÏ
+ ¤â¤·¤¯¤Ï´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆÉ
+ ¤Ê·Á¤Ç°õºþ¤¹¤ë¡£$INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï $TABLE ¤òÊÖ¤¹¡£ */
MCharTable *
mdebug_dump_chartab (MCharTable *table, int indent)
{
- fprintf (stderr, "(chartab (U+%04X U+%04X)",
+ fprintf (mdebug__output, "(chartab (U+%04X U+%04X)",
table->min_char, table->max_char);
dump_sub_chartab (&table->subtable, table->subtable.default_value,
table->key, indent + 2);
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
return table;
}