*** empty log message ***
[m17n/m17n-test.git] / test.c
diff --git a/test.c b/test.c
new file mode 100644 (file)
index 0000000..97a8d0b
--- /dev/null
+++ b/test.c
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+#include <m17n-flt.h>
+
+int
+main ()
+{
+  MFLTOtfSpec spec;
+  int result;
+  void *handle;
+  int (*parse_otf_command) (MSymbol, MFLTOtfSpec *);
+
+  M17N_INIT ();
+  handle = dlopen (NULL, RTLD_NOW);
+  if (! handle)
+    exit (1);
+  *(void **) (&parse_otf_command) = dlsym (handle, "mflt_find");
+  if (dlerror () != NULL)
+    exit (2);
+  *(void **) (&parse_otf_command) = dlsym (handle, "parse_otf_command");
+  if (dlerror () != NULL)
+    exit (3);
+  result = (*parse_otf_command) (msymbol (":otf=arab"), &spec);
+  printf ("result = %d\n", result);
+  exit (0);
+}