diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-06-28 10:20:13 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-06-28 10:20:13 +0000 |
commit | ba2c33bcc94b39c1eabe62fee838173aa14e76c4 (patch) | |
tree | fb6cf347803b10bcf894aa69535dc0b2b60d6809 /Build/source/texk/kpathsea/knj.h | |
parent | f39500686f1d59c546088298de78c179dc55189e (diff) |
kpathsea: Eliminate global and static variables (w32 only)
git-svn-id: svn://tug.org/texlive/trunk@41557 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/knj.h')
-rw-r--r-- | Build/source/texk/kpathsea/knj.h | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/Build/source/texk/kpathsea/knj.h b/Build/source/texk/kpathsea/knj.h index fc1b808b231..008678c0b92 100644 --- a/Build/source/texk/kpathsea/knj.h +++ b/Build/source/texk/kpathsea/knj.h @@ -1,6 +1,6 @@ /* knj.h: check for 2-Byte Kanji (CP 932, SJIS) codes. - Copyright 2010, 2014 Akira Kakuto. + Copyright 2010, 2014, 2016 Akira Kakuto. Copyright 2013, 2014 TANAKA Takuji. This library is free software; you can redistribute it and/or @@ -23,14 +23,32 @@ extern "C" { #endif -extern KPSEDLL int is_cp932_system; -extern KPSEDLL int file_system_codepage; +extern KPSEDLL wchar_t* get_wstring_from_mbstring(int cp, const char *mbstr, wchar_t *wstr); +extern KPSEDLL char* get_mbstring_from_wstring(int cp, const wchar_t *wstr, char *mbstr); +extern KPSEDLL int kpathsea_isknj(kpathsea kpse, int c); +extern KPSEDLL int kpathsea_isknj2(kpathsea kpse, int c); +extern KPSEDLL FILE* kpathsea_fsyscp_xfopen(kpathsea kpse, const char *filename, const char *mode); +extern KPSEDLL FILE* kpathsea_fsyscp_fopen(kpathsea kpse, const char *filename, const char *mode); +extern KPSEDLL FILE* kpathsea_fsyscp_popen(kpathsea kpse, const char *command, const char *mode); +extern KPSEDLL int kpathsea_fsyscp_spawnvp(kpathsea kpse, int mode, const char *command, const char* const *argv); +extern KPSEDLL int kpathsea_fsyscp_system(kpathsea kpse, const char *cmd); +extern KPSEDLL int kpathsea_get_command_line_args_utf8(kpathsea kpse, const char *enc, int *p_ac, char ***p_av); +extern KPSEDLL int kpathsea_win32_getc(kpathsea kpse, FILE *fp); +extern KPSEDLL int kpathsea_win32_ungetc(kpathsea kpse, int c, FILE *fp); +extern KPSEDLL int kpathsea_win32_fputs(kpathsea kpse, const char *str, FILE *fp); +extern KPSEDLL int kpathsea_win32_puts(kpathsea kpse, const char *str); +extern KPSEDLL int kpathsea_win32_vfprintf(kpathsea kpse, FILE *fp, const char *format, va_list argp); +extern KPSEDLL int kpathsea_win32_putc(kpathsea kpse, int c, FILE *fp); +extern KPSEDLL int kpathsea_IS_KANJI(kpathsea kpse, char *p); +extern KPSEDLL char *kpathsea_get_fsyscp_from_wstring(kpathsea kpse, const wchar_t *w,char *mb); +extern KPSEDLL wchar_t *kpathsea_get_wstring_from_fsyscp(kpathsea kpse, const char *mb,wchar_t *w); + +#if defined (KPSE_COMPAT_API) +#define is_cp932_system kpse_def->Is_cp932_system +#define file_system_codepage kpse_def->File_system_codepage extern KPSEDLL int isknj(int c); extern KPSEDLL int isknj2(int c); - -extern KPSEDLL wchar_t* get_wstring_from_mbstring(int cp, const char *mbstr, wchar_t *wstr); -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_fopen(const char *filename, const char *mode); extern KPSEDLL FILE* fsyscp_popen(const char *command, const char *mode); @@ -43,21 +61,17 @@ extern KPSEDLL int win32_fputs(const char *str, FILE *fp); extern KPSEDLL int win32_puts(const char *str); extern KPSEDLL int win32_vfprintf(FILE *fp, const char *format, va_list argp); extern KPSEDLL int win32_putc(int c, FILE *fp); - +extern KPSEDLL int IS_KANJI(char *p); +extern KPSEDLL char *get_fsyscp_from_wstring(const wchar_t *w,char *mb); +extern KPSEDLL wchar_t *get_wstring_from_fsyscp(const char *mb,wchar_t *w); +#endif #ifdef __cplusplus } #endif -/* 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 */ |