}
else if ((ptr = xmlGetProp (cur, (xmlChar *) "keys")))
- mplist_add (parent, Mtext,
- mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8));
+ {
+ MText *mt = mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8);
+
+ mplist_add (parent, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
+ }
else
{
xmlFree (ptr);
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
}
decode_expr (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
else if (xmlStrEqual (cur->name, (xmlChar *) "int-val"))
{
{
xmlChar *ptr;
MPlist *plist = mplist ();
+ MText *mt;
mplist_add (plist, Msymbol, msymbol ("insert"));
if ((ptr = xmlGetProp (cur, (xmlChar *) "string")))
- mplist_add (plist, Mtext,
- mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8));
+ {
+ mt = mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8);
+ mplist_add (plist, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
+ }
+
else if ((ptr = xmlGetProp (cur, (xmlChar *) "character")))
{
while (cur)
{
ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
- pl = mplist_add (pl, Mtext,
- mtext_from_data (ptr, xmlStrlen (ptr),
- MTEXT_FORMAT_UTF_8));
+ mt = mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8);
+ pl = mplist_add (pl, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
cur = cur->next;
}
}
while (cur)
{
xmlChar *start;
- MPlist *plist0 = mplist (), *plist1 = mplist ();
+ MPlist *outer = mplist (), *inner = mplist ();
int ch, len = 4, skipping = 1;
+ mplist_add (outer, Mplist, inner);
+ M17N_OBJECT_UNREF (inner);
+
ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
while ((ch = xmlGetUTF8Char (ptr, &len)))
else if (! skipping && Isspace (ch))
{
*ptr = '\0';
- mplist_add (plist0, Mtext,
- mtext_from_data (start, xmlStrlen (start),
- MTEXT_FORMAT_UTF_8));
+ mt = mtext_from_data (start, xmlStrlen (start),
+ MTEXT_FORMAT_UTF_8);
+ inner = mplist_add (inner, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
skipping = 1;
}
ptr += len;
}
if (!skipping)
{
- mplist_add (plist0, Mtext,
- mtext_from_data (start, xmlStrlen (start),
- MTEXT_FORMAT_UTF_8));
+ mt = mtext_from_data (start, xmlStrlen (start), MTEXT_FORMAT_UTF_8);
+ mplist_add (inner, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
}
- mplist_add (plist1, Mplist, plist0);
- mplist_add (plist, Mplist, plist1);
+ mplist_add (plist, Mplist, outer);
+ M17N_OBJECT_UNREF (outer);
cur = cur->next;
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
xmlFree (ptr);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_marker (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_keyseq (doc, cur->xmlChildrenNode, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_variable_reference (doc, cur->xmlChildrenNode, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
ptr = xmlGetProp (cur, (xmlChar *) "type");
if (xmlStrEqual (ptr, (xmlChar *) "string"))
{
+ MText *mt;
+
xmlFree (ptr);
ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
- mplist_add (plist, Mtext, mtext_from_data (ptr, xmlStrlen (ptr),
- MTEXT_FORMAT_UTF_8));
+ mt = mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8);
+ mplist_add (plist, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
}
else if (xmlStrEqual (ptr, (xmlChar *) "integer"))
{
decode_variable_reference (doc, cur->xmlChildrenNode, plist);
}
}
+
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_expr (doc, cur->xmlChildrenNode, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
for (cur0 = cur->xmlChildrenNode; cur0; cur0 = cur0->next)
decode_saction (doc, cur0, plist0);
mplist_add (plist, Mplist, plist0);
+ M17N_OBJECT_UNREF (plist0);
cur = cur->next; /* else */
if (cur)
for (cur0 = cur->xmlChildrenNode; cur0; cur0 = cur0->next)
decode_saction (doc, cur0, plist0);
mplist_add (plist, Mplist, plist0);
+ M17N_OBJECT_UNREF (plist0);
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_saction (doc, cur0, plist0);
mplist_add (plist, Mplist, plist0);
+ M17N_OBJECT_UNREF (plist0);
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
{
/* never comes here */
}
+
+ M17N_OBJECT_UNREF (plist);
}
static void
mplist_add (plist, Msymbol, msymbol ((char *) ptr + 6));
mplist_add (parent, Mplist, plist);
xmlFree (ptr);
+ M17N_OBJECT_UNREF (plist);
}
else
decode_action (doc, cur, parent);
if (xmlStrEqual (cur->name, (xmlChar *) "get-text"))
{
MPlist *plist = mplist ();
+ MText *mt;
- ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
mplist_add (plist, Msymbol, msymbol ("_"));
- mplist_add (plist, Mtext,
- mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8));
+ ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
+ mt = mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8);
+ mplist_add (plist, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
else
{
+ MText *mt;
+
ptr = xmlNodeListGetString (doc, cur, 1);
- mplist_add (parent, Mtext,
- mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8));
+ mt = mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8);
+ mplist_add (parent, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
}
}
if (cur && xmlStrEqual (cur->name, (xmlChar *) "m17n-version"))
{
MPlist *plist0 = mplist ();
+ MText *mt;
- ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
mplist_add (plist0, Msymbol, msymbol ("version"));
- mplist_add (plist0, Mtext,
- mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8));
+ ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
+ mt = mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8);
+ mplist_add (plist0, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
mplist_add (plist, Mplist, plist0);
+ M17N_OBJECT_UNREF (plist0);
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
mplist_add (plist, Msymbol, msymbol ("description"));
decode_description (doc, cur->xmlChildrenNode, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
{
xmlChar *ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
MPlist *plist = mplist ();
+ MText *mt;
mplist_add (plist, Msymbol, msymbol ("title"));
- mplist_add (plist, Mtext,
- mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8));
+ mt = mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8);
+ mplist_add (plist, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
{
xmlChar *ptr;
MPlist *plist = mplist ();
+ MText *mt;
ptr = xmlGetProp (cur, (xmlChar *) "id");
mplist_add (plist, Msymbol, msymbol ((char *) ptr));
ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
valuetype = xmlGetProp (cur, (xmlChar *) "type");
if (xmlStrEqual (valuetype, (xmlChar *) "string"))
- mplist_add (plist, Mtext,
- mtext_from_data (ptr, xmlStrlen (ptr),
- MTEXT_FORMAT_UTF_8));
+ {
+ mt = mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8);
+ mplist_add (plist, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
+ }
else if (xmlStrEqual (valuetype, (xmlChar *) "symbol"))
{
mplist_add (plist, Msymbol, msymbol ((char *) ptr));
ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
valuetype = xmlGetProp (cur, (xmlChar *) "type");
if (xmlStrEqual (valuetype, (xmlChar *) "string"))
- mplist_add (plist, Mtext,
- mtext_from_data (ptr, xmlStrlen (ptr),
- MTEXT_FORMAT_UTF_8));
+ {
+ mt = mtext_from_data (ptr, xmlStrlen (ptr),
+ MTEXT_FORMAT_UTF_8);
+ mplist_add (plist, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
+ }
else if (xmlStrEqual (valuetype, (xmlChar *) "symbol"))
{
mplist_add (plist, Msymbol, msymbol ((char *) ptr));
decode_integer (ptr, range);
xmlFree (ptr);
mplist_add (plist, Mplist, range);
+ M17N_OBJECT_UNREF (range);
}
}
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_variable (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
void
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_command (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_module (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_action (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_macro (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_action (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_rule (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_map (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
if (mplist_length (plist))
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
{
if (xmlStrEqual (cur->name, (xmlChar *) "state-title-text"))
{
+ MText *mt;
+
ptr = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
- mplist_add (plist, Mtext, mtext_from_data (ptr, xmlStrlen (ptr),
- MTEXT_FORMAT_UTF_8));
+ mt = mtext_from_data (ptr, xmlStrlen (ptr), MTEXT_FORMAT_UTF_8);
+ mplist_add (plist, Mtext, mt);
+ M17N_OBJECT_UNREF (mt);
}
else
decode_branch (doc, cur, plist);
}
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static void
decode_state (doc, cur, plist);
mplist_add (parent, Mplist, plist);
+ M17N_OBJECT_UNREF (plist);
}
static int