X-Git-Url: http://git.sourceforge.jp/view?p=nkf%2Fnkf.git;a=blobdiff_plain;f=config.h;h=9da82c6aeefe6cf8975f4b00801c35410c1b7669;hp=e1d091d018a810d5ab18c1685d9d8f75f87b25d5;hb=31a6ee409f17e7c1c9cf92e033329636b0cb1720;hpb=295f414b18c6d1c687913524c05025f23239ac97 diff --git a/config.h b/config.h index e1d091d..9da82c6 100644 --- a/config.h +++ b/config.h @@ -5,22 +5,57 @@ #define UTF8_INPUT_ENABLE #define UTF8_OUTPUT_ENABLE +/* Shift_JIS 範囲外の文字を、CP932 で同値な文字に読み換える */ +#define SHIFTJIS_CP932 + /* オプションで入力を指定した時に、文字コードを固定する */ #define INPUT_CODE_FIX -/* -OW オプション */ +/* --overwrite オプション */ /* by Satoru Takabayashi */ #define OVERWRITE /* --cap-input, --url-input オプション */ -#define CAP_URL_OPTION +#define INPUT_OPTION + +/* --numchar-input オプション */ +#define NUMCHAR_OPTION /* --debug, --no-output オプション */ #define CHECK_OPTION +/* JIS X0212 */ +#define X0212_ENABLE + +/* --exec-in, --exec-out オプション + * pipe, fork, execvp あたりが無いと動きません。 + * MS-DOS, MinGW などでは undef にしてください + * child process 終了時の処理がいいかげんなので、 + * デフォルトで無効にしています。 + */ +/* #define EXEC_IO */ + /* SunOS の cc を使うときは undef にしてください */ #define ANSI_C_PROTOTYPE +/* int が 32bit 未満の環境で NUMCHAR_OPTION を使うには、 + * コメントを外してください。 + */ +/* #define INT_IS_SHORT */ + + +#if defined(INT_IS_SHORT) +typedef long nkf_char; +typedef unsigned char nkf_nfchar; +#else +typedef int nkf_char; +typedef int nkf_nfchar; +#endif + +/* Unicode Normalization */ +#define UNICODE_NORMALIZATION + +#ifndef WIN32DLL /******************************/ /* デフォルトの出力コード選択 */ /* Select DEFAULT_CODE */ @@ -29,5 +64,25 @@ /* #define DEFAULT_CODE_EUC */ /* #define DEFAULT_CODE_UTF8 */ /******************************/ +#else +#define DEFAULT_CODE_SJIS +#endif + +#if defined(NUMCHAR_OPTION) && !defined(UTF8_INPUT_ENABLE) +#define UTF8_INPUT_ENABLE +#endif + +#ifdef UNICODE_NORMALIZATION +#ifndef UTF8_INPUT_ENABLE +#define UTF8_INPUT_ENABLE +#endif +#define NORMALIZATION_TABLE_LENGTH 942 +#define NORMALIZATION_TABLE_NFC_LENGTH 3 +#define NORMALIZATION_TABLE_NFD_LENGTH 9 +struct normalization_pair{ + const nkf_nfchar nfc[NORMALIZATION_TABLE_NFC_LENGTH]; + const nkf_nfchar nfd[NORMALIZATION_TABLE_NFD_LENGTH]; +}; +#endif #endif /* _CONFIG_H_ */