OSDN Git Service

* Modify and Add files for nkf.exe and nkf32.dll.
authorNARUSE, Yui <naruse@users.sourceforge.jp>
Mon, 17 Apr 2006 09:30:56 +0000 (09:30 +0000)
committerNARUSE, Yui <naruse@users.sourceforge.jp>
Mon, 17 Apr 2006 09:30:56 +0000 (09:30 +0000)
* Add new files.
  * nkf.mak
  * nkf32.c
  * nkf.h
  * version.rc
  * dll.rc
  * dll.def
* nkf32dll.c: update version and fix declaration of *fout.

dll.def [new file with mode: 0755]
dll.rc [new file with mode: 0755]
nkf.h [new file with mode: 0755]
nkf.mak [new file with mode: 0755]
nkf32.c [new file with mode: 0755]
nkf32dll.c
version.rc [new file with mode: 0755]

diff --git a/dll.def b/dll.def
new file mode 100755 (executable)
index 0000000..ab182c2
--- /dev/null
+++ b/dll.def
@@ -0,0 +1,27 @@
+LIBRARY nkf32.dll\r
+\r
+EXPORTS\r
+       GetNkfVersion\r
+       SetNkfOption\r
+       NkfConvert\r
+       ToHankaku\r
+       ToZenkakuKana\r
+       EncodeSubject\r
+       ToMime\r
+       NkfGetKanjiCode\r
+       NkfFileConvert1\r
+       NkfFileConvert2\r
+       NkfConvertSafe\r
+       ToHankakuSafe\r
+       ToZenkakuKanaSafe\r
+       EncodeSubjectSafe\r
+       GetNkfVersionSafeA\r
+       NkfFileConvert1SafeA\r
+       NkfFileConvert2SafeA\r
+       GetNkfGuessA\r
+       GetNkfVersionSafeW\r
+       NkfFileConvert1SafeW\r
+       NkfFileConvert2SafeW\r
+       GetNkfGuessW\r
+       GetNkfSupportFunctions\r
+       NkfUsage\r
diff --git a/dll.rc b/dll.rc
new file mode 100755 (executable)
index 0000000..21992d7
--- /dev/null
+++ b/dll.rc
@@ -0,0 +1,34 @@
+#include <windows.h>\r
+\r
+1 VERSIONINFO\r
+FILEVERSION 2,0,7,0\r
+PRODUCTVERSION 2,0,7,0\r
+FILEFLAGSMASK 0x3fL\r
+#ifdef _DEBUG\r
+FILEFLAGS 0x1L\r
+#else\r
+FILEFLAGS 0x0L\r
+#endif\r
+FILEOS VOS__WINDOWS32\r
+FILETYPE VFT_DLL\r
+FILESUBTYPE 0x0L\r
+{\r
+    BLOCK "StringFileInfo"\r
+    {\r
+        BLOCK "041103A4"\r
+        {\r
+            VALUE "CompanyName", "project nkf\0"\r
+            VALUE "FileDescription", "Network Kanji Filter\0"\r
+            VALUE "FileVersion", "2.0.7.0 1\0"\r
+            VALUE "InternalName", "nkf32\0"\r
+            VALUE "LegalCopyright", "Copyright (C) 1987, Fujitsu LTD. (Itaru ICHIKAWA); Copyright (C) 2003-2004 T.kaneto\0"\r
+            VALUE "OriginalFilename", "nkf32.c\0"\r
+            VALUE "ProductName", "nkf32.dll\0"\r
+            VALUE "ProductVersion", "2.0.7.0 1\0"\r
+        }\r
+    }\r
+    BLOCK "VarFileInfo"\r
+    {\r
+        VALUE "Translation", 0x411, 932\r
+    }\r
+}\r
diff --git a/nkf.h b/nkf.h
new file mode 100755 (executable)
index 0000000..d2e8b2f
--- /dev/null
+++ b/nkf.h
@@ -0,0 +1,77 @@
+/* nkf32.dll nkf.h */\r
+#ifndef CLASS_DECLSPEC\r
+/* dll __declspec(dllexport) */\r
+/* app __declspec(dllimport) */\r
+#define CLASS_DECLSPEC\r
+#endif\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+#ifdef __BORLANDC__\r
+#pragma argsused\r
+#endif /*__BORLANDC__*/\r
+/* uminchu nkf32103a.lzh 1.00 */\r
+void CALLBACK CLASS_DECLSPEC GetNkfVersion(LPSTR verStr);\r
+int CALLBACK CLASS_DECLSPEC SetNkfOption(LPCSTR optStr);\r
+void CALLBACK CLASS_DECLSPEC NkfConvert(LPSTR outStr, LPCSTR inStr);\r
+/* uminchu nkf32103a.lzh 1.02 */\r
+void CALLBACK CLASS_DECLSPEC ToHankaku(LPSTR inStr);\r
+void CALLBACK CLASS_DECLSPEC ToZenkakuKana(LPSTR outStr ,LPCSTR inStr);\r
+/* uminchu nkf32103a.lzh 1.03 */\r
+void CALLBACK CLASS_DECLSPEC EncodeSubject(LPSTR outStr ,LPCSTR inStr);\r
+/* tkaneto nkf32204.zip 2.0.4.0 */\r
+#ifdef TOMIME\r
+void CALLBACK CLASS_DECLSPEC ToMime(LPSTR outStr ,LPCSTR inStr);\r
+#endif /*TOMIME*/\r
+#ifdef GETKANJICODE\r
+int CALLBACK CLASS_DECLSPEC NkfGetKanjiCode(VOID);\r
+#endif /*GETKANJICODE*/\r
+#ifdef FILECONVERT1\r
+void CALLBACK CLASS_DECLSPEC NkfFileConvert1(LPCSTR fName);\r
+#endif /*FILECONVERT1*/\r
+#ifdef FILECONVERT2\r
+void CALLBACK CLASS_DECLSPEC NkfFileConvert2(LPCSTR fInName,LPCSTR fOutName);\r
+#endif /*FILECONVERT2*/\r
+#ifndef NKF32103A\r
+/* safe */\r
+BOOL WINAPI CLASS_DECLSPEC GetNkfVersionSafeA(LPSTR verStr,DWORD nBufferLength /*in TCHARs*/,LPDWORD lpTCHARsReturned /*in TCHARs*/);\r
+BOOL WINAPI CLASS_DECLSPEC NkfConvertSafe(LPSTR outStr,DWORD nOutBufferLength /*in Bytes*/,LPDWORD lpBytesReturned /*in Bytes*/, LPCSTR inStr,DWORD nInBufferLength /*in Bytes*/);\r
+BOOL WINAPI CLASS_DECLSPEC ToZenkakuKanaSafe(LPSTR outStr,DWORD nOutBufferLength /*in Bytes*/,LPDWORD lpBytesReturned /*in Bytes*/,LPCSTR inStr,DWORD nInBufferLength /*in Bytes*/);\r
+BOOL WINAPI CLASS_DECLSPEC ToHankakuSafe(LPSTR outStr,DWORD nOutBufferLength /*in Bytes*/,LPDWORD lpBytesReturned /*in Bytes*/,LPCSTR inStr,DWORD nInBufferLength /*in Bytes*/);\r
+BOOL WINAPI CLASS_DECLSPEC EncodeSubjectSafe(LPSTR outStr,DWORD nOutBufferLength /*in Bytes*/,LPDWORD lpBytesReturned /*in Bytes*/,LPCSTR inStr,DWORD nInBufferLength /*in Bytes*/);\r
+BOOL WINAPI CLASS_DECLSPEC NkfFileConvert1SafeA(LPCSTR fName,DWORD nBufferLength /*in TCHARs*/);\r
+BOOL WINAPI CLASS_DECLSPEC NkfFileConvert2SafeA(LPCSTR fInName,DWORD fInBufferLength /*in TCHARs*/,LPCSTR fOutName,DWORD fOutBufferLength /*in TCHARs*/);\r
+BOOL WINAPI CLASS_DECLSPEC GetNkfGuessA(LPSTR outStr,DWORD nBufferLength /*in TCHARs*/,LPDWORD lpTCHARsReturned /*in TCHARs*/);\r
+\r
+BOOL WINAPI CLASS_DECLSPEC GetNkfVersionSafeW(LPWSTR verStr,DWORD nBufferLength /*in TCHARs*/,LPDWORD lpTCHARsReturned /*in TCHARs*/);\r
+BOOL WINAPI CLASS_DECLSPEC NkfFileConvert1SafeW(LPCWSTR fName,DWORD nBufferLength /*in TCHARs*/);\r
+BOOL WINAPI CLASS_DECLSPEC NkfFileConvert2SafeW(LPCWSTR fInName,DWORD fInBufferLength /*in TCHARs*/,LPCWSTR fOutName,DWORD fOutBufferLength /*in TCHARs*/);\r
+BOOL WINAPI CLASS_DECLSPEC GetNkfGuessW(LPWSTR outStr,DWORD nBufferLength /*in TCHARs*/,LPDWORD lpTCHARsReturned /*in TCHARs*/);\r
+BOOL WINAPI CLASS_DECLSPEC GetNkfSupportFunctions(void *outStr,DWORD nBufferLength /*in Bytes*/,LPDWORD lpBytesReturned /*in Bytes*/);\r
+BOOL WINAPI CLASS_DECLSPEC NkfUsage(LPSTR outStr,DWORD nBufferLength /*in Bytes*/,LPDWORD lpBytesReturned /*in Bytes*/);\r
+\r
+#ifdef UNICODE\r
+#define GetNkfVersionSafe   GetNkfVersionSafeW\r
+#define GetNkfGuess         GetNkfGuessW\r
+#define NkfFileConvert1Safe NkfFileConvert1SafeW\r
+#define NkfFileConvert2Safe NkfFileConvert2SafeW\r
+#else /*UNICODE*/\r
+#define GetNkfVersionSafe   GetNkfVersionSafeA\r
+#define GetNkfGuess         GetNkfGuessA\r
+#define NkfFileConvert1Safe NkfFileConvert1SafeA\r
+#define NkfFileConvert2Safe NkfFileConvert2SafeA\r
+#endif /*UNICODE*/\r
+\r
+struct NKFSUPPORTFUNCTIONS {\r
+DWORD size;\r
+LPCSTR copyrightA;\r
+LPCSTR versionA;\r
+LPCSTR dateA;\r
+DWORD functions;\r
+};\r
+#endif /*!defined(NKF32103A)*/\r
+\r
+#ifdef __cplusplus\r
+}       // Balance extern "C" above\r
+#endif /*__cplusplus*/\r
+/* nkf32.dll nkf.h end */\r
diff --git a/nkf.mak b/nkf.mak
new file mode 100755 (executable)
index 0000000..88a5b1b
--- /dev/null
+++ b/nkf.mak
@@ -0,0 +1,67 @@
+# Visual C++ 2005 Express Edition
+CC = cl
+LD=link
+CFLAGS = -O2 -DMSDOS -DWIN32 -D__WIN32__ -D_CRT_SECURE_NO_DEPRECATE
+LD_FLAGS = 
+LIBS = user32.lib kernel32.lib gdi32.lib
+RC = rc
+
+all: nkf.exe nkf32.dll
+
+nkf.exe : nkf.obj config.h utf8tbl.obj version.res
+       $(CC) $(CFLAGS) /MT nkf.obj utf8tbl.obj version.res /link setargv.obj
+       copy nkf.exe WIN\nkf.exe
+
+# Windows NT
+nkf32.dll: nkf32.obj utf8tbl.obj dll.res
+       $(LD) $(LDFLAGS) /DLL /DEF:dll.def nkf32.obj utf8tbl.obj dll.res
+       copy nkf32.dll NT\nkf32.dll
+       copy nkf32.lib NT\nkf32.lib
+
+# Windows NT
+nkf32.lib: nkf32.obj utf8tbl.obj dll.res
+       $(LD) $(LDFLAGS) /DLL /DEF:dll.def nkf32.obj utf8tbl.obj dll.res
+       copy nkf32.dll NT\nkf32.dll
+       copy nkf32.lib NT\nkf32.lib
+
+nkf.obj : nkf.c config.h
+       $(CC) $(CFLAGS) /MT -c nkf.c
+
+# Windows NT
+nkf32.obj: nkf32.c nkf.c nkf32dll.c config.h nkf.h
+       $(CC) $(CFLAGS) /LD /DLL -DWIN32DLL -DTOMIME -DGETKANJICODE -DFILECONVERT1 -DFILECONVERT2 -DUNICODESUPPORT /c nkf32.c
+
+utf8tbl.obj : utf8tbl.c config.h
+       $(CC) $(CFLAGS) /c utf8tbl.c
+
+version.res: version.rc
+    $(RC) $(RCFLAGS) version.rc
+
+dll.res: dll.rc
+    $(RC) $(RCFLAGS) dll.rc
+
+clean:
+       -del nkf.obj
+       -del nkf32.obj
+       -del utf8tbl.obj
+       -del version.res
+       -del dll.res
+       -del nkf.exe
+       -del nkf32.dll
+       -del nkf32.lib
+
+# Windows 9x
+#nkf32.dll: nkf32.obj utf8tbl.obj dll.res
+#      $(LD) $(LDFLAGS) /DLL /DEF:dll.def nkf32.obj utf8tbl.obj dll.res
+#      copy nkf32.dll 9x\nkf32.dll
+#      copy nkf32.lib 9x\nkf32.lib
+#
+# Windows 9x
+#nkf32.lib: nkf32.obj utf8tbl.obj dll.res
+#      $(LD) $(LDFLAGS) /DLL /DEF:dll.def nkf32.obj utf8tbl.obj dll.res
+#      copy nkf32.dll 9x\nkf32.dll
+#      copy nkf32.lib 9x\nkf32.lib
+#
+# Windows 9x
+#nkf32.obj: nkf32.c nkf.c nkf32dll.c config.h nkf.h
+#      $(CC) $(CFLAGS) /LD /DLL -DWIN32DLL -DTOMIME -DGETKANJICODE -DFILECONVERT1 -DFILECONVERT2 -UUNICODESUPPORT /c nkf32.c
diff --git a/nkf32.c b/nkf32.c
new file mode 100755 (executable)
index 0000000..d417f31
--- /dev/null
+++ b/nkf32.c
@@ -0,0 +1 @@
+#include "nkf.c"
index b4532a3..0653ec4 100644 (file)
@@ -4,11 +4,11 @@
 
 /*WIN32DLL*/
 /* \82±\82¿\82ç\82Ì\83o\81[\83W\83\87\83\93\82à\8dX\90V\82µ\82Ä\82­\82¾\82³\82¢\81B */
-#define NKF_VERSIONW L"2.0.6"
+#define NKF_VERSIONW L"2.0.7"
 /* NKF_VERSION \82Ì\83\8f\83C\83h\95\8e\9a */
-#define DLL_VERSION   "2.0.6.0 1"
+#define DLL_VERSION   "2.0.7.0 1"
 /* DLL\82ª\95Ô\82· */
-#define DLL_VERSIONW L"2.0.6.0 1"
+#define DLL_VERSIONW L"2.0.7.0 1"
 /* DLL\82ª\95Ô\82· DLL_VERSION \82Ì\83\8f\83C\83h\95\8e\9a */
 
 /* nkf32.dll main */
@@ -153,7 +153,7 @@ FILE *f;
     return EOF;
 }
 
-static FILE *fout = stdout;
+static FILE *fout = NULL;
 static unsigned char *cout = NULL;
 static int nout = -1;
 static int noutmax = -1;
diff --git a/version.rc b/version.rc
new file mode 100755 (executable)
index 0000000..1b15fdd
--- /dev/null
@@ -0,0 +1,34 @@
+#include <windows.h>\r
+\r
+1 VERSIONINFO\r
+FILEVERSION 2,0,7,0\r
+PRODUCTVERSION 2,0,7,0\r
+FILEFLAGSMASK 0x3fL\r
+#ifdef _DEBUG\r
+FILEFLAGS 0x1L\r
+#else\r
+FILEFLAGS 0x0L\r
+#endif\r
+FILEOS VOS__WINDOWS32\r
+FILETYPE VFT_APP\r
+FILESUBTYPE 0x0L\r
+{\r
+    BLOCK "StringFileInfo"\r
+    {\r
+        BLOCK "041103A4"\r
+        {\r
+            VALUE "CompanyName", "project nkf\0"\r
+            VALUE "FileDescription", "Network Kanji Filter\0"\r
+            VALUE "FileVersion", "2.0.7\0"\r
+            VALUE "InternalName", "nkf\0"\r
+            VALUE "LegalCopyright", "Copyright (C) 1987, Fujitsu LTD. (Itaru ICHIKAWA)\0"\r
+            VALUE "OriginalFilename", "nkf.c\0"\r
+            VALUE "ProductName", "nkf.exe\0"\r
+            VALUE "ProductVersion", "2.0.7\0"\r
+        }\r
+    }\r
+    BLOCK "VarFileInfo"\r
+    {\r
+        VALUE "Translation", 0x411, 932\r
+    }\r
+}\r