summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/knj.h
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/kpathsea/knj.h')
-rw-r--r--Build/source/texk/kpathsea/knj.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Build/source/texk/kpathsea/knj.h b/Build/source/texk/kpathsea/knj.h
index 8f1cd919687..2f5b6b2a8d4 100644
--- a/Build/source/texk/kpathsea/knj.h
+++ b/Build/source/texk/kpathsea/knj.h
@@ -1,6 +1,7 @@
/* knj.h: check for 2-Byte Kanji (CP 932, SJIS) codes.
Copyright 2010, 2011 Akira Kakuto.
+ Copyright 2013 TANAKA Takuji.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -23,10 +24,22 @@ extern "C" {
#endif
extern KPSEDLL int is_cp932_system;
+extern KPSEDLL int file_system_codepage;
extern KPSEDLL int isknj(int c);
extern KPSEDLL int isknj2(int c);
+extern KPSEDLL wchar_t* get_wstring_from_utf8(const char *mbstr, wchar_t *wstr);
+extern KPSEDLL wchar_t* get_wstring_from_fsyscp(const char *mbstr, wchar_t *wstr);
+extern KPSEDLL wchar_t* get_wstring_from_mbstring(int cp, const char *mbstr, wchar_t *wstr);
+
+extern KPSEDLL char* get_utf8_from_wstring(const wchar_t *wstr, char mbstr);
+extern KPSEDLL char* get_fsyscp_from_wstring(const wchar_t *wstr, char mbstr);
+extern KPSEDLL char* get_mbstring_from_wstring(int cp, const wchar_t *wstr, char *mbstr);
+
+extern KPSEDLL FILE* fsyscp_xfopen(const char *filename, const char *mode);
+ //extern KPSEDLL FILE* fsyscp_xfopen(const_string filename, const_string mode);
+
#ifdef __cplusplus
}
#endif
@@ -34,4 +47,13 @@ extern KPSEDLL int isknj2(int c);
/* True if P points to a 2-Byte Kanji (CP 932, SJIS) code. */
#define IS_KANJI(p) is_cp932_system && isknj(*(p)) && isknj2(*(p+1))
+/* Get wide string from multibyte string in UTF-8 */
+#define get_wstring_from_utf8(mb,w) get_wstring_from_mbstring(CP_UTF8,mb,w)
+/* Get multibyte string in UTF-8 from wide string */
+#define get_utf8_from_wstring(w,mb) get_mbstring_from_wstring(CP_UTF8,w,mb)
+/* Get wide string from multibyte string in file system codepage */
+#define get_wstring_from_fsyscp(mb,w) get_wstring_from_mbstring(file_system_codepage,mb,w)
+/* Get multibyte string in file system codepage from wide string */
+#define get_fsyscp_from_wstring(w,mb) get_mbstring_from_wstring(file_system_codepage,w,mb)
+
#endif /* not KPATHSEA_KNJ_H */