1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
#ifndef NKF_H
#define NKF_H
#ifndef MIME_DECODE_DEFAULT
#define MIME_DECODE_DEFAULT STRICT_MIME
#endif
#ifndef X0201_DEFAULT
#define X0201_DEFAULT TRUE
#endif
#if DEFAULT_NEWLINE == 0x0D0A
#elif DEFAULT_NEWLINE == 0x0D
#else
#define DEFAULT_NEWLINE 0x0A
#endif
#ifdef HELP_OUTPUT_STDERR
#define HELP_OUTPUT stderr
#else
#define HELP_OUTPUT stdout
#endif
#ifdef nkf_char
#elif defined(INT_IS_SHORT)
typedef long nkf_char;
#define NKF_INT32_C(n) (n##L)
#else
typedef int nkf_char;
#define NKF_INT32_C(n) (n)
#endif
#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)
#define MSDOS
#if (defined(__Win32__) || defined(_WIN32)) && !defined(__WIN32__)
#define __WIN32__
#endif
#endif
#ifdef PERL_XS
#undef OVERWRITE
#endif
#ifndef PERL_XS
#include <stdio.h>
#endif
#include <stdlib.h>
#include <string.h>
#if defined(MSDOS) || defined(__OS2__)
#include <fcntl.h>
#include <io.h>
#if defined(_MSC_VER) || defined(__WATCOMC__)
#define mktemp _mktemp
#endif
#endif
#ifdef MSDOS
#ifdef LSI_C
#define setbinmode(fp) fsetbin(fp)
#elif defined(__DJGPP__)
#include <libc/dosio.h>
void setbinmode(FILE *fp)
{
int fd, m;
fd = fileno(fp);
m = (__file_handle_modes[fd] & (~O_TEXT)) | O_BINARY;
__file_handle_set(fd, m);
}
#else
#define setbinmode(fp) setmode(fileno(fp), O_BINARY)
#endif
#else
#define setbinmode(fp) (void)(fp)
#endif
#ifdef _IOFBF
#define setvbuffer(fp, buf, size) setvbuf(fp, buf, _IOFBF, size)
#else
#define setvbuffer(fp, buf, size) setbuffer(fp, buf, size)
#endif
#if defined(__TURBOC__) && defined(_Windows) && !defined(__WIN32__)
#define EASYWIN
#ifndef __WIN16__
#define __WIN16__
#endif
#include <windows.h>
#endif
#ifdef OVERWRITE
#if defined(__EMX__)
#include <sys/types.h>
#endif
#include <sys/stat.h>
#if !defined(MSDOS) || defined(__DJGPP__)
#include <unistd.h>
#if defined(__WATCOMC__)
#include <sys/utime.h>
#else
#include <utime.h>
#endif
#else
#ifdef __WIN32__
#ifdef __BORLANDC__
#include <utime.h>
#else
#include <sys/utime.h>
#endif
#else
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(__OS2__) || defined(__EMX__) || defined(__IBMC__) || defined(__IBMCPP__)
#include <sys/utime.h>
#elif defined(__TURBOC__)
#include <utime.h>
#elif defined(LSI_C)
#endif
#endif
#endif
#endif
#if !defined(DEFAULT_CODE_JIS) && !defined(DEFAULT_CODE_SJIS) && \
!defined(DEFAULT_CODE_WINDOWS_31J) && !defined(DEFAULT_CODE_EUC) && \
!defined(DEFAULT_CODE_UTF8) && !defined(DEFAULT_CODE_LOCALE)
#define DEFAULT_CODE_LOCALE
#endif
#ifdef DEFAULT_CODE_LOCALE
#if defined(__WIN32__)
# ifndef HAVE_LOCALE_H
# define HAVE_LOCALE_H
# endif
#elif defined(__OS2__)
# undef HAVE_LANGINFO_H
# ifndef HAVE_LOCALE_H
# define HAVE_LOCALE_H
# endif
#elif defined(MSDOS)
# ifndef HAVE_LOCALE_H
# define HAVE_LOCALE_H
# endif
#elif defined(__BIONIC__)
#else
# ifndef HAVE_LANGINFO_H
# define HAVE_LANGINFO_H
# endif
# ifndef HAVE_LOCALE_H
# define HAVE_LOCALE_H
# endif
#endif
#ifdef HAVE_LANGINFO_H
#include <langinfo.h>
#endif
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
#endif
#define FALSE 0
#define TRUE 1
#ifndef ARG_UNUSED
#if defined(__GNUC__)
# define ARG_UNUSED __attribute__ ((unused))
#else
# define ARG_UNUSED
#endif
#endif
#ifdef WIN32DLL
#include "nkf32.h"
#endif
#endif
|