diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-12-01 15:05:15 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-12-01 15:05:15 +0000 |
commit | b91ea14a043007a08ec25199870aa0a3a3fbbc1f (patch) | |
tree | 9e4607d05889e3ab457a8f3c137598907b413b25 /Build/source/texk/kpathsea/knj.h | |
parent | 2fdc70b46aa72675253c5d8b51fcab18d509af38 (diff) |
Support KANJI file name in (e)up-TeX on Windows (T. Tanaka)
git-svn-id: svn://tug.org/texlive/trunk@32288 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/knj.h')
-rw-r--r-- | Build/source/texk/kpathsea/knj.h | 22 |
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 */ |