diff options
author | Choe Hwanjin <choe.hwanjin@gmail.com> | 2008-05-04 23:28:05 +0900 |
---|---|---|
committer | Choe Hwanjin <choe.hwanjin@gmail.com> | 2008-05-04 23:28:05 +0900 |
commit | 9ca3ecac7048495c4312aace6204ff7f92611ec7 (patch) | |
tree | 3ba936c4eb1758dafc8d51de6982021ce4910fc4 | |
parent | 31beaab347a0054776bb497f8d5bc5c437465e90 (diff) | |
download | libhangul-9ca3ecac7048495c4312aace6204ff7f92611ec7.tar.gz |
hanja_table_match_exact() 구현
git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@182 8f00fcd2-89fc-0310-932e-b01be5b65e01
-rw-r--r-- | hangul/hangul.h | 1 | ||||
-rw-r--r-- | hangul/hanja.c | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/hangul/hangul.h b/hangul/hangul.h index 2a8b336..edd1761 100644 --- a/hangul/hangul.h +++ b/hangul/hangul.h @@ -128,6 +128,7 @@ typedef struct _HanjaList HanjaList; typedef struct _HanjaTable HanjaTable; HanjaTable* hanja_table_load(const char *filename); +HanjaList* hanja_table_match_exact(const HanjaTable* table, const char *key); HanjaList* hanja_table_match_prefix(const HanjaTable* table, const char *key); HanjaList* hanja_table_match_suffix(const HanjaTable* table, const char *key); void hanja_table_delete(HanjaTable *table); diff --git a/hangul/hanja.c b/hangul/hanja.c index 9eeabbd..f02ee86 100644 --- a/hangul/hanja.c +++ b/hangul/hanja.c @@ -996,6 +996,22 @@ hanja_table_delete(HanjaTable *table) } HanjaList* +hanja_table_match_exact(const HanjaTable* table, const char *key) +{ + HanjaList* ret = NULL; + + if (key == NULL || key[0] == '\0') + return NULL; + + if (table == NULL) + return NULL; + + table->match(table, key, &ret); + + return ret; +} + +HanjaList* hanja_table_match_prefix(const HanjaTable* table, const char *key) { char* p; |