/* symbol.c -- symbol module.
- Copyright (C) 2003, 2004
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H15PRO112
}
symbol_table[i] = NULL;
}
- if (mdebug__flag & MDEBUG_FINI)
- fprintf (stderr, "%16s %7d %7d %7d\n", "Symbol",
+ if (mdebug__flags[MDEBUG_FINI])
+ fprintf (mdebug__output, "%16s %7d %7d %7d\n", "Symbol",
num_symbols, freed_symbols, num_symbols - freed_symbols);
num_symbols = 0;
}
o convert all uppercase characters to lowercase.
o remove all non alpha-numeric characters.
o change the leading "ibm" to "cp".
- o change the leading "cp" to "ibm"
+ o change the leading "windows-" to "cp".
+ o change the leading "cp" to "ibm".
o remove the leading "iso".
For instance:
"ISO-8859-2" -> "88592"
"euc-JP" -> "eucjp"
"IBM851" -> "cp851"
- "CP1250" -> "ibm1250"
+ "windows-1250" -> "cp250"
This function is used to canonicalize charset and coding system
names. */
canon[1] = 'b';
canon[2] = 'm';
}
-
+ else if (canon[0] == 'w' && p - canon > 7
+ && memcmp (canon + 1, "indows", 6) == 0
+ && isdigit (canon[7]))
+ {
+ /* Change "windowsXXX" to "cpXXX" */
+ canon += 5;
+ canon[0] = 'c';
+ canon[1] = 'p';
+ }
return msymbol (canon);
}
The msymbol_is_managing_key () function checks if the symbol
$SYMBOL is a managing key or not.
- @return Return 1 if the symbol is a managing key. Otherwise,
+ @return
+ Return 1 if the symbol is a managing key. Otherwise,
return 0. */
int
setting function pointer $FUNC as the property value of $SYMBOL for
key $KEY. */
+/***ja
+ @brief ¥·¥ó¥Ü¥ë¥×¥í¥Ñ¥Æ¥£¤ÎÃÍ(´Ø¿ô¥Ý¥¤¥ó¥¿)¤òÀßÄꤹ¤ë.
+
+ ´Ø¿ô msymbol_put_func () ¤Ï¡¢´Ø¿ô msymbol_put () ¤ÈƱÍͤˡ¢¥·¥ó¥Ü¥ë
+ $SYMBOL ¤Î¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¥·¥ó¥Ü¥ë¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë¡£Ã¢¤·
+ ¤½¤ÎÃͤϴؿô¥Ý¥¤¥ó¥¿ $FUNC ¤Ç¤¢¤ë¡£ */
+
/***
- @seealso msymbol_put (), M17N_FUNC () */
+ @seealso
+ msymbol_put (), M17N_FUNC () */
int
msymbol_put_func (MSymbol symbol, MSymbol key, M17NFunc func)
{
The msymbol_get_func () function is similar to msymbol_get () but for
getting a function pointer form the property of symbol $SYMBOL. */
+/***ja
+ @brief ¥·¥ó¥Ü¥ë¥×¥í¥Ñ¥Æ¥£¤ÎÃÍ (´Ø¿ô¥Ý¥¤¥ó¥¿) ¤òÆÀ¤ë.
+
+ ´Ø¿ô msymbol_get_func () ¤Ï¡¢´Ø¿ô msymbol_get () ¤ÈƱÍͤˡ¢¥·¥ó¥Ü¥ë
+ $SYMBOL ¤¬»ý¤Ä¥·¥ó¥Ü¥ë¥×¥í¥Ñ¥Æ¥£¤Î¤¦¤Á¡¢¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤òÆÀ¤ë¡£Ã¢¤·
+ ¤½¤ÎÃͤϴؿô¥Ý¥¤¥ó¥¿¤ò¤Ç¤¢¤ë¡£ */
+
/***
@seealso
msymbol_get () */
/***en
@brief Dump a symbol.
- The mdebug_dump_symbol () function prints symbol $SYMBOL in a human
- readable way to the stderr. $INDENT specifies how many columns to
- indent the lines but the first one.
+ The mdebug_dump_symbol () function prints symbol $SYMBOL in a
+ 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 $SYMBOL.
/***ja
@brief ¥·¥ó¥Ü¥ë¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_symbol () ¤Ï¥·¥ó¥Ü¥ë $symbol ¤ò stderr
- ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+ ´Ø¿ô mdebug_dump_symbol () ¤Ï¥·¥ó¥Ü¥ë $symbol ¤òɸ½à¥¨¥é¡¼½ÐÎϤ⤷
+ ¤¯¤Ï´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ
+ ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï $SYMBOL ¤òÊÖ¤¹¡£
else
plist = &symbol->plist, name = symbol->name;
- fprintf (stderr, "%s%s", prefix, name);
+ fprintf (mdebug__output, "%s%s", prefix, name);
while (plist && MPLIST_KEY (plist) != Mnil)
{
- fprintf (stderr, ":%s", MPLIST_KEY (plist)->name);
+ fprintf (mdebug__output, ":%s", MPLIST_KEY (plist)->name);
plist = MPLIST_NEXT (plist);
}
return symbol;
@brief Dump all symbol names.
The mdebug_dump_all_symbols () function prints names of all
- symbols to the stderr. $INDENT specifies how many columns to
- indent the lines but the first one.
+ symbols 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 #Mnil.
/***ja
@brief ¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ë̾¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_all_symbols () ¤Ï¡¢¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ë¤Î̾Á°¤ò
- stderr ¤Ë°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+ ´Ø¿ô mdebug_dump_all_symbols () ¤Ï¡¢¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ë¤Î̾Á°¤òɸ½à¥¨
+ ¥é¡¼½ÐÎϤ⤷¤¯¤Ï´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë°õ
+ ºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï #Mnil ¤òÊÖ¤¹¡£
memset (prefix, 32, indent);
prefix[indent] = 0;
- fprintf (stderr, "(symbol-list");
+ fprintf (mdebug__output, "(symbol-list");
for (i = n = 0; i < SYMBOL_TABLE_SIZE; i++)
if ((sym = symbol_table[i]))
{
- fprintf (stderr, "\n%s (%4d", prefix, i);
+ fprintf (mdebug__output, "\n%s (%4d", prefix, i);
for (; sym; sym = sym->next, n++)
- fprintf (stderr, " '%s'", sym->name);
- fprintf (stderr, ")");
+ fprintf (mdebug__output, " '%s'", sym->name);
+ fprintf (mdebug__output, ")");
}
- fprintf (stderr, "\n%s (total %d)", prefix, n);
- fprintf (stderr, ")");
+ fprintf (mdebug__output, "\n%s (total %d)", prefix, n);
+ fprintf (mdebug__output, ")");
return Mnil;
}