summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-06-12 14:17:04 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-06-12 14:17:04 +0000
commit75aa2967ffe88d15a692c589b75edc3f8fae5c25 (patch)
tree4db0b8709049c4d0ab3451b99fadc8461c4cd341
parent19794b65842cb439b28d895fad7b65d410583202 (diff)
detex 2.8 finished
git-svn-id: svn://tug.org/texlive/trunk@18912 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/detex/ChangeLog5
-rw-r--r--Build/source/texk/detex/detex-2.8-PATCHES/ChangeLog8
-rw-r--r--Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C84
-rw-r--r--Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const116
-rw-r--r--Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings110
-rw-r--r--Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea145
-rw-r--r--Build/source/texk/detex/detex-2.8/detex.l89
-rw-r--r--Build/source/texk/detex/detex.c381
8 files changed, 462 insertions, 476 deletions
diff --git a/Build/source/texk/detex/ChangeLog b/Build/source/texk/detex/ChangeLog
index 19bad30ec86..685bd71977b 100644
--- a/Build/source/texk/detex/ChangeLog
+++ b/Build/source/texk/detex/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * Import detex-2.8, patches in detex-2.8-PATCHES.
+ * Makefile.am, configure.ac: Adapted.
+
2010-02-20 Peter Breitenlohner <peb@mppmu.mpg.de>
* detex.l: #undef IGNORE after #including kpathsea headers.
diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/ChangeLog b/Build/source/texk/detex/detex-2.8-PATCHES/ChangeLog
new file mode 100644
index 00000000000..be1be4dd05d
--- /dev/null
+++ b/Build/source/texk/detex/detex-2.8-PATCHES/ChangeLog
@@ -0,0 +1,8 @@
+2010-06-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Adapt to detex-2.8.
+ * patch-01-ANSI-C (new): ANSI C function declarations and
+ definitions, no nested declarations.
+ * patch-03-warnings (new): Avoid compiler warnings.
+ * patch-04-kpathsea (new): Use kpse_find_file().
+
diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C b/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C
index 15dadd020dd..22b9b553f9c 100644
--- a/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C
+++ b/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C
@@ -1,38 +1,35 @@
diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
--- detex-2.8.orig/detex.l 2008-02-01 20:55:51.000000000 +0100
-+++ detex-2.8/detex.l 2010-06-09 13:34:01.456409201 +0200
-@@ -63,6 +63,21 @@
- #include <stdlib.h>
- #endif
++++ detex-2.8/detex.l 2010-06-11 23:12:06.648394135 +0200
+@@ -72,12 +72,26 @@
+ #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2
+ #define CITE(x) if (fLatex && !fCite) KILLARGS(x)
-+#undef IGNORE
-+
-+int BeginEnv(char *sbEnv);
-+int EndEnv(char *sbEnv);
-+void InputFile(char *sbFile);
-+void IncludeFile(char *sbFile);
+-char *SafeMalloc();
+void AddInclude(char *sbFile);
-+void SetInputPaths(void);
++void ErrorExit(char *sb1);
++void IncludeFile(char *sbFile);
++void InputFile(char *sbFile);
+void SetEnvIgnore(char *sbEnvList);
++void SetInputPaths(void);
+void Warning(char *sb1, char *sb2);
-+void ErrorExit(char *sb1);
-+int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax);
++int BeginEnv(char *sbEnv);
++int EndEnv(char *sbEnv);
+int InList(char *sbFile);
-+FILE * TexOpen(char *sbFile);
-+
- #define LaBEGIN if (fLatex) BEGIN
- #define IGNORE if (fSpace && !fWord) putchar(' ')
- #define SPACE if (!fWord) putchar(' ')
-@@ -72,7 +87,7 @@
- #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2
- #define CITE(x) if (fLatex && !fCite) KILLARGS(x)
-
--char *SafeMalloc();
-+char *SafeMalloc(int cch, char *sbMessage);
++int SeparateList(char *sbList, char *rgsbList[] ,char chSep, int csbMax);
++FILE *TexOpen(char *sbFile);
++char *SafeMalloc(int cch, char *sbMessage);
++char *getenv();
#ifndef NO_MALLOC_DECL
char *malloc();
#endif
-@@ -368,12 +383,10 @@
+ #ifdef OS2
+ void yyless(int);
++void OS2UsageExit(void);
+ #endif
+
+ char *rgsbEnvIgnore[MAXENVS]; /* list of environments ignored */
+@@ -368,12 +382,10 @@
** If no input files are specified on the command line, process stdin.
******/
@@ -47,7 +44,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
int fSawFile = 0, iArgs = 1;
/* get base name and decide what we are doing, detex or delatex */
-@@ -477,7 +490,8 @@
+@@ -477,7 +489,8 @@
** return the termination signal for lex.
******/
@@ -57,7 +54,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
(void)fclose(yyin);
#ifdef FLEX_SCANNER
-@@ -501,8 +515,8 @@
+@@ -501,8 +514,8 @@
** a yyless routine
******/
@@ -68,7 +65,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
int i = strlen(yytext);
-@@ -516,8 +530,8 @@
+@@ -516,8 +529,8 @@
** sbEnvList.
******/
@@ -79,7 +76,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
char *sb;
-@@ -533,8 +547,8 @@
+@@ -533,8 +546,8 @@
** is, sbCurrentEnv is set to sbEnv.
******/
@@ -90,7 +87,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
int i;
-@@ -551,8 +565,8 @@
+@@ -551,8 +564,8 @@
** EndEnv -- checks to see if sbEnv is the current environment being ignored.
******/
@@ -101,7 +98,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
if (!fLatex) return(0);
if (strcmp(sbEnv, sbCurrentEnv) == 0)
-@@ -565,11 +579,9 @@
+@@ -565,11 +578,9 @@
** the sbFile is ignored.
******/
@@ -115,7 +112,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
if (!fFollow)
return;
rgfp[cfp++] = yyin;
-@@ -589,11 +601,9 @@
+@@ -589,11 +600,9 @@
** and open sbFile. If the open fails, the sbFile is ignored.
******/
@@ -129,7 +126,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
if (!fFollow)
return;
if (!InList(sbFile))
-@@ -615,8 +625,8 @@
+@@ -615,8 +624,8 @@
** If the include list is too long, sbFile is ignored.
******/
@@ -140,7 +137,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
if (!fFollow)
return;
-@@ -631,8 +641,8 @@
+@@ -631,8 +640,8 @@
** no list, all files are assumed to be "in the list".
******/
@@ -151,7 +148,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
char *pch, sbBase[MAXPATHLEN];
int i;
-@@ -658,7 +668,8 @@
+@@ -658,9 +667,10 @@
** routine does not honor the '//' construct (expand subdirs).
******/
@@ -159,9 +156,12 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
+void
+SetInputPaths(void)
{
- char *sb, *sbPaths, *getenv();
+- char *sb, *sbPaths, *getenv();
++ char *sb, *sbPaths;
int cchDefaults, cchPaths;
-@@ -698,9 +709,8 @@
+
+ cchDefaults = strlen(DEFAULTINPUTS);
+@@ -698,9 +708,8 @@
** ERROR is returned if there are more than csbMax words.
******/
@@ -173,7 +173,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
int csbList = 0;
-@@ -725,8 +735,7 @@
+@@ -725,8 +734,7 @@
******/
FILE *
@@ -183,7 +183,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
char *pch, *sbNew;
FILE *fp;
-@@ -784,9 +793,7 @@
+@@ -784,9 +792,7 @@
******/
char *
@@ -194,7 +194,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
char *sb;
-@@ -799,8 +806,8 @@
+@@ -799,8 +805,8 @@
** Warning -- print a warning message preceded by the program name.
******/
@@ -205,7 +205,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
(void)fprintf(stderr, "%s: warning: %s %s\n", sbProgName, sb1, sb2);
}
-@@ -810,8 +817,8 @@
+@@ -810,8 +816,8 @@
** Stdout is flushed and detex exits.
******/
@@ -216,7 +216,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
(void)fflush(stdout);
(void)fprintf(stderr, "%s: error: %s\n", sbProgName, sb1);
-@@ -823,7 +830,8 @@
+@@ -823,7 +829,8 @@
** OS2UsageExit -- print OS/2 usage message and exit.
******/
diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const b/Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const
deleted file mode 100644
index 8c82386e8d9..00000000000
--- a/Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const
+++ /dev/null
@@ -1,116 +0,0 @@
-diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
---- detex-2.8.orig/detex.l 2010-06-09 13:34:01.000000000 +0200
-+++ detex-2.8/detex.l 2010-06-09 22:11:27.086080276 +0200
-@@ -65,15 +65,15 @@
-
- #undef IGNORE
-
--int BeginEnv(char *sbEnv);
--int EndEnv(char *sbEnv);
-+int BeginEnv(const char *sbEnv);
-+int EndEnv(const char *sbEnv);
- void InputFile(char *sbFile);
- void IncludeFile(char *sbFile);
- void AddInclude(char *sbFile);
- void SetInputPaths(void);
--void SetEnvIgnore(char *sbEnvList);
--void Warning(char *sb1, char *sb2);
--void ErrorExit(char *sb1);
-+void SetEnvIgnore(const char *sbEnvList);
-+void Warning(const char *sb1, const char *sb2);
-+void ErrorExit(const char *sb1);
- int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax);
- int InList(char *sbFile);
- FILE * TexOpen(char *sbFile);
-@@ -87,10 +87,13 @@
- #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2
- #define CITE(x) if (fLatex && !fCite) KILLARGS(x)
-
--char *SafeMalloc(int cch, char *sbMessage);
-+char *SafeMalloc(int cch, const char *sbMessage);
- #ifndef NO_MALLOC_DECL
- char *malloc();
- #endif
-+#ifndef WIN32
-+char *getenv();
-+#endif
- #ifdef OS2
- void yyless(int);
- #endif
-@@ -386,7 +389,8 @@
- int
- main(int cArgs, char *rgsbArgs[])
- {
-- char *pch, *sbEnvList = DEFAULTENV, sbBadOpt[2];
-+ char *pch, sbBadOpt[2];
-+ const char *sbEnvList = DEFAULTENV;
- int fSawFile = 0, iArgs = 1;
-
- /* get base name and decide what we are doing, detex or delatex */
-@@ -531,7 +535,7 @@
- ******/
-
- void
--SetEnvIgnore(char *sbEnvList)
-+SetEnvIgnore(const char *sbEnvList)
- {
- char *sb;
-
-@@ -548,7 +552,7 @@
- ******/
-
- int
--BeginEnv(char *sbEnv)
-+BeginEnv(const char *sbEnv)
- {
- int i;
-
-@@ -566,7 +570,7 @@
- ******/
-
- int
--EndEnv(char *sbEnv)
-+EndEnv(const char *sbEnv)
- {
- if (!fLatex) return(0);
- if (strcmp(sbEnv, sbCurrentEnv) == 0)
-@@ -671,7 +675,11 @@
- void
- SetInputPaths(void)
- {
-- char *sb, *sbPaths, *getenv();
-+ const char *sb;
-+ char *sbPaths;
-+#ifndef WIN32
-+ char *getenv();
-+#endif
- int cchDefaults, cchPaths;
-
- cchDefaults = strlen(DEFAULTINPUTS);
-@@ -793,7 +801,7 @@
- ******/
-
- char *
--SafeMalloc(int cch, char *sbMessage)
-+SafeMalloc(int cch, const char *sbMessage)
- {
- char *sb;
-
-@@ -807,7 +815,7 @@
- ******/
-
- void
--Warning(char *sb1, char *sb2)
-+Warning(const char *sb1, const char *sb2)
- {
- (void)fprintf(stderr, "%s: warning: %s %s\n", sbProgName, sb1, sb2);
- }
-@@ -818,7 +826,7 @@
- ******/
-
- void
--ErrorExit(char *sb1)
-+ErrorExit(const char *sb1)
- {
- (void)fflush(stdout);
- (void)fprintf(stderr, "%s: error: %s\n", sbProgName, sb1);
diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings b/Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings
index 8199c855f6f..d3a9f93eab5 100644
--- a/Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings
+++ b/Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings
@@ -1,8 +1,79 @@
-Only in detex-2.8: detex.c
diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
---- detex-2.8.orig/detex.l 2010-06-09 22:11:27.000000000 +0200
-+++ detex-2.8/detex.l 2010-06-09 23:21:25.969948651 +0200
-@@ -724,7 +724,7 @@
+--- detex-2.8.orig/detex.l 2010-06-11 23:12:06.000000000 +0200
++++ detex-2.8/detex.l 2010-06-11 23:26:08.554783186 +0200
+@@ -73,18 +73,18 @@
+ #define CITE(x) if (fLatex && !fCite) KILLARGS(x)
+
+ void AddInclude(char *sbFile);
+-void ErrorExit(char *sb1);
++void ErrorExit(const char *sb1);
+ void IncludeFile(char *sbFile);
+ void InputFile(char *sbFile);
+-void SetEnvIgnore(char *sbEnvList);
++void SetEnvIgnore(const char *sbEnvList);
+ void SetInputPaths(void);
+-void Warning(char *sb1, char *sb2);
+-int BeginEnv(char *sbEnv);
+-int EndEnv(char *sbEnv);
++void Warning(const char *sb1, const char *sb2);
++int BeginEnv(const char *sbEnv);
++int EndEnv(const char *sbEnv);
+ int InList(char *sbFile);
+ int SeparateList(char *sbList, char *rgsbList[] ,char chSep, int csbMax);
+ FILE *TexOpen(char *sbFile);
+-char *SafeMalloc(int cch, char *sbMessage);
++char *SafeMalloc(int cch, const char *sbMessage);
+ char *getenv();
+ #ifndef NO_MALLOC_DECL
+ char *malloc();
+@@ -385,7 +385,8 @@
+ int
+ main(int cArgs, char *rgsbArgs[])
+ {
+- char *pch, *sbEnvList = DEFAULTENV, sbBadOpt[2];
++ char *pch, sbBadOpt[2];
++ const char *sbEnvList = DEFAULTENV;
+ int fSawFile = 0, iArgs = 1;
+
+ /* get base name and decide what we are doing, detex or delatex */
+@@ -530,7 +531,7 @@
+ ******/
+
+ void
+-SetEnvIgnore(char *sbEnvList)
++SetEnvIgnore(const char *sbEnvList)
+ {
+ char *sb;
+
+@@ -547,7 +548,7 @@
+ ******/
+
+ int
+-BeginEnv(char *sbEnv)
++BeginEnv(const char *sbEnv)
+ {
+ int i;
+
+@@ -565,7 +566,7 @@
+ ******/
+
+ int
+-EndEnv(char *sbEnv)
++EndEnv(const char *sbEnv)
+ {
+ if (!fLatex) return(0);
+ if (strcmp(sbEnv, sbCurrentEnv) == 0)
+@@ -670,7 +671,8 @@
+ void
+ SetInputPaths(void)
+ {
+- char *sb, *sbPaths;
++ const char *sb;
++ char *sbPaths;
+ int cchDefaults, cchPaths;
+
+ cchDefaults = strlen(DEFAULTINPUTS);
+@@ -715,7 +717,7 @@
while (sbList && *sbList && csbList < csbMax) {
rgsbList[csbList++] = sbList;
@@ -11,7 +82,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
*sbList++ = '\0';
}
return(sbList && *sbList ? ERROR : csbList);
-@@ -769,10 +769,12 @@
+@@ -760,10 +762,12 @@
/* If sbFile ends in .tex then it must be there */
if ((pch = rindex(sbFullPath, '.')) != NULL
&& (strcmp(pch, ".tex") == 0))
@@ -24,5 +95,30 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
/* if .<ext> then try to open it. the '.' represents */
/* the beginning of an extension if it is not the first */
-Only in detex-2.8: test.lout
-Only in detex-2.8: test.tout
+@@ -792,7 +796,7 @@
+ ******/
+
+ char *
+-SafeMalloc(int cch, char *sbMessage)
++SafeMalloc(int cch, const char *sbMessage)
+ {
+ char *sb;
+
+@@ -806,7 +810,7 @@
+ ******/
+
+ void
+-Warning(char *sb1, char *sb2)
++Warning(const char *sb1, const char *sb2)
+ {
+ (void)fprintf(stderr, "%s: warning: %s %s\n", sbProgName, sb1, sb2);
+ }
+@@ -817,7 +821,7 @@
+ ******/
+
+ void
+-ErrorExit(char *sb1)
++ErrorExit(const char *sb1)
+ {
+ (void)fflush(stdout);
+ (void)fprintf(stderr, "%s: error: %s\n", sbProgName, sb1);
diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea b/Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea
index 149c479c535..f30d6f81d12 100644
--- a/Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea
+++ b/Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea
@@ -1,16 +1,31 @@
diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
---- detex-2.8.orig/detex.l 2010-06-09 23:21:25.000000000 +0200
-+++ detex-2.8/detex.l 2010-06-10 01:09:20.413856795 +0200
-@@ -49,6 +49,8 @@
+--- detex-2.8.orig/detex.l 2010-06-11 23:26:08.000000000 +0200
++++ detex-2.8/detex.l 2010-06-12 00:15:05.785339097 +0200
+@@ -49,6 +49,23 @@
*/
#include "detex.h"
-+#ifndef KPATHSEA
++
++#ifdef KPATHSEA
++
++#include <c-auto.h>
++#include <kpathsea/c-auto.h>
++#include <kpathsea/config.h>
++#include <kpathsea/c-memstr.h>
++#include <kpathsea/c-pathmx.h>
++#include <kpathsea/c-std.h>
++#include <kpathsea/tex-file.h>
++
++#ifdef HAVE_SYS_PARAM_H
++#include <sys/param.h>
++#endif
++
++#else /* KPATHSEA */
+
#ifdef HAVE_STRING_H
#include <string.h>
#define index strchr
-@@ -59,24 +61,52 @@
+@@ -59,10 +76,15 @@
#ifndef MAXPATHLEN
#include <sys/param.h>
#endif
@@ -18,77 +33,37 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
#ifdef OS2
#include <stdlib.h>
#endif
-+#ifndef NO_MALLOC_DECL
-+char *malloc();
-+#endif
-+#ifndef WIN32
-+char *getenv();
-+#endif
-+
-+#else
+
++#endif /* KPATHSEA */
+
-+#include "c-auto.h"
-+#include "kpathsea/c-auto.h"
-+#include "kpathsea/config.h"
-+#include "kpathsea/c-memstr.h"
-+#include "kpathsea/c-pathmx.h"
-+#include "kpathsea/c-std.h"
-+#include "kpathsea/tex-file.h"
++#undef IGNORE
+
-+#ifdef HAVE_SYS_PARAM_H
-+#include <sys/param.h>
-+#endif
-+
-+#endif
-
- #undef IGNORE
-
--int BeginEnv(const char *sbEnv);
--int EndEnv(const char *sbEnv);
--void InputFile(char *sbFile);
--void IncludeFile(char *sbFile);
--void AddInclude(char *sbFile);
--void SetInputPaths(void);
--void SetEnvIgnore(const char *sbEnvList);
--void Warning(const char *sb1, const char *sb2);
--void ErrorExit(const char *sb1);
--int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax);
--int InList(char *sbFile);
--FILE * TexOpen(char *sbFile);
-+int BeginEnv(const char *sbEnv);
-+int EndEnv(const char *sbEnv);
-+void InputFile(char *sbFile);
-+void IncludeFile(char *sbFile);
-+void AddInclude(char *sbFile);
-+void SetInputPaths(void);
-+void SetEnvIgnore(const char *sbEnvList);
-+void Warning(const char *sb1, const char *sb2);
-+void ErrorExit(const char *sb1);
-+int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax);
-+int InList(char *sbFile);
-+FILE *TexOpen(char *sbFile);
-+char *SafeMalloc(int cch, const char *sbMessage);
-+#ifdef OS2
-+void yyless(int);
-+void OS2UsageExit(void);
-+#endif
-
#define LaBEGIN if (fLatex) BEGIN
#define IGNORE if (fSpace && !fWord) putchar(' ')
-@@ -87,22 +117,15 @@
- #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2
- #define CITE(x) if (fLatex && !fCite) KILLARGS(x)
-
--char *SafeMalloc(int cch, const char *sbMessage);
--#ifndef NO_MALLOC_DECL
--char *malloc();
--#endif
--#ifndef WIN32
--char *getenv();
--#endif
--#ifdef OS2
--void yyless(int);
--#endif
+ #define SPACE if (!fWord) putchar(' ')
+@@ -77,7 +99,9 @@
+ void IncludeFile(char *sbFile);
+ void InputFile(char *sbFile);
+ void SetEnvIgnore(const char *sbEnvList);
++#ifndef KPATHSEA
+ void SetInputPaths(void);
++#endif
+ void Warning(const char *sb1, const char *sb2);
+ int BeginEnv(const char *sbEnv);
+ int EndEnv(const char *sbEnv);
+@@ -85,6 +109,7 @@
+ int SeparateList(char *sbList, char *rgsbList[] ,char chSep, int csbMax);
+ FILE *TexOpen(char *sbFile);
+ char *SafeMalloc(int cch, const char *sbMessage);
++#ifndef KPATHSEA
+ char *getenv();
+ #ifndef NO_MALLOC_DECL
+ char *malloc();
+@@ -93,12 +118,16 @@
+ void yyless(int);
+ void OS2UsageExit(void);
+ #endif
++#endif /* KPATHSEA */
char *rgsbEnvIgnore[MAXENVS]; /* list of environments ignored */
char *rgsbIncList[MAXINCLIST]; /* list of includeonly files */
@@ -101,7 +76,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
FILE *rgfp[NOFILE+1]; /* stack of input/include files */
int cfp = 0; /* count of files in stack */
int cOpenBrace = 0; /* count of `{' in <LaMacro> and <LaMacro2> */
-@@ -404,6 +427,9 @@
+@@ -400,6 +429,9 @@
_splitpath (rgsbArgs[0], drive, dir, fname, ext);
sbProgName = strlwr(fname);
#else
@@ -111,7 +86,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
if ((sbProgName = rindex(rgsbArgs[0], '/')) != NULL)
sbProgName++;
else
-@@ -411,9 +437,11 @@
+@@ -407,9 +439,11 @@
#endif
if (strcmp("delatex",sbProgName) == 0)
fLatex = 1;
@@ -124,7 +99,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
/* process command line options */
while (iArgs < cArgs && *(pch = rgsbArgs[iArgs]) == CHOPT) {
-@@ -648,7 +676,7 @@
+@@ -644,7 +678,7 @@
int
InList(char *sbFile)
{
@@ -133,7 +108,23 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
int i;
if (csbIncList == 0) /* no list */
-@@ -745,10 +773,12 @@
+@@ -659,6 +693,7 @@
+ return(0);
+ }
+
++#ifndef KPATHSEA
+ /******
+ ** SetInputPaths -- sets rgsbInputPaths to the values indicated by the
+ ** TEXINPUTS environment variable if set or else DEFAULTINPUTS. If
+@@ -702,6 +737,7 @@
+ ErrorExit("TEXINPUTS environment variable has too many paths");
+ #endif
+ }
++#endif
+
+ /******
+ ** SeparateList -- takes a chSep separated list sbList, replaces the
+@@ -738,10 +774,12 @@
FILE *
TexOpen(char *sbFile)
{
@@ -148,7 +139,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
for (iPath = 0; iPath < csbInputPaths; iPath++) {
#ifdef OS2
-@@ -795,7 +825,15 @@
+@@ -788,7 +826,15 @@
if ((fp = fopen(sbFullPath, "r")) != NULL)
return(fp);
}
diff --git a/Build/source/texk/detex/detex-2.8/detex.l b/Build/source/texk/detex/detex-2.8/detex.l
index 862460df3af..db6ec8ba982 100644
--- a/Build/source/texk/detex/detex-2.8/detex.l
+++ b/Build/source/texk/detex/detex-2.8/detex.l
@@ -49,7 +49,22 @@ static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/0
*/
#include "detex.h"
-#ifndef KPATHSEA
+
+#ifdef KPATHSEA
+
+#include <c-auto.h>
+#include <kpathsea/c-auto.h>
+#include <kpathsea/config.h>
+#include <kpathsea/c-memstr.h>
+#include <kpathsea/c-pathmx.h>
+#include <kpathsea/c-std.h>
+#include <kpathsea/tex-file.h>
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#else /* KPATHSEA */
#ifdef HAVE_STRING_H
#include <string.h>
@@ -65,49 +80,11 @@ static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/0
#ifdef OS2
#include <stdlib.h>
#endif
-#ifndef NO_MALLOC_DECL
-char *malloc();
-#endif
-#ifndef WIN32
-char *getenv();
-#endif
-
-#else
-#include "c-auto.h"
-#include "kpathsea/c-auto.h"
-#include "kpathsea/config.h"
-#include "kpathsea/c-memstr.h"
-#include "kpathsea/c-pathmx.h"
-#include "kpathsea/c-std.h"
-#include "kpathsea/tex-file.h"
-
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-
-#endif
+#endif /* KPATHSEA */
#undef IGNORE
-int BeginEnv(const char *sbEnv);
-int EndEnv(const char *sbEnv);
-void InputFile(char *sbFile);
-void IncludeFile(char *sbFile);
-void AddInclude(char *sbFile);
-void SetInputPaths(void);
-void SetEnvIgnore(const char *sbEnvList);
-void Warning(const char *sb1, const char *sb2);
-void ErrorExit(const char *sb1);
-int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax);
-int InList(char *sbFile);
-FILE *TexOpen(char *sbFile);
-char *SafeMalloc(int cch, const char *sbMessage);
-#ifdef OS2
-void yyless(int);
-void OS2UsageExit(void);
-#endif
-
#define LaBEGIN if (fLatex) BEGIN
#define IGNORE if (fSpace && !fWord) putchar(' ')
#define SPACE if (!fWord) putchar(' ')
@@ -117,6 +94,31 @@ void OS2UsageExit(void);
#define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2
#define CITE(x) if (fLatex && !fCite) KILLARGS(x)
+void AddInclude(char *sbFile);
+void ErrorExit(const char *sb1);
+void IncludeFile(char *sbFile);
+void InputFile(char *sbFile);
+void SetEnvIgnore(const char *sbEnvList);
+#ifndef KPATHSEA
+void SetInputPaths(void);
+#endif
+void Warning(const char *sb1, const char *sb2);
+int BeginEnv(const char *sbEnv);
+int EndEnv(const char *sbEnv);
+int InList(char *sbFile);
+int SeparateList(char *sbList, char *rgsbList[] ,char chSep, int csbMax);
+FILE *TexOpen(char *sbFile);
+char *SafeMalloc(int cch, const char *sbMessage);
+#ifndef KPATHSEA
+char *getenv();
+#ifndef NO_MALLOC_DECL
+char *malloc();
+#endif
+#ifdef OS2
+void yyless(int);
+void OS2UsageExit(void);
+#endif
+#endif /* KPATHSEA */
char *rgsbEnvIgnore[MAXENVS]; /* list of environments ignored */
char *rgsbIncList[MAXINCLIST]; /* list of includeonly files */
@@ -413,7 +415,7 @@ int
main(int cArgs, char *rgsbArgs[])
{
char *pch, sbBadOpt[2];
- const char *sbEnvList = DEFAULTENV;
+ const char *sbEnvList = DEFAULTENV;
int fSawFile = 0, iArgs = 1;
/* get base name and decide what we are doing, detex or delatex */
@@ -691,6 +693,7 @@ InList(char *sbFile)
return(0);
}
+#ifndef KPATHSEA
/******
** SetInputPaths -- sets rgsbInputPaths to the values indicated by the
** TEXINPUTS environment variable if set or else DEFAULTINPUTS. If
@@ -705,9 +708,6 @@ SetInputPaths(void)
{
const char *sb;
char *sbPaths;
-#ifndef WIN32
- char *getenv();
-#endif
int cchDefaults, cchPaths;
cchDefaults = strlen(DEFAULTINPUTS);
@@ -737,6 +737,7 @@ SetInputPaths(void)
ErrorExit("TEXINPUTS environment variable has too many paths");
#endif
}
+#endif
/******
** SeparateList -- takes a chSep separated list sbList, replaces the
diff --git a/Build/source/texk/detex/detex.c b/Build/source/texk/detex/detex.c
index f9344446a4c..da80b732d09 100644
--- a/Build/source/texk/detex/detex.c
+++ b/Build/source/texk/detex/detex.c
@@ -1108,7 +1108,22 @@ static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/0
*/
#include "detex.h"
-#ifndef KPATHSEA
+
+#ifdef KPATHSEA
+
+#include <c-auto.h>
+#include <kpathsea/c-auto.h>
+#include <kpathsea/config.h>
+#include <kpathsea/c-memstr.h>
+#include <kpathsea/c-pathmx.h>
+#include <kpathsea/c-std.h>
+#include <kpathsea/tex-file.h>
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#else /* KPATHSEA */
#ifdef HAVE_STRING_H
#include <string.h>
@@ -1124,49 +1139,11 @@ static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/0
#ifdef OS2
#include <stdlib.h>
#endif
-#ifndef NO_MALLOC_DECL
-char *malloc();
-#endif
-#ifndef WIN32
-char *getenv();
-#endif
-
-#else
-
-#include "c-auto.h"
-#include "kpathsea/c-auto.h"
-#include "kpathsea/config.h"
-#include "kpathsea/c-memstr.h"
-#include "kpathsea/c-pathmx.h"
-#include "kpathsea/c-std.h"
-#include "kpathsea/tex-file.h"
-
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#endif
+#endif /* KPATHSEA */
#undef IGNORE
-int BeginEnv(const char *sbEnv);
-int EndEnv(const char *sbEnv);
-void InputFile(char *sbFile);
-void IncludeFile(char *sbFile);
-void AddInclude(char *sbFile);
-void SetInputPaths(void);
-void SetEnvIgnore(const char *sbEnvList);
-void Warning(const char *sb1, const char *sb2);
-void ErrorExit(const char *sb1);
-int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax);
-int InList(char *sbFile);
-FILE *TexOpen(char *sbFile);
-char *SafeMalloc(int cch, const char *sbMessage);
-#ifdef OS2
-void yyless(int);
-void OS2UsageExit(void);
-#endif
-
#define LaBEGIN if (fLatex) BEGIN
#define IGNORE if (fSpace && !fWord) putchar(' ')
#define SPACE if (!fWord) putchar(' ')
@@ -1176,6 +1153,31 @@ void OS2UsageExit(void);
#define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2
#define CITE(x) if (fLatex && !fCite) KILLARGS(x)
+void AddInclude(char *sbFile);
+void ErrorExit(const char *sb1);
+void IncludeFile(char *sbFile);
+void InputFile(char *sbFile);
+void SetEnvIgnore(const char *sbEnvList);
+#ifndef KPATHSEA
+void SetInputPaths(void);
+#endif
+void Warning(const char *sb1, const char *sb2);
+int BeginEnv(const char *sbEnv);
+int EndEnv(const char *sbEnv);
+int InList(char *sbFile);
+int SeparateList(char *sbList, char *rgsbList[] ,char chSep, int csbMax);
+FILE *TexOpen(char *sbFile);
+char *SafeMalloc(int cch, const char *sbMessage);
+#ifndef KPATHSEA
+char *getenv();
+#ifndef NO_MALLOC_DECL
+char *malloc();
+#endif
+#ifdef OS2
+void yyless(int);
+void OS2UsageExit(void);
+#endif
+#endif /* KPATHSEA */
char *rgsbEnvIgnore[MAXENVS]; /* list of environments ignored */
char *rgsbIncList[MAXINCLIST]; /* list of includeonly files */
@@ -1212,7 +1214,7 @@ int csb = 0; /* depth of flex context stack */
-#line 1216 "detex.c"
+#line 1218 "detex.c"
#define INITIAL 0
#define Define 1
@@ -1414,9 +1416,9 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 166 "detex.l"
+#line 168 "detex.l"
-#line 1420 "detex.c"
+#line 1422 "detex.c"
if ( !(yy_init) )
{
@@ -1501,24 +1503,24 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 167 "detex.l"
+#line 169 "detex.l"
/* ignore comments */ ;
YY_BREAK
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
-#line 169 "detex.l"
+#line 171 "detex.l"
{LATEX; IGNORE;}
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 171 "detex.l"
+#line 173 "detex.l"
/* environment start */ {LaBEGIN LaBegin; IGNORE;}
YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
-#line 173 "detex.l"
+#line 175 "detex.l"
{ if (BeginEnv("verbatim"))
BEGIN LaEnv;
else
@@ -1529,24 +1531,24 @@ YY_RULE_SETUP
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
-#line 180 "detex.l"
+#line 182 "detex.l"
/* verbatim mode */ {BEGIN Normal; IGNORE;}
YY_BREAK
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
-#line 181 "detex.l"
+#line 183 "detex.l"
ECHO;
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 182 "detex.l"
+#line 184 "detex.l"
ECHO;
YY_BREAK
case 8:
/* rule 8 can match eol */
YY_RULE_SETUP
-#line 184 "detex.l"
+#line 186 "detex.l"
{ KILLARGS(1);
if (BeginEnv("minpage"))
BEGIN LaEnv;
@@ -1557,7 +1559,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 192 "detex.l"
+#line 194 "detex.l"
{ if (BeginEnv(yytext))
BEGIN LaEnv;
else
@@ -1568,33 +1570,33 @@ YY_RULE_SETUP
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
-#line 198 "detex.l"
+#line 200 "detex.l"
NEWLINE;
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 199 "detex.l"
+#line 201 "detex.l"
;
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 201 "detex.l"
+#line 203 "detex.l"
/* absorb some environments */ {LaBEGIN LaEnd; IGNORE;}
YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
-#line 202 "detex.l"
+#line 204 "detex.l"
NEWLINE;
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 203 "detex.l"
+#line 205 "detex.l"
;
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 205 "detex.l"
+#line 207 "detex.l"
/* end environment */ { if (EndEnv(yytext))
BEGIN Normal;
IGNORE;
@@ -1602,295 +1604,295 @@ YY_RULE_SETUP
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 209 "detex.l"
+#line 211 "detex.l"
{BEGIN LaEnv; IGNORE;}
YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
-#line 210 "detex.l"
+#line 212 "detex.l"
NEWLINE;
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 211 "detex.l"
+#line 213 "detex.l"
;
YY_BREAK
case 19:
/* rule 19 can match eol */
YY_RULE_SETUP
-#line 213 "detex.l"
+#line 215 "detex.l"
;
YY_BREAK
case 20:
/* rule 20 can match eol */
YY_RULE_SETUP
-#line 214 "detex.l"
+#line 216 "detex.l"
;
YY_BREAK
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
-#line 215 "detex.l"
+#line 217 "detex.l"
;
YY_BREAK
case 22:
/* rule 22 can match eol */
YY_RULE_SETUP
-#line 216 "detex.l"
+#line 218 "detex.l"
;
YY_BREAK
case 23:
/* rule 23 can match eol */
YY_RULE_SETUP
-#line 217 "detex.l"
+#line 219 "detex.l"
;
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 219 "detex.l"
+#line 221 "detex.l"
{ KILLARGS(1); }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 220 "detex.l"
+#line 222 "detex.l"
{ KILLARGS(2); }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 221 "detex.l"
+#line 223 "detex.l"
{ KILLARGS(2); }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 222 "detex.l"
+#line 224 "detex.l"
{ KILLARGS(2); }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 223 "detex.l"
+#line 225 "detex.l"
{ KILLARGS(2); }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 224 "detex.l"
+#line 226 "detex.l"
{ KILLARGS(2); }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 225 "detex.l"
+#line 227 "detex.l"
{ KILLARGS(1); }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 226 "detex.l"
+#line 228 "detex.l"
{ KILLARGS(1); }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 227 "detex.l"
+#line 229 "detex.l"
{ KILLARGS(2); }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 228 "detex.l"
+#line 230 "detex.l"
{ KILLARGS(1); }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 229 "detex.l"
+#line 231 "detex.l"
{ STRIPARGS(2); }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 230 "detex.l"
+#line 232 "detex.l"
{ KILLARGS(1); }
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 231 "detex.l"
+#line 233 "detex.l"
{ STRIPARGS(2); }
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 232 "detex.l"
+#line 234 "detex.l"
{ KILLARGS(2); }
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 233 "detex.l"
+#line 235 "detex.l"
;
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 234 "detex.l"
+#line 236 "detex.l"
{ KILLARGS(1); }
YY_BREAK
case 40:
/* rule 40 can match eol */
YY_RULE_SETUP
-#line 235 "detex.l"
+#line 237 "detex.l"
{ LaBEGIN LaPicture; }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 237 "detex.l"
+#line 239 "detex.l"
;
YY_BREAK
case 42:
/* rule 42 can match eol */
YY_RULE_SETUP
-#line 238 "detex.l"
+#line 240 "detex.l"
{ printf("<Picture %s>", yytext); }
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 239 "detex.l"
+#line 241 "detex.l"
BEGIN Normal;
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 241 "detex.l"
+#line 243 "detex.l"
{ KILLARGS(3); }
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 242 "detex.l"
+#line 244 "detex.l"
{ KILLARGS(1); }
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 243 "detex.l"
+#line 245 "detex.l"
{ KILLARGS(2); }
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 244 "detex.l"
+#line 246 "detex.l"
{ KILLARGS(2); }
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 245 "detex.l"
+#line 247 "detex.l"
{ KILLARGS(3); }
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 246 "detex.l"
+#line 248 "detex.l"
{ KILLARGS(1); }
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 247 "detex.l"
+#line 249 "detex.l"
{ STRIPARGS(1); }
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 249 "detex.l"
+#line 251 "detex.l"
;
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 250 "detex.l"
+#line 252 "detex.l"
;
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 251 "detex.l"
+#line 253 "detex.l"
;
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 252 "detex.l"
+#line 254 "detex.l"
;
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 253 "detex.l"
+#line 255 "detex.l"
;
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 254 "detex.l"
+#line 256 "detex.l"
;
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 256 "detex.l"
+#line 258 "detex.l"
/* ignore args */ {KILLARGS(1); IGNORE;}
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 257 "detex.l"
+#line 259 "detex.l"
/* of these \cs */ {KILLARGS(1); IGNORE;}
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 258 "detex.l"
+#line 260 "detex.l"
{KILLARGS(1); IGNORE;}
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 259 "detex.l"
+#line 261 "detex.l"
{CITE(1); IGNORE;}
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 260 "detex.l"
+#line 262 "detex.l"
{LATEX; KILLARGS(1); IGNORE;}
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 261 "detex.l"
+#line 263 "detex.l"
{LATEX; KILLARGS(1); IGNORE;}
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 262 "detex.l"
+#line 264 "detex.l"
{KILLARGS(1); IGNORE;}
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 263 "detex.l"
+#line 265 "detex.l"
{KILLARGS(1); IGNORE;}
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 264 "detex.l"
+#line 266 "detex.l"
{KILLARGS(1); SPACE;}
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 265 "detex.l"
+#line 267 "detex.l"
{KILLARGS(1); SPACE;}
YY_BREAK
case 67:
YY_RULE_SETUP
-#line 266 "detex.l"
+#line 268 "detex.l"
{KILLARGS(1); IGNORE;}
YY_BREAK
case 68:
YY_RULE_SETUP
-#line 267 "detex.l"
+#line 269 "detex.l"
{CITE(1); IGNORE;}
YY_BREAK
case 69:
YY_RULE_SETUP
-#line 268 "detex.l"
+#line 270 "detex.l"
{KILLARGS(1); IGNORE;}
YY_BREAK
case 70:
YY_RULE_SETUP
-#line 269 "detex.l"
+#line 271 "detex.l"
{CITE(1); IGNORE;}
YY_BREAK
case 71:
YY_RULE_SETUP
-#line 270 "detex.l"
+#line 272 "detex.l"
{KILLARGS(1); IGNORE;}
YY_BREAK
case 72:
YY_RULE_SETUP
-#line 271 "detex.l"
+#line 273 "detex.l"
/* ignore \verb<ch>...<ch> */ { if (fLatex) {
char verbchar, c;
verbchar = input();
@@ -1903,137 +1905,137 @@ YY_RULE_SETUP
YY_BREAK
case 73:
YY_RULE_SETUP
-#line 281 "detex.l"
+#line 283 "detex.l"
{ LATEX; KILLARGS(2); }
YY_BREAK
case 74:
YY_RULE_SETUP
-#line 282 "detex.l"
+#line 284 "detex.l"
{ LATEX; KILLARGS(2); }
YY_BREAK
case 75:
YY_RULE_SETUP
-#line 283 "detex.l"
+#line 285 "detex.l"
{ LATEX; KILLARGS(3); }
YY_BREAK
case 76:
YY_RULE_SETUP
-#line 285 "detex.l"
+#line 287 "detex.l"
/* ignore def begin */ {BEGIN Define; IGNORE;}
YY_BREAK
case 77:
YY_RULE_SETUP
-#line 286 "detex.l"
+#line 288 "detex.l"
BEGIN Normal;
YY_BREAK
case 78:
/* rule 78 can match eol */
YY_RULE_SETUP
-#line 287 "detex.l"
+#line 289 "detex.l"
NEWLINE;
YY_BREAK
case 79:
YY_RULE_SETUP
-#line 288 "detex.l"
+#line 290 "detex.l"
;
YY_BREAK
case 80:
YY_RULE_SETUP
-#line 290 "detex.l"
+#line 292 "detex.l"
/* formula mode */ {LaBEGIN LaFormula; IGNORE;}
YY_BREAK
case 81:
YY_RULE_SETUP
-#line 291 "detex.l"
+#line 293 "detex.l"
BEGIN Normal;
YY_BREAK
case 82:
/* rule 82 can match eol */
YY_RULE_SETUP
-#line 292 "detex.l"
+#line 294 "detex.l"
NEWLINE;
YY_BREAK
case 83:
YY_RULE_SETUP
-#line 293 "detex.l"
+#line 295 "detex.l"
;
YY_BREAK
case 84:
YY_RULE_SETUP
-#line 295 "detex.l"
+#line 297 "detex.l"
/* display mode */ {LaBEGIN LaDisplay; IGNORE;}
YY_BREAK
case 85:
YY_RULE_SETUP
-#line 296 "detex.l"
+#line 298 "detex.l"
BEGIN Normal;
YY_BREAK
case 86:
/* rule 86 can match eol */
YY_RULE_SETUP
-#line 297 "detex.l"
+#line 299 "detex.l"
NEWLINE;
YY_BREAK
case 87:
YY_RULE_SETUP
-#line 298 "detex.l"
+#line 300 "detex.l"
;
YY_BREAK
case 88:
YY_RULE_SETUP
-#line 300 "detex.l"
+#line 302 "detex.l"
/* display mode */ {BEGIN Display; IGNORE;}
YY_BREAK
case 89:
YY_RULE_SETUP
-#line 301 "detex.l"
+#line 303 "detex.l"
BEGIN Normal;
YY_BREAK
case 90:
/* rule 90 can match eol */
YY_RULE_SETUP
-#line 302 "detex.l"
+#line 304 "detex.l"
NEWLINE;
YY_BREAK
case 91:
YY_RULE_SETUP
-#line 303 "detex.l"
+#line 305 "detex.l"
;
YY_BREAK
case 92:
YY_RULE_SETUP
-#line 305 "detex.l"
+#line 307 "detex.l"
/* math mode */ {BEGIN Math; IGNORE;}
YY_BREAK
case 93:
YY_RULE_SETUP
-#line 306 "detex.l"
+#line 308 "detex.l"
BEGIN Normal;
YY_BREAK
case 94:
/* rule 94 can match eol */
YY_RULE_SETUP
-#line 307 "detex.l"
+#line 309 "detex.l"
NEWLINE;
YY_BREAK
case 95:
YY_RULE_SETUP
-#line 308 "detex.l"
+#line 310 "detex.l"
;
YY_BREAK
case 96:
YY_RULE_SETUP
-#line 309 "detex.l"
+#line 311 "detex.l"
;
YY_BREAK
case 97:
YY_RULE_SETUP
-#line 311 "detex.l"
+#line 313 "detex.l"
/* process files */ {LaBEGIN LaInclude; IGNORE;}
YY_BREAK
case 98:
YY_RULE_SETUP
-#line 312 "detex.l"
+#line 314 "detex.l"
{ IncludeFile(yytext);
BEGIN Normal;
}
@@ -2041,27 +2043,27 @@ YY_RULE_SETUP
case 99:
/* rule 99 can match eol */
YY_RULE_SETUP
-#line 315 "detex.l"
+#line 317 "detex.l"
NEWLINE;
YY_BREAK
case 100:
YY_RULE_SETUP
-#line 316 "detex.l"
+#line 318 "detex.l"
;
YY_BREAK
case 101:
YY_RULE_SETUP
-#line 318 "detex.l"
+#line 320 "detex.l"
{BEGIN IncludeOnly; IGNORE;}
YY_BREAK
case 102:
YY_RULE_SETUP
-#line 319 "detex.l"
+#line 321 "detex.l"
AddInclude(yytext);
YY_BREAK
case 103:
YY_RULE_SETUP
-#line 320 "detex.l"
+#line 322 "detex.l"
{ if (csbIncList == 0)
rgsbIncList[csbIncList++] = '\0';
BEGIN Normal;
@@ -2070,22 +2072,22 @@ YY_RULE_SETUP
case 104:
/* rule 104 can match eol */
YY_RULE_SETUP
-#line 324 "detex.l"
+#line 326 "detex.l"
NEWLINE;
YY_BREAK
case 105:
YY_RULE_SETUP
-#line 325 "detex.l"
+#line 327 "detex.l"
;
YY_BREAK
case 106:
YY_RULE_SETUP
-#line 327 "detex.l"
+#line 329 "detex.l"
{BEGIN Input; IGNORE;}
YY_BREAK
case 107:
YY_RULE_SETUP
-#line 328 "detex.l"
+#line 330 "detex.l"
{ InputFile(yytext);
BEGIN Normal;
}
@@ -2093,55 +2095,55 @@ YY_RULE_SETUP
case 108:
/* rule 108 can match eol */
YY_RULE_SETUP
-#line 331 "detex.l"
+#line 333 "detex.l"
NEWLINE;
YY_BREAK
case 109:
YY_RULE_SETUP
-#line 332 "detex.l"
+#line 334 "detex.l"
;
YY_BREAK
case 110:
/* rule 110 can match eol */
YY_RULE_SETUP
-#line 334 "detex.l"
+#line 336 "detex.l"
/* handle ligatures */ {(void)printf("%.2s", yytext+1);}
YY_BREAK
case 111:
/* rule 111 can match eol */
YY_RULE_SETUP
-#line 335 "detex.l"
+#line 337 "detex.l"
{(void)printf("%.1s", yytext+1);}
YY_BREAK
case 112:
YY_RULE_SETUP
-#line 336 "detex.l"
+#line 338 "detex.l"
BEGIN LaBreak;
YY_BREAK
case 113:
YY_RULE_SETUP
-#line 338 "detex.l"
+#line 340 "detex.l"
/* ignore other \cs */ {BEGIN Control; IGNORE;}
YY_BREAK
case 114:
YY_RULE_SETUP
-#line 339 "detex.l"
+#line 341 "detex.l"
SPACE;
YY_BREAK
case 115:
/* rule 115 can match eol */
YY_RULE_SETUP
-#line 340 "detex.l"
+#line 342 "detex.l"
NEWLINE;
YY_BREAK
case 116:
YY_RULE_SETUP
-#line 341 "detex.l"
+#line 343 "detex.l"
IGNORE;
YY_BREAK
case 117:
YY_RULE_SETUP
-#line 342 "detex.l"
+#line 344 "detex.l"
{ if (yytext==NULL || strlen(yytext)==0
|| atoi(yytext)==4)
NEWLINE;
@@ -2150,48 +2152,48 @@ YY_RULE_SETUP
YY_BREAK
case 118:
YY_RULE_SETUP
-#line 348 "detex.l"
+#line 350 "detex.l"
IGNORE;
YY_BREAK
case 119:
YY_RULE_SETUP
-#line 349 "detex.l"
+#line 351 "detex.l"
IGNORE;
YY_BREAK
case 120:
/* rule 120 can match eol */
YY_RULE_SETUP
-#line 350 "detex.l"
+#line 352 "detex.l"
{BEGIN Normal; NEWLINE;}
YY_BREAK
case 121:
YY_RULE_SETUP
-#line 351 "detex.l"
+#line 353 "detex.l"
{BEGIN Normal; IGNORE;}
YY_BREAK
case 122:
YY_RULE_SETUP
-#line 352 "detex.l"
+#line 354 "detex.l"
{yyless(0);BEGIN Normal;}
YY_BREAK
case 123:
YY_RULE_SETUP
-#line 354 "detex.l"
+#line 356 "detex.l"
/* special characters */ IGNORE;
YY_BREAK
case 124:
YY_RULE_SETUP
-#line 355 "detex.l"
+#line 357 "detex.l"
IGNORE;
YY_BREAK
case 125:
YY_RULE_SETUP
-#line 356 "detex.l"
+#line 358 "detex.l"
SPACE;
YY_BREAK
case 126:
YY_RULE_SETUP
-#line 358 "detex.l"
+#line 360 "detex.l"
{ if (fWord)
(void)printf("%s\n", yytext);
else
@@ -2200,28 +2202,28 @@ YY_RULE_SETUP
YY_BREAK
case 127:
YY_RULE_SETUP
-#line 363 "detex.l"
+#line 365 "detex.l"
if (!fWord) ECHO;
YY_BREAK
case 128:
/* rule 128 can match eol */
YY_RULE_SETUP
-#line 364 "detex.l"
+#line 366 "detex.l"
if (!fWord) ECHO;
YY_BREAK
case 129:
YY_RULE_SETUP
-#line 366 "detex.l"
+#line 368 "detex.l"
{ BEGIN LaOptArg; }
YY_BREAK
case 130:
YY_RULE_SETUP
-#line 367 "detex.l"
+#line 369 "detex.l"
{ cOpenBrace++; }
YY_BREAK
case 131:
YY_RULE_SETUP
-#line 368 "detex.l"
+#line 370 "detex.l"
{ cOpenBrace--;
if (cOpenBrace == 0)
{
@@ -2232,28 +2234,28 @@ YY_RULE_SETUP
YY_BREAK
case 132:
YY_RULE_SETUP
-#line 375 "detex.l"
+#line 377 "detex.l"
;
YY_BREAK
case 133:
YY_RULE_SETUP
-#line 376 "detex.l"
+#line 378 "detex.l"
BEGIN LaMacro;
YY_BREAK
case 134:
/* rule 134 can match eol */
YY_RULE_SETUP
-#line 377 "detex.l"
+#line 379 "detex.l"
;
YY_BREAK
case 135:
YY_RULE_SETUP
-#line 379 "detex.l"
+#line 381 "detex.l"
{ BEGIN LaOptArg2; }
YY_BREAK
case 136:
YY_RULE_SETUP
-#line 380 "detex.l"
+#line 382 "detex.l"
{ if (cOpenBrace == 0)
{
if (--cArgs==0)
@@ -2267,30 +2269,30 @@ YY_RULE_SETUP
YY_BREAK
case 137:
YY_RULE_SETUP
-#line 390 "detex.l"
+#line 392 "detex.l"
{ cOpenBrace--; }
YY_BREAK
case 138:
YY_RULE_SETUP
-#line 391 "detex.l"
+#line 393 "detex.l"
;
YY_BREAK
case 139:
YY_RULE_SETUP
-#line 392 "detex.l"
+#line 394 "detex.l"
BEGIN LaMacro2;
YY_BREAK
case 140:
YY_RULE_SETUP
-#line 393 "detex.l"
+#line 395 "detex.l"
;
YY_BREAK
case 141:
YY_RULE_SETUP
-#line 394 "detex.l"
+#line 396 "detex.l"
ECHO;
YY_BREAK
-#line 2294 "detex.c"
+#line 2296 "detex.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(Define):
case YY_STATE_EOF(Display):
@@ -3308,7 +3310,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 394 "detex.l"
+#line 396 "detex.l"
/******
@@ -3332,7 +3334,7 @@ int
main(int cArgs, char *rgsbArgs[])
{
char *pch, sbBadOpt[2];
- const char *sbEnvList = DEFAULTENV;
+ const char *sbEnvList = DEFAULTENV;
int fSawFile = 0, iArgs = 1;
/* get base name and decide what we are doing, detex or delatex */
@@ -3610,6 +3612,7 @@ InList(char *sbFile)
return(0);
}
+#ifndef KPATHSEA
/******
** SetInputPaths -- sets rgsbInputPaths to the values indicated by the
** TEXINPUTS environment variable if set or else DEFAULTINPUTS. If
@@ -3624,9 +3627,6 @@ SetInputPaths(void)
{
const char *sb;
char *sbPaths;
-#ifndef WIN32
- char *getenv();
-#endif
int cchDefaults, cchPaths;
cchDefaults = strlen(DEFAULTINPUTS);
@@ -3656,6 +3656,7 @@ SetInputPaths(void)
ErrorExit("TEXINPUTS environment variable has too many paths");
#endif
}
+#endif
/******
** SeparateList -- takes a chSep separated list sbList, replaces the