Apply the changes, libtoolize and new api hangul_ic_flush
authorChoe Hwanjin <choe.hwanjin@gmail.com>
Fri, 4 Nov 2005 14:31:59 +0000 (23:31 +0900)
committerChoe Hwanjin <choe.hwanjin@gmail.com>
Fri, 4 Nov 2005 14:31:59 +0000 (23:31 +0900)
git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@34 8f00fcd2-89fc-0310-932e-b01be5b65e01

test/Makefile.am
test/test.c

index 4a463be..6eac5cd 100644 (file)
@@ -3,4 +3,4 @@ noinst_PROGRAMS = test
 
 test_CFLAGS =
 test_SOURCES = test.c
-test_LDADD = ../hangul/libhangul.a
+test_LDADD = ../hangul/libhangul.la
index 6ef2f75..db17845 100644 (file)
@@ -1,7 +1,3 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -17,6 +13,7 @@ main(int argc, char *argv[])
     int ascii;
     int keyboard = HANGUL_KEYBOARD_2;
     char commit[32] = { '\0', };
+    wchar_t *commit_string;
     HangulInputContext *hic;
 
     if (argc > 1) {
@@ -33,7 +30,8 @@ main(int argc, char *argv[])
 
     for (ascii = getchar(); ascii != EOF; ascii = getchar()) {
        int ret = hangul_ic_filter(hic, ascii);
-       n = wcstombs(commit, hangul_ic_get_commit_string(hic), sizeof(commit));
+       commit_string = (wchar_t*)hangul_ic_get_commit_string(hic);
+       n = wcstombs(commit, commit_string, sizeof(commit));
        commit[n] = '\0';
        if (strlen(commit) > 0) {
            printf("%s", commit);
@@ -42,8 +40,9 @@ main(int argc, char *argv[])
            printf("%c", ascii);
        }
     } 
-    hangul_ic_reset(hic);
-    n = wcstombs(commit, hangul_ic_get_commit_string(hic), sizeof(commit));
+    hangul_ic_flush(hic);
+    commit_string = (wchar_t*)hangul_ic_get_commit_string(hic);
+    n = wcstombs(commit, commit_string, sizeof(commit));
     commit[n] = '\0';
     if (strlen(commit) > 0) {
        printf("%s", commit);