summaryrefslogtreecommitdiffstats
path: root/utils/utils_helper.h
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-10-18 16:50:24 +0800
committerPeng Wu <alexepico@gmail.com>2012-10-18 16:50:24 +0800
commit67eb7b0d41e907d24bc6d1ad973290d61cd90c0a (patch)
tree9da003cabbbff46d0c4b9060b26e14c05abe7541 /utils/utils_helper.h
parent7803cff4f0c464cf75d26a2056507e71cfed9934 (diff)
downloadlibpinyin-67eb7b0d41e907d24bc6d1ad973290d61cd90c0a.tar.gz
libpinyin-67eb7b0d41e907d24bc6d1ad973290d61cd90c0a.tar.xz
libpinyin-67eb7b0d41e907d24bc6d1ad973290d61cd90c0a.zip
update utils helper
Diffstat (limited to 'utils/utils_helper.h')
-rw-r--r--utils/utils_helper.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/utils/utils_helper.h b/utils/utils_helper.h
index db2a5c1..bada86b 100644
--- a/utils/utils_helper.h
+++ b/utils/utils_helper.h
@@ -23,13 +23,20 @@
#ifndef UTILS_HELPER_H
#define UTILS_HELPER_H
-#define TAGLIB_GET_VALUE(var, index) \
+
+#define TAGLIB_GET_TOKEN(var, index) \
phrase_token_t var = null_token; \
{ \
const char * string = (const char *) g_ptr_array_index \
(values, index); \
- var = taglib_string_to_token \
- (phrase_table, phrase_index, string); \
+ var = atoi(string); \
+ }
+
+#define TAGLIB_GET_PHRASE_STRING(var, index) \
+ const char * var = NULL; \
+ { \
+ var = (const char *) g_ptr_array_index \
+ (values, index); \
}
#define TAGLIB_GET_TAGVALUE(type, var, conv) \