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);
}
@brief Replace sub-text of M-text with another.
The mtext_replace () function replaces sub-text of M-text $MT1
- between $FROM1 (inclusive) and $TO1 (exclusinve) with the sub-text
- of M-text $MT2 between $FROM2 (inclusive) and $TO2 (exclusinve).
+ between $FROM1 (inclusive) and $TO1 (exclusive) with the sub-text
+ of M-text $MT2 between $FROM2 (inclusive) and $TO2 (exclusive).
The new sub-text inherits text properties of the old sub-text.
@return If the operation was successful, mtext_replace () returns
The mtext_titlecase () function destructively converts the first
character with the cased property in M-text $MT to titlecase and
the others to lowercase. The length of $MT may change. If the
- character cannot be converted to titlercase, it is left unchanged.
+ character cannot be converted to titlecase, it is left unchanged.
All the text properties are inherited.
@return
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]);