summaryrefslogtreecommitdiff
path: root/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-05-cjkpdflatex
blob: ccfa7871d8fb09fcce5531ff5e7446bff23e2fd0 (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
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	2010-12-19 16:17:26.000000000 +0100
+++ cjkutils-4.8.2/cjklatex/cjklatex.c	2010-12-19 16:25:43.000000000 +0100
@@ -1,11 +1,15 @@
 /*
-  Purpose: call latex after preprocessing of the .tex file by
+  Purpose: call LATEX after preprocessing of the .tex file by
            the cjk conversion tool. The old f_name.bat script
 	   is not working anymore.
   Author : F. Popineau <Fabrice.Popineau@supelec.fr>
   Date   : <29/06/2001>
 */
 
+#ifndef LATEX
+#define LATEX "latex"
+#endif
+
 /*
   Copyright (C) 2001-2008  F. Popineau <Fabrice.Popineau@supelec.fr>
   
@@ -40,7 +44,7 @@
 
 static const char *usage_str[] = {
   "Usage: %s OPTIONS FILE\n",
-  "Calls `latex' on FILE after conversion by the filter\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=cef\tfor Chinese Encoding Framework, encoding CEF,\n",
@@ -50,14 +54,14 @@
   "--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, cef5latex.exe, ceflatex.exe, cefslatex.exe,\n",
-  "gbklatex.exe and sjislatex.exe .\n",
+  "bg5" LATEX ".exe, cef5" LATEX ".exe, cef" LATEX ".exe, cefs" LATEX ".exe,\n",
+  "gbk" LATEX ".exe and sjis" LATEX ".exe .\n",
   "Then running one of these programs will be identical to specify\n",
   "the corresponding option.\n",
   "\nAdditional options:\n",
   "--verbose\tbe a bit more verbose about what is happening,\n",
   "--nocleanup\tdo not remove intermediate files,\n",
-  "--latex=engine\tuse `engine' instead of `latex' to process the file.\n",
+  "--latex=engine\tuse `engine' instead of `" LATEX "' to process the file.\n",
   NULL
 };
 
@@ -67,13 +71,13 @@
   const char *progname;
   const char *processor;
 } CJKtable[] = {
-  { "cjklatex", "" },
-  { "bg5latex", "bg5conv" },
-  { "ceflatex", "cefconv" },
-  { "cef5latex", "cef5conv" },
-  { "cefslatex", "cefsconv" },
-  { "gbklatex", "extconv" },
-  { "sjislatex", "sjisconv" }
+  { "cjk" LATEX, "" },
+  { "bg5" LATEX, "bg5conv" },
+  { "cef" LATEX, "cefconv" },
+  { "cef5" LATEX, "cef5conv" },
+  { "cefs" LATEX, "cefsconv" },
+  { "gbk" LATEX, "extconv" },
+  { "sjis" LATEX, "sjisconv" }
 };
 
 #define PROGRAM_IS(p) FILESTRCASEEQ (p, progname)
@@ -122,7 +126,7 @@
 static void usage(void)
 {
   int i;
-  fprintf(stderr, "CJKlatex version %s\n", cjklatex_version_string);
+  fprintf(stderr, "CJK" LATEX " version %s\n", cjklatex_version_string);
   fprintf(stderr,usage_str[0], progname );
   fputs("\n", stderr);
   for(i = 1; usage_str[i]; ++i)
@@ -242,7 +246,7 @@
       fprintf(stderr, "%s of %s.\n", progname, cjklatex_version_string);
       exit(0);
     }
-    else if (PROGRAM_IS("cjklatex")) {
+    else if (PROGRAM_IS("cjk" LATEX)) {
       if (ARGUMENT_IS("conv")) {
 	for (i = 1; i < sizeof(CJKtable)/sizeof(CJKtable[0]) && program_number <= 0; i++) {
 	  if (STRNEQ(optarg, CJKtable[i].progname, strlen(optarg))) {
@@ -281,7 +285,7 @@
   assert(program_number > 0);
 
   if (! texengine) {
-    texengine = xstrdup("latex");
+    texengine = xstrdup(LATEX);
   }
 
   do_process(CJKtable[program_number].processor, filename);