3 * nkf.h - Header file for nkf
5 * $Id: nkf.h,v 1.6 2008/11/07 02:43:43 naruse Exp $
11 /* Wrapper of configurations */
13 #ifndef MIME_DECODE_DEFAULT
14 #define MIME_DECODE_DEFAULT STRICT_MIME
17 #define X0201_DEFAULT TRUE
20 #if DEFAULT_NEWLINE == 0x0D0A
21 #elif DEFAULT_NEWLINE == 0x0D
23 #define DEFAULT_NEWLINE 0x0A
25 #ifdef HELP_OUTPUT_STDERR
26 #define HELP_OUTPUT stderr
28 #define HELP_OUTPUT stdout
32 /* Compatibility definitions */
35 #elif defined(INT_IS_SHORT)
36 typedef long nkf_char;
37 #define NKF_INT32_C(n) (n##L)
40 #define NKF_INT32_C(n) (n)
43 #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)
45 #if (defined(__Win32__) || defined(_WIN32)) && !defined(__WIN32__)
61 #if defined(MSDOS) || defined(__OS2__)
64 #if defined(_MSC_VER) || defined(__WATCOMC__)
65 #define mktemp _mktemp
71 #define setbinmode(fp) fsetbin(fp)
72 #elif defined(__DJGPP__)
73 #include <libc/dosio.h>
74 void setbinmode(FILE *fp)
76 /* we do not use libc's setmode(), which changes COOKED/RAW mode in device. */
79 m = (__file_handle_modes[fd] & (~O_TEXT)) | O_BINARY;
80 __file_handle_set(fd, m);
82 #else /* Microsoft C, Turbo C */
83 #define setbinmode(fp) setmode(fileno(fp), O_BINARY)
86 #define setbinmode(fp) (void)(fp)
89 #ifdef _IOFBF /* SysV and MSDOS, Windows */
90 #define setvbuffer(fp, buf, size) setvbuf(fp, buf, _IOFBF, size)
92 #define setvbuffer(fp, buf, size) setbuffer(fp, buf, size)
95 /*Borland C++ 4.5 EasyWin*/
96 #if defined(__TURBOC__) && defined(_Windows) && !defined(__WIN32__) /*Easy Win */
105 /* added by satoru@isoternet.org */
107 #include <sys/types.h>
109 #include <sys/stat.h>
110 #if !defined(MSDOS) || defined(__DJGPP__) /* UNIX, djgpp */
112 #if defined(__WATCOMC__)
113 #include <sys/utime.h>
117 #else /* defined(MSDOS) */
119 #ifdef __BORLANDC__ /* BCC32 */
121 #else /* !defined(__BORLANDC__) */
122 #include <sys/utime.h>
123 #endif /* (__BORLANDC__) */
124 #else /* !defined(__WIN32__) */
125 #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(__OS2__) || defined(__EMX__) || defined(__IBMC__) || defined(__IBMCPP__) /* VC++, MinGW, Watcom, emx+gcc, IBM VAC++ */
126 #include <sys/utime.h>
127 #elif defined(__TURBOC__) /* BCC */
129 #elif defined(LSI_C) /* LSI C */
130 #endif /* (__WIN32__) */
135 #if !defined(DEFAULT_CODE_JIS) && !defined(DEFAULT_CODE_SJIS) && \
136 !defined(DEFAULT_CODE_WINDOWS_31J) && !defined(DEFAULT_CODE_EUC) && \
137 !defined(DEFAULT_CODE_UTF8) && !defined(DEFAULT_CODE_LOCALE)
138 #define DEFAULT_CODE_LOCALE
141 #ifdef DEFAULT_CODE_LOCALE
143 #if defined(__WIN32__) /* not win32 should be posix */
144 # ifndef HAVE_LOCALE_H
145 # define HAVE_LOCALE_H
147 #elif defined(__OS2__)
148 # undef HAVE_LANGINFO_H /* We do not use kLIBC's langinfo. */
149 # ifndef HAVE_LOCALE_H
150 # define HAVE_LOCALE_H
153 # ifndef HAVE_LOCALE_H
154 # define HAVE_LOCALE_H
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 */