diff options
author | Choe Hwanjin <choe.hwanjin@gmail.com> | 2006-10-27 14:56:50 +0900 |
---|---|---|
committer | Choe Hwanjin <choe.hwanjin@gmail.com> | 2006-10-27 14:56:50 +0900 |
commit | 4deebb9ebba5b402f16d3ee8fedd3bdd35e467d8 (patch) | |
tree | 654725e9eb2e7601c197ecdd2fd2c7d415f11009 | |
parent | 5cf4a57dd9703326a9acf5a192f0ef5ff612705a (diff) | |
download | libhangul-4deebb9ebba5b402f16d3ee8fedd3bdd35e467d8.tar.gz |
hangul_ic_flush()의 바뀐점 적용
git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@84 8f00fcd2-89fc-0310-932e-b01be5b65e01
-rw-r--r-- | bindings/python/pyhangul.c | 21 | ||||
-rw-r--r-- | bindings/python/setup.py | 4 |
2 files changed, 20 insertions, 5 deletions
diff --git a/bindings/python/pyhangul.c b/bindings/python/pyhangul.c index b91944e..a500869 100644 --- a/bindings/python/pyhangul.c +++ b/bindings/python/pyhangul.c @@ -7,7 +7,7 @@ #include <stdlib.h> #include <alloca.h> -#include "../hangul/hangul.h" +#include <hangul.h> static PyObject *_pyhangul_error; @@ -102,9 +102,24 @@ static PyObject *_pyhangulic_reset(PY_HANGULIC *self, PyObject *args) static PyObject *_pyhangulic_flush(PY_HANGULIC *self, PyObject *args) { - hangul_ic_flush(self->hic); +#ifndef Py_UNICODE_WIDE + int i; + Py_UNICODE *buf; +#endif /* !Py_UNICODE_WIDE */ + int len; + const ucschar *str; - return Py_None; + str = hangul_ic_flush(self->hic); + len = ucscharlen(str); + +#ifdef Py_UNICODE_WIDE + return PyUnicode_FromUnicode((Py_UNICODE*)str, len); +#else /* Py_UNICODE_WIDE */ + buf = alloca(sizeof(Py_UNICODE) * len); + for (i = 0; i < len; i++) + buf[i] = str[i]; + return PyUnicode_FromUnicode(buf, len); +#endif /* Py_UNICODE_WIDE */ } static PyObject *_pyhangulic_backspace(PY_HANGULIC *self, PyObject *args) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 59add16..2725360 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -21,8 +21,8 @@ if sys.platform == "win32": # for MinGW data_files = [] else: - include_dirs = [ '../hangul' ] - library_dirs = [ '../hangul/.libs' ] + include_dirs = [ '../../hangul' ] + library_dirs = [ '../../hangul/.libs' ] libraries = ['hangul'] data_files = [] |