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
M17N_OBJECT_ADD_ARRAY (mtext_table, "M-text");
M_charbag = msymbol_as_managing_key (" charbag");
mtext_table.count = 0;
+ Mlanguage = msymbol ("language");
return 0;
}
/*** @{ */
/*=*/
+/***en The symbol whose name is "language". */
+/***ja "language" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë. */
+MSymbol Mlanguage;
+
+/*=*/
+
/***en
@brief Allocate a new M-text.
nunits = CHAR_UNITS (c, mt->format);
if ((mt->nbytes + nunits + 1) * unit_bytes > mt->allocated)
{
- mt->allocated = (mt->nbytes + nunits + 1) * unit_bytes;
+ mt->allocated = (mt->nbytes + nunits * 16 + 1) * unit_bytes;
MTABLE_REALLOC (mt->data, mt->allocated, MERROR_MTEXT);
}
MText *
mdebug_dump_mtext (MText *mt, int indent, int fullp)
{
- char *prefix = (char *) alloca (indent + 1);
int i;
- unsigned char *p;
-
- memset (prefix, 32, indent);
- prefix[indent] = 0;
- fprintf (stderr,
- "(mtext (size %d %d %d) (cache %d %d)",
- mt->nchars, mt->nbytes, mt->allocated,
- mt->cache_char_pos, mt->cache_byte_pos);
if (! fullp)
{
- fprintf (stderr, " \"");
+ fprintf (stderr, "\"");
for (i = 0; i < mt->nchars; i++)
{
int c = mtext_ref_char (mt, i);
if (c == '"' || c == '\\')
fprintf (stderr, "\\%c", c);
- else if (c >= ' ' && c < 127)
+ else if ((c >= ' ' && c < 127) || c == '\n')
fprintf (stderr, "%c", c);
else
fprintf (stderr, "\\x%02X", c);
}
fprintf (stderr, "\"");
+ return mt;
}
- else if (mt->nchars > 0)
+
+ fprintf (stderr,
+ "(mtext (size %d %d %d) (cache %d %d)",
+ mt->nchars, mt->nbytes, mt->allocated,
+ mt->cache_char_pos, mt->cache_byte_pos);
+
+ if (mt->nchars > 0)
{
+ char *prefix = (char *) alloca (indent + 1);
+ unsigned char *p;
+
+ memset (prefix, 32, indent);
+ prefix[indent] = 0;
+
fprintf (stderr, "\n%s (bytes \"", prefix);
for (i = 0; i < mt->nbytes; i++)
fprintf (stderr, "\\x%02x", mt->data[i]);