summaryrefslogtreecommitdiff
path: root/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-04-cjklatex
blob: 7f527c9e281b37e9ac61e39a44b09e2ee89bcf6b (plain)
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
diff -ur cjkutils-4.8.2.orig/cjklatex/cjklatex.c cjkutils-4.8.2/cjklatex/cjklatex.c
--- cjkutils-4.8.2.orig/cjklatex/cjklatex.c	2008-12-29 00:00:00.000000000 +0100
+++ cjkutils-4.8.2/cjklatex/cjklatex.c	2010-12-19 16:17:26.000000000 +0100
@@ -27,29 +27,31 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <win32lib.h>
 
 #include <kpathsea/config.h>
 #include <kpathsea/lib.h>
 #include <kpathsea/getopt.h>
 
-static char *cjklatex_version_string = "1.0";
+#if defined(WIN32) && !defined(__MINGW32__)
+#include <kpathsea/win32lib.h>
+#endif
+
+static const char *cjklatex_version_string = "1.0";
 
 static const char *usage_str[] = {
   "Usage: %s OPTIONS FILE\n",
   "Calls `latex' on FILE after conversion by the filter\n",
   "specified by OPTIONS.\n",
   "--conv=bg5\tfor traditional Chinese, encoding Big 5,\n",
-  "--conv=bg5p\tfor Chinese, encoding Big 5+,\n",
   "--conv=cef\tfor Chinese Encoding Framework, encoding CEF,\n",
   "--conv=cef5\tidem CEF, also converts Big5 characters,\n",
   "--conv=cefs\tidem CEF, also converts SJIS characters,\n",
-  "--conv=sjis\tfor Japanese, SJIS encoding,\n",
-  "--conv=gbk\tfor Chinese, encoding GBK.",
+  "--conv=gbk\tfor Chinese, encoding GBK,\n",
+  "--conv=sjis\tfor Japanese, SJIS encoding.",
   "\nAlternatively, for compatibility with the previous DOS batch files,\n",
   "you can also copy this program to any of the following names:\n",
-  "bg5latex.exe,bg5pltx.exe,cef5ltx.exe,ceflatex.exe,cefsltx.exe,\n",
-  "gbklatex.exe and sjisltx.exe .\n",
+  "bg5latex.exe, cef5latex.exe, ceflatex.exe, cefslatex.exe,\n",
+  "gbklatex.exe and sjislatex.exe .\n",
   "Then running one of these programs will be identical to specify\n",
   "the corresponding option.\n",
   "\nAdditional options:\n",
@@ -62,17 +64,16 @@
 static char *progname = NULL;
 
 static struct _conv_table {
-  char *progname;
-  char *processor;
+  const char *progname;
+  const char *processor;
 } CJKtable[] = {
   { "cjklatex", "" },
   { "bg5latex", "bg5conv" },
-  { "bg5pltx", "extconv" },
-  { "cef5ltx", "cef5conv" },
   { "ceflatex", "cefconv" },
-  { "cefsltx", "cefsconv" },
+  { "cef5latex", "cef5conv" },
+  { "cefslatex", "cefsconv" },
   { "gbklatex", "extconv" },
-  { "sjisltx", "sjisconv" }
+  { "sjislatex", "sjisconv" }
 };
 
 #define PROGRAM_IS(p) FILESTRCASEEQ (p, progname)
@@ -94,7 +95,7 @@
     {0, 0, 0, 0}
 };
 
-BOOL sigint_handler(DWORD dwCtrlType)
+static BOOL sigint_handler(DWORD dwCtrlType)
 {
   /* Fix me : there is a problem if a system() command is running.
      We should wait for the son process to be interrupted.
@@ -118,7 +119,7 @@
   return FALSE;			/* return value obligatory */
 }
    
-void usage()
+static void usage(void)
 {
   int i;
   fprintf(stderr, "CJKlatex version %s\n", cjklatex_version_string);
@@ -128,7 +129,7 @@
     fputs(usage_str[i], stderr);
 }
 
-int do_process(char *processor, char *filename)
+static int do_process(const char *processor, const char *filename)
 {
   char *ext, *p;
   char cmd[_MAX_PATH*3];
@@ -176,7 +177,7 @@
   return ret;
 }
 
-void main(int argc, char *argv[])
+int main(int argc, char *argv[])
 {
   int g; /* getopt return code */
   int i;
@@ -287,4 +288,6 @@
 
   free(filename);
   free(texengine);
+
+  return 0;
 }