diff options
Diffstat (limited to 'win32/msg')
-rw-r--r-- | win32/msg/Makefile | 49 | ||||
-rw-r--r-- | win32/msg/makerc.pl | 43 | ||||
-rw-r--r-- | win32/msg/makercjp.pl | 31 | ||||
-rw-r--r-- | win32/msg/makercrc.pl | 35 | ||||
-rw-r--r-- | win32/msg/stubdll.c | 7 | ||||
-rw-r--r-- | win32/msg/test.c | 33 |
6 files changed, 198 insertions, 0 deletions
diff --git a/win32/msg/Makefile b/win32/msg/Makefile new file mode 100644 index 0000000000000..bfe1e3541a118 --- /dev/null +++ b/win32/msg/Makefile @@ -0,0 +1,49 @@ +!if "$(PROCESSOR_ARCHITECTURE)" == "x86"
+MACHINE = ix86
+!else if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
+MACHINE = alpha
+!else #Assume win9x
+MACHINE = ix86
+!endif
+LIBS= libcmt.lib kernel32.lib
+
+all: tcshfr.dll tcshc.dll tcshde.dll tcshsp.dll tcshja.dll tcsh-it.dll
+
+stubdll.obj:stubdll.c
+ cl -W3 -MT -c stubdll.c
+
+tcshgr.dll: tcshgr.res stubdll.obj
+ link -machine:$(MACHINE) -nodefaultlib $(LIBS) tcshgr.res stubdll.obj \
+ -out:tcshgr.dll
+
+tcshfr.dll: tcshfr.res stubdll.obj
+ link -machine:$(MACHINE) -dll -nodefaultlib $(LIBS) tcshfr.res stubdll.obj \
+ -out:tcshfr.dll
+
+tcshde.dll: tcshde.res stubdll.obj
+ link -machine:$(MACHINE) -dll -nodefaultlib $(LIBS) tcshde.res stubdll.obj \
+ -out:tcshde.dll
+
+tcshsp.dll: tcshsp.res stubdll.obj
+ link -machine:$(MACHINE) -dll -nodefaultlib $(LIBS) tcshsp.res stubdll.obj \
+ -out:tcshsp.dll
+
+tcsh-it.dll: tcsh-it.res stubdll.obj
+ link -machine:$(MACHINE) -dll -nodefaultlib $(LIBS) tcsh-it.res stubdll.obj\
+ -out:tcsh-it.dll
+
+tcshja.dll: tcshja.res stubdll.obj
+ link -machine:$(MACHINE) -dll -nodefaultlib $(LIBS) tcshja.res stubdll.obj \
+ -out:tcshja.dll
+
+tcshc.dll: tcshc.res stubdll.obj
+ link -machine:$(MACHINE) -dll -nodefaultlib $(LIBS) tcshc.res stubdll.obj \
+ -out:tcshc.dll
+
+test.exe: test.obj
+ link test.obj user32.lib -out:test.exe
+clean:
+ -del *.obj *.res
+
+cleanall: clean
+ -del *.dll *.exe
diff --git a/win32/msg/makerc.pl b/win32/msg/makerc.pl new file mode 100644 index 0000000000000..39805f7c39147 --- /dev/null +++ b/win32/msg/makerc.pl @@ -0,0 +1,43 @@ +# This script converts a tcsh nls file into a format suitable for compiling
+# with RC and stubdll.c. This gives us a stringtable resource in the DLL
+# which can be loaded at startup for tcsh messages.
+#
+# Depending on the languages, the final output may take some tweaking. I have
+# not been able to get Greek to compile in the resource compiler. French,
+# German, and the C locale seem to work.
+#
+# This prints to stdout, so redirect to appropriate place.
+#
+# The alogrithm is simple :
+#
+# String ID = set number * 10,000 + message number
+#
+# This is because we cannot have two messages with the same id.
+#
+# -amol 9/15/96
+#
+#
+print "#include <windows.h>\n";
+print "STRINGTABLE DISCARDABLE\n";
+print "BEGIN\n";
+
+for($i=1; $i <32;$i++) {
+ $filename = "set" . $i;
+
+ open(CURRSET,$filename);
+
+ while(<CURRSET>) {
+ chop $_;
+ if (/^\$/) {
+ print "//" . $_ . "\n";
+ }
+ else {
+# comment following for greek ???
+ s/\"/\"\"/g;
+ ($num,$line)= split(' ',$_,2);
+ print ($i*10000 + $num);
+ print " \"" . $line . "\"\n";
+ }
+ }
+}
+print "END\n"
diff --git a/win32/msg/makercjp.pl b/win32/msg/makercjp.pl new file mode 100644 index 0000000000000..39694a850a4f1 --- /dev/null +++ b/win32/msg/makercjp.pl @@ -0,0 +1,31 @@ +# This script is almost as same as makerc.pl except that the coding of
+# nls files is converted from euc_japan to shift_jis by nkf.exe
+#
+# this is for japanese nls files
+#
+# 1998/09/23 - nayuta
+
+print "#include <windows.h>\n";
+print "STRINGTABLE DISCARDABLE\n";
+print "BEGIN\n";
+
+for($i=1; $i <32;$i++) {
+ $filename = "set" . $i;
+
+ open(CURRSET,"nkf -E -s $filename |");
+
+ while(<CURRSET>) {
+ chop $_;
+ if (/^\$/) {
+ print "//" . $_ . "\n";
+ }
+ else {
+# comment following for greek ???
+ s/\"/\"\"/g;
+ ($num,$line)= split(' ',$_,2);
+ print ($i*10000 + $num);
+ print " \"" . $line . "\"\n";
+ }
+ }
+}
+print "END\n"
diff --git a/win32/msg/makercrc.pl b/win32/msg/makercrc.pl new file mode 100644 index 0000000000000..d75dea79ee5c0 --- /dev/null +++ b/win32/msg/makercrc.pl @@ -0,0 +1,35 @@ +# This script converts a .tcshrc file into a format suitable for compiling
+# with RC and stubdll.c. This gives us a stringtable resource in the DLL
+# which can be loaded with the loadresource builtin
+#
+# This prints to stdout, so redirect to appropriate place.
+#
+# The alogrithm is simple :
+#
+# String ID = 666 + line number
+#
+# -amol 3/28/01
+#
+#
+print "#include <windows.h>\n";
+print "STRINGTABLE DISCARDABLE\n";
+print "BEGIN\n";
+
+$filename = $ARGV[0];
+
+open(RCFILE,$filename);
+
+$i = 666;
+while(<RCFILE>) {
+ chop $_;
+ next if (/^#/) ;
+ next if (/^$/);
+
+ s/\"/\"\"/g;
+# print $_;
+
+ print ($i);
+ print " \"" . $_ . "\"\n";
+ $i++;
+}
+print "END\n"
diff --git a/win32/msg/stubdll.c b/win32/msg/stubdll.c new file mode 100644 index 0000000000000..aadadb79237d9 --- /dev/null +++ b/win32/msg/stubdll.c @@ -0,0 +1,7 @@ +#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+BOOL WINAPI DllEntryPoint(HINSTANCE hdll,DWORD dwreason,LPVOID ignore) {
+
+ return 1;
+}
diff --git a/win32/msg/test.c b/win32/msg/test.c new file mode 100644 index 0000000000000..d47d5933812b0 --- /dev/null +++ b/win32/msg/test.c @@ -0,0 +1,33 @@ +#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <stdio.h>
+#include <locale.h>
+
+void main(int argc, char **argv) {
+
+ HINSTANCE hinst;
+ WCHAR buffer[128];
+ unsigned char winbuf[128],oembuf[128];
+ unsigned int number;
+
+ if (argc <3)
+ return;
+
+ hinst = LoadLibrary(argv[1]);
+
+ number = atoi(argv[2]);
+ printf("Load String returns %i\n",
+ LoadStringW(hinst, number, buffer, sizeof(buffer)));
+
+ WideCharToMultiByte(CP_OEMCP,
+ 0,
+ buffer,
+ -1,
+ winbuf,
+ 128,
+ NULL,
+ NULL);
+
+ CharToOem(winbuf,oembuf);
+ printf("oem: %s\n",oembuf);
+}
|