ext/nkf/nkf-utf8/nkf.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * nkf.h - Header file for nkf
00004  *
00005  */
00006 
00007 #ifndef NKF_H
00008 #define NKF_H
00009 
00010 /* Wrapper of configurations */
00011 
00012 #ifndef MIME_DECODE_DEFAULT
00013 #define MIME_DECODE_DEFAULT STRICT_MIME
00014 #endif
00015 #ifndef X0201_DEFAULT
00016 #define X0201_DEFAULT TRUE
00017 #endif
00018 
00019 #if DEFAULT_NEWLINE == 0x0D0A
00020 #elif DEFAULT_NEWLINE == 0x0D
00021 #else
00022 #define DEFAULT_NEWLINE 0x0A
00023 #endif
00024 #ifdef HELP_OUTPUT_STDERR
00025 #define HELP_OUTPUT stderr
00026 #else
00027 #define HELP_OUTPUT stdout
00028 #endif
00029 
00030 
00031 /* Compatibility definitions */
00032 
00033 #ifdef nkf_char
00034 #elif defined(INT_IS_SHORT)
00035 typedef long nkf_char;
00036 #define NKF_INT32_C(n)   (n##L)
00037 #else
00038 typedef int nkf_char;
00039 #define NKF_INT32_C(n)   (n)
00040 #endif
00041 
00042 #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)
00043 #define MSDOS
00044 #if (defined(__Win32__) || defined(_WIN32)) && !defined(__WIN32__)
00045 #define __WIN32__
00046 #endif
00047 #endif
00048 
00049 #ifdef PERL_XS
00050 #undef OVERWRITE
00051 #endif
00052 
00053 #ifndef PERL_XS
00054 #include <stdio.h>
00055 #endif
00056 
00057 #include <stdlib.h>
00058 #include <string.h>
00059 
00060 #if defined(MSDOS) || defined(__OS2__)
00061 #include <fcntl.h>
00062 #include <io.h>
00063 #if defined(_MSC_VER) || defined(__WATCOMC__)
00064 #define mktemp _mktemp
00065 #endif
00066 #endif
00067 
00068 #ifdef MSDOS
00069 #ifdef LSI_C
00070 #define setbinmode(fp) fsetbin(fp)
00071 #elif defined(__DJGPP__)
00072 #include <libc/dosio.h>
00073 void  setbinmode(FILE *fp)
00074 {
00075     /* we do not use libc's setmode(), which changes COOKED/RAW mode in device. */
00076     int fd, m;
00077     fd = fileno(fp);
00078     m = (__file_handle_modes[fd] & (~O_TEXT)) | O_BINARY;
00079     __file_handle_set(fd, m);
00080 }
00081 #else /* Microsoft C, Turbo C */
00082 #define setbinmode(fp) setmode(fileno(fp), O_BINARY)
00083 #endif
00084 #else /* UNIX */
00085 #define setbinmode(fp) (void)(fp)
00086 #endif
00087 
00088 #ifdef _IOFBF /* SysV and MSDOS, Windows */
00089 #define       setvbuffer(fp, buf, size)       setvbuf(fp, buf, _IOFBF, size)
00090 #else /* BSD */
00091 #define       setvbuffer(fp, buf, size)       setbuffer(fp, buf, size)
00092 #endif
00093 
00094 /*Borland C++ 4.5 EasyWin*/
00095 #if defined(__TURBOC__) && defined(_Windows) && !defined(__WIN32__) /*Easy Win */
00096 #define         EASYWIN
00097 #ifndef __WIN16__
00098 #define __WIN16__
00099 #endif
00100 #include <windows.h>
00101 #endif
00102 
00103 #ifdef OVERWRITE
00104 /* added by satoru@isoternet.org */
00105 #if defined(__EMX__)
00106 #include <sys/types.h>
00107 #endif
00108 #include <sys/stat.h>
00109 #if !defined(MSDOS) || defined(__DJGPP__) /* UNIX, djgpp */
00110 #include <unistd.h>
00111 #if defined(__WATCOMC__)
00112 #include <sys/utime.h>
00113 #else
00114 #include <utime.h>
00115 #endif
00116 #else /* defined(MSDOS) */
00117 #ifdef __WIN32__
00118 #ifdef __BORLANDC__ /* BCC32 */
00119 #include <utime.h>
00120 #else /* !defined(__BORLANDC__) */
00121 #include <sys/utime.h>
00122 #endif /* (__BORLANDC__) */
00123 #else /* !defined(__WIN32__) */
00124 #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(__OS2__) || defined(__EMX__) || defined(__IBMC__) || defined(__IBMCPP__)  /* VC++, MinGW, Watcom, emx+gcc, IBM VAC++ */
00125 #include <sys/utime.h>
00126 #elif defined(__TURBOC__) /* BCC */
00127 #include <utime.h>
00128 #elif defined(LSI_C) /* LSI C */
00129 #endif /* (__WIN32__) */
00130 #endif
00131 #endif
00132 #endif
00133 
00134 #if !defined(DEFAULT_CODE_JIS) && !defined(DEFAULT_CODE_SJIS) && \
00135         !defined(DEFAULT_CODE_WINDOWS_31J) && !defined(DEFAULT_CODE_EUC) && \
00136         !defined(DEFAULT_CODE_UTF8) && !defined(DEFAULT_CODE_LOCALE)
00137 #define DEFAULT_CODE_LOCALE
00138 #endif
00139 
00140 #ifdef DEFAULT_CODE_LOCALE
00141 
00142 #if defined(__WIN32__) /* not win32 should be posix */
00143 # ifndef HAVE_LOCALE_H
00144 #  define HAVE_LOCALE_H
00145 # endif
00146 #elif defined(__OS2__)
00147 # undef HAVE_LANGINFO_H /* We do not use kLIBC's langinfo. */
00148 # ifndef HAVE_LOCALE_H
00149 #  define HAVE_LOCALE_H
00150 # endif
00151 #elif defined(MSDOS)
00152 # ifndef HAVE_LOCALE_H
00153 #  define HAVE_LOCALE_H
00154 # endif
00155 #elif defined(__BIONIC__) /* bionic doesn't have locale */
00156 #else
00157 # ifndef HAVE_LANGINFO_H
00158 #  define HAVE_LANGINFO_H
00159 # endif
00160 # ifndef HAVE_LOCALE_H
00161 #  define HAVE_LOCALE_H
00162 # endif
00163 #endif
00164 
00165 #ifdef HAVE_LANGINFO_H
00166 #include <langinfo.h>
00167 #endif
00168 #ifdef HAVE_LOCALE_H
00169 #include <locale.h>
00170 #endif
00171 
00172 #endif /* DEFAULT_CODE_LOCALE */
00173 
00174 #define         FALSE   0
00175 #define         TRUE    1
00176 
00177 #ifndef ARG_UNUSED
00178 #if defined(__GNUC__)
00179 #  define ARG_UNUSED  __attribute__ ((unused))
00180 #else
00181 #  define ARG_UNUSED
00182 #endif
00183 #endif
00184 
00185 #ifdef WIN32DLL
00186 #include "nkf32.h"
00187 #endif
00188 
00189 #endif /* NKF_H */
00190 

Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7