From 452e57431fb84a3f9f8ac119263e06f65a9ccc32 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 29 Oct 2007 02:10:23 +0000 Subject: [PATCH] (mchartable): Initialize table->min_char to -1. (mchartable_min_char): New function. (mchartable_max_char): New function. --- src/chartab.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/chartab.c b/src/chartab.c index 04b216f..3a03e80 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -673,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; @@ -686,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 -- 1.7.10.4