noinst_PROGRAMS = \
linebreak replace mimdemo mimdaemon fifotest1 fifotest2 \
imtest findfont gdkdraw finddb imsim langname viewfile pangotest \
- flt-gui flt-otf flt-hb flt-pango find-flt test
+ flt-gui flt-otf flt-hb flt-pango find-flt test key-aliases conv-by-im \
+ mim-xml reader2
mimdemo_LDADD = -lgd
mimdaemon_LDADD = -lgd
test_CFLAGS = @M17N_CFLAGS@ @M17NFLT_CFLAGS@
test_LDFLAGS= @M17N_LIBS@ @M17NFLT_LIBS@
+key_aliases_SOURCES = key-aliases.c
+key_aliases_CFLAGS = @M17N_CFLAGS@ @M17NFLT_CFLAGS@
+key_aliases_LDFLAGS= @M17N_LIBS@ @M17NFLT_LIBS@
+
+conv_by_im_SOURCES = conv-by-im.c
+conv_by_im_CFLAGS = @M17N_CFLAGS@ @M17NFLT_CFLAGS@
+conv_by_im_LDFLAGS= @M17N_LIBS@ @M17NFLT_LIBS@
+
flt_gui_SOURCES = flt.c
flt_gui_CFLAGS = ${baseCFLAGS} @M17NGUI_CFLAGS@ -DFLT_GUI
flt_gui_LDFLAGS = ${baseLIBS} @M17NGUI_LIBS@
find_flt_CFLAGS = ${baseCFLAGS} @M17NFLT_CFLAGS@
find_flt_LDFLAGS = ${baseLIBS} @M17NFLT_LIBS@
+mim_xml_SOURCES = mim-xml.c
+mim_xml_CFLAGS = `xml2-config --cflags`
+mim_xml_LDFLAGS = `xml2-config --libs`
+
+reader2_SOURCES = reader2.c
+reader2_CFLAGS = `xml2-config --cflags`
+reader2_LDFLAGS = `xml2-config --libs`
+
verify: linebreak
@echo "checking line breaking..."
@for arg in "" --sp-cm --korean-sp --ai-as-id; do \
{
MInputMethod *im;
MInputContext *ic;
+ unsigned char byte[2];
+ int i;
+ MSymbol prop, alias, sym;
M17N_INIT ();
im = minput_open_im (Mt, msymbol ("test"), NULL);
ic = minput_create_ic (im, NULL);
if (ic)
{
- minput_filter (ic, msymbol ("\x80"), NULL);
- minput_filter (ic, msymbol ("\x81"), NULL);
+ byte[0] = 0xd1;
+ byte[1] = 0;
+ minput_filter (ic, msymbol (byte), NULL);
minput_destroy_ic (ic);
}
minput_close_im (im);
}
+ prop = msymbol (" key-alias");
+ byte[1] = 0;
+ for (i = 0; i < 256; i++)
+ {
+ byte[0] = i;
+ sym = msymbol ((char *) byte);
+ alias = msymbol_get (sym, prop);
+ if (alias)
+ {
+ printf ("%02X:", i);
+ while (alias && alias != sym)
+ {
+ printf (" %s", msymbol_name (alias));
+ alias = msymbol_get (alias, prop);
+ }
+ printf ("\n");
+ }
+ }
+
exit (0);
}
#include <libxml/xmlmemory.h>
void
-error_exit (char *fmt, char *arg)
+error_exit (char *fmt, const char *arg)
{
fprintf (stderr, fmt, arg);
+ fprintf (stderr, "\n");
exit (1);
}
XPathContextPtr context;
xmlXPathObjectPtr result;
xmlChar *xpath = (xmlChar *) "//input-method";
- xmlChar *key;
xmlNodeSetPtr nodeset;
#endif
- int i;
+ const xmlChar *name, *value;
xmlTextReaderPtr reader;
+ int depth;
- reader = xmlReaderForFile (argv[1], "utf-8", 0);
+ reader = xmlReaderForFile (argv[1], "utf-8",
+ XML_PARSE_NOBLANKS
+ /*XML_PARSE_XINCLUDE|XML_PARSE_NOENT*/);
+ /*xmlTextReaderRelaxNGValidate (reader, argv[2]);*/
+ if (xmlTextReaderRead (reader) != 1)
+ error_exit ("Read error: %s", argv[1]);
+ if (! (name = xmlTextReaderConstLocalName (reader)))
+ error_exit ("No %s node", "input-method");
+ printf ("%s", (char *) name);
+ xmlTextReaderRead (reader);
+ if (! (name = xmlTextReaderConstLocalName (reader)))
+ error_exit ("No inner node: %s", "tags");
+ printf (" %s", (char *) name);
+ xmlTextReaderRead (reader);
+ printf (" %s", (char *) xmlTextReaderConstLocalName (reader));
+ xmlTextReaderRead (reader);
+ printf (" %s", (char *) xmlTextReaderConstLocalName (reader));
+ depth = xmlTextReaderDepth(reader);
+ value = xmlTextReaderConstValue (reader);
+ printf (" \"%s\"", (char *) value);
+ xmlTextReaderRead (reader);
+ xmlTextReaderRead (reader);
+ xmlTextReaderRead (reader);
+ value = xmlTextReaderConstValue (reader);
+ printf (" \"%s\"", (char *) value);
+ do { xmlTextReaderRead (reader); }
+ while (xmlTextReaderNodeType (reader) != XML_READER_TYPE_TEXT);
+ value = xmlTextReaderConstValue (reader);
+ if (depth == xmlTextReaderDepth(reader))
+ printf (" \"%s\"", (char *) value);
+ printf ("\n");
+
+#if 0
xmlTextReaderRelaxNGValidate (reader, argv[2]);
while ((i = xmlTextReaderRead (reader)) == 1);
printf ("%d\n\n", i);
+#endif
#if 0
doc = xmlParseFile (argv[1]);