3 * nkf.h - Header file for nkf
10 /* Wrapper of configurations */
12 #ifndef MIME_DECODE_DEFAULT
13 #define MIME_DECODE_DEFAULT STRICT_MIME
16 #define X0201_DEFAULT TRUE
19 #if DEFAULT_NEWLINE == 0x0D0A
20 #elif DEFAULT_NEWLINE == 0x0D
22 #define DEFAULT_NEWLINE 0x0A
24 #ifdef HELP_OUTPUT_STDERR
25 #define HELP_OUTPUT stderr
27 #define HELP_OUTPUT stdout
31 /* Compatibility definitions */
34 #elif defined(INT_IS_SHORT)
35 typedef long nkf_char;
36 #define NKF_INT32_C(n) (n##L)
39 #define NKF_INT32_C(n) (n)
42 #if (defined(__TURBOC__) || defined(_MSC_VER) || defined(LSI_C) || (defined(__WATCOMC__) && defined(__386__) && !defined(__LINUX__)) || defined(__MINGW32__) || defined(__EMX__) || defined(__MSDOS__) || defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__)) && !defined(MSDOS)
44 #if (defined(__Win32__) || defined(_WIN32)) && !defined(__WIN32__)
60 #if defined(MSDOS) || defined(__OS2__)
63 #if defined(_MSC_VER) || defined(__WATCOMC__)
64 #define mktemp _mktemp
70 #define setbinmode(fp) fsetbin(fp)
71 #elif defined(__DJGPP__)
72 #include <libc/dosio.h>
73 void setbinmode(FILE *fp)
75 /* we do not use libc's setmode(), which changes COOKED/RAW mode in device. */
78 m = (__file_handle_modes[fd] & (~O_TEXT)) | O_BINARY;
79 __file_handle_set(fd, m);
81 #else /* Microsoft C, Turbo C */
82 #define setbinmode(fp) setmode(fileno(fp), O_BINARY)
85 #define setbinmode(fp) (void)(fp)
88 #ifdef _IOFBF /* SysV and MSDOS, Windows */
89 #define setvbuffer(fp, buf, size) setvbuf(fp, buf, _IOFBF, size)
91 #define setvbuffer(fp, buf, size) setbuffer(fp, buf, size)
94 /*Borland C++ 4.5 EasyWin*/
95 #if defined(__TURBOC__) && defined(_Windows) && !defined(__WIN32__) /*Easy Win */
104 /* added by satoru@isoternet.org */
106 #include <sys/types.h>
108 #include <sys/stat.h>
109 #if !defined(MSDOS) || defined(__DJGPP__) /* UNIX, djgpp */
111 #if defined(__WATCOMC__)
112 #include <sys/utime.h>
116 #else /* defined(MSDOS) */
118 #ifdef __BORLANDC__ /* BCC32 */
120 #else /* !defined(__BORLANDC__) */
121 #include <sys/utime.h>
122 #endif /* (__BORLANDC__) */
123 #else /* !defined(__WIN32__) */
124 #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(__OS2__) || defined(__EMX__) || defined(__IBMC__) || defined(__IBMCPP__) /* VC++, MinGW, Watcom, emx+gcc, IBM VAC++ */
125 #include <sys/utime.h>
126 #elif defined(__TURBOC__) /* BCC */
128 #elif defined(LSI_C) /* LSI C */
129 #endif /* (__WIN32__) */
134 #if !defined(DEFAULT_CODE_JIS) && !defined(DEFAULT_CODE_SJIS) && \
135 !defined(DEFAULT_CODE_WINDOWS_31J) && !defined(DEFAULT_CODE_EUC) && \
136 !defined(DEFAULT_CODE_UTF8) && !defined(DEFAULT_CODE_LOCALE)
137 #define DEFAULT_CODE_LOCALE
140 #ifdef DEFAULT_CODE_LOCALE
142 #if defined(__WIN32__) /* not win32 should be posix */
143 # ifndef HAVE_LOCALE_H
144 # define HAVE_LOCALE_H
146 #elif defined(__OS2__)
147 # undef HAVE_LANGINFO_H /* We do not use kLIBC's langinfo. */
148 # ifndef HAVE_LOCALE_H
149 # define HAVE_LOCALE_H
152 # ifndef HAVE_LOCALE_H
153 # define HAVE_LOCALE_H
155 #elif defined(__BIONIC__) /* bionic doesn't have locale */
157 # ifndef HAVE_LANGINFO_H
158 # define HAVE_LANGINFO_H
160 # ifndef HAVE_LOCALE_H
161 # define HAVE_LOCALE_H
165 #ifdef HAVE_LANGINFO_H
166 #include <langinfo.h>
172 #endif /* DEFAULT_CODE_LOCALE */
178 #if defined(__GNUC__)
179 # define ARG_UNUSED __attribute__ ((unused))