2015-03-30 13:39:58 +02:00
|
|
|
---
|
|
|
|
m4/kpse-kpathsea-flags.m4 | 2 +-
|
|
|
|
texk/seetexk/a4toa5 | 26 ++++++++++++++++++++++++++
|
|
|
|
texk/seetexk/configure | 2 +-
|
2021-04-09 20:35:30 +02:00
|
|
|
texk/seetexk/dvibook.c | 7 +++----
|
2015-03-30 13:39:58 +02:00
|
|
|
texk/seetexk/dviconcat.c | 6 ++----
|
2018-05-02 15:10:44 +02:00
|
|
|
texk/seetexk/dviselect.c | 8 +++-----
|
2021-04-09 20:35:30 +02:00
|
|
|
texk/seetexk/dvitodvi.c | 41 ++++++++++++++++++++++++++++++++---------
|
2015-03-30 13:39:58 +02:00
|
|
|
texk/seetexk/error.c | 14 +++++---------
|
|
|
|
texk/seetexk/gripes.h | 21 +++++++++++----------
|
|
|
|
texk/seetexk/gripes0.c | 12 +++++-------
|
|
|
|
texk/seetexk/gripes1.c | 17 +++++++++--------
|
|
|
|
texk/seetexk/mydvichk | 12 ++++++++++++
|
|
|
|
texk/seetexk/odd2even | 22 ++++++++++++++++++++++
|
|
|
|
texk/seetexk/search.c | 5 +----
|
|
|
|
texk/seetexk/seek.c | 11 +++++------
|
|
|
|
texk/seetexk/tempfile.c | 5 ++---
|
|
|
|
texk/seetexk/types.h | 2 +-
|
2021-04-09 20:35:30 +02:00
|
|
|
17 files changed, 141 insertions(+), 72 deletions(-)
|
2015-03-30 13:39:58 +02:00
|
|
|
|
2011-12-20 18:29:17 +01:00
|
|
|
--- m4/kpse-kpathsea-flags.m4
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ m4/kpse-kpathsea-flags.m4 2021-04-07 09:56:20.318745619 +0000
|
2016-02-01 17:10:03 +01:00
|
|
|
@@ -16,7 +16,7 @@
|
|
|
|
AC_DEFUN([KPSE_KPATHSEA_FLAGS], [dnl
|
|
|
|
AC_REQUIRE([KPSE_SAVE_FLAGS])[]dnl
|
2011-12-20 18:29:17 +01:00
|
|
|
_KPSE_TEXLIB_FLAGS([kpathsea], [kpathsea], [lt],
|
|
|
|
- [-IBLD/texk -ISRC/texk], [BLD/texk/kpathsea/libkpathsea.la], [],
|
|
|
|
+ [-IBLD/texk/kpathsea -ISRC/texk/kpathsea -IBLD/texk -ISRC/texk], [BLD/texk/kpathsea/libkpathsea.la], [],
|
|
|
|
[${top_srcdir}/../kpathsea/*.[ch]],
|
|
|
|
[${top_builddir}/../kpathsea/paths.h])
|
|
|
|
m4_if(m4_index([ $1 ], [ no-debug ]), [-1],
|
|
|
|
--- texk/seetexk/a4toa5
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/a4toa5 2021-04-07 09:56:20.322745677 +0000
|
2011-12-20 18:29:17 +01:00
|
|
|
@@ -0,0 +1,26 @@
|
|
|
|
+#!/bin/csh -f
|
|
|
|
+# 1993 (c) Werner Fink <Werner.Fink@itap.physik.uni-stuttgart.de>
|
|
|
|
+#
|
|
|
|
+
|
|
|
|
+if (${#argv} <= 1) then
|
|
|
|
+ echo " ${0}: Usage: infile outfile"
|
|
|
|
+ exit
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+set NumP=`mydvichk $1 | sed -e 's/totalpages=//g'`
|
|
|
|
+
|
|
|
|
+if (${NumP} % 2) then
|
|
|
|
+ echo " Odd number of pages --- this doesn't work"
|
|
|
|
+ echo " Please use odd2even: This gives an additional first pages"
|
|
|
|
+ echo " Or"
|
|
|
|
+ echo " use dvibook: It sort the pages in book form"
|
|
|
|
+ exit
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+echo "${0}: For Printing: dvips -t landscape outfile"
|
|
|
|
+echo "${0}: For Viewing: xdvi -paper a4r outfile"
|
|
|
|
+
|
|
|
|
+#
|
|
|
|
+#exec dvitodvi -q '2:707@0(-5.5mm,-10mm)+1(204mm,-10mm)' $1 $2
|
|
|
|
+#
|
|
|
|
+exec dvitodvi -q '2:707@0(-5.5mm,-10mm)+1(190mm,-10mm)' $1 $2
|
|
|
|
--- texk/seetexk/configure
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/configure 2021-04-07 09:56:20.322745677 +0000
|
2024-03-18 14:51:14 +01:00
|
|
|
@@ -16075,7 +16075,7 @@ elif test "x$need_kpathsea:$with_system_
|
2016-02-01 17:10:03 +01:00
|
|
|
as_fn_error $? "did not find kpathsea" "$LINENO" 5
|
2011-12-20 18:29:17 +01:00
|
|
|
fi
|
|
|
|
else
|
2012-06-12 19:56:21 +02:00
|
|
|
- KPATHSEA_INCLUDES="-I$kpse_BLD/texk -I$kpse_SRC/texk"
|
|
|
|
+ KPATHSEA_INCLUDES="-I$kpse_BLD/texk/kpathsea -I$kpse_SRC/texk/kpathsea -I$kpse_BLD/texk -I$kpse_SRC/texk"
|
|
|
|
KPATHSEA_LIBS="$kpse_BLD/texk/kpathsea/libkpathsea.la"
|
|
|
|
KPATHSEA_DEPEND='${top_builddir}/../kpathsea/libkpathsea.la'
|
|
|
|
KPATHSEA_RULE='# Rebuild libkpathsea
|
2011-12-20 18:29:17 +01:00
|
|
|
--- texk/seetexk/dvibook.c
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/dvibook.c 2021-04-07 09:59:15.141300494 +0000
|
2024-03-18 14:51:14 +01:00
|
|
|
@@ -49,6 +49,7 @@ extern int optind;
|
|
|
|
#include <sys/stat.h>
|
2011-12-20 18:29:17 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
+#include <stdlib.h>
|
|
|
|
#include "types.h"
|
|
|
|
#include "dviclass.h"
|
|
|
|
#include "dvicodes.h"
|
2024-03-18 14:51:14 +01:00
|
|
|
@@ -57,6 +58,8 @@ extern int optind;
|
2011-12-20 18:29:17 +01:00
|
|
|
#include "gripes.h"
|
|
|
|
#include "search.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
+#include <stdlib.h>
|
|
|
|
+#include <unistd.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include "seek.h"
|
2021-04-09 20:35:30 +02:00
|
|
|
#include "common.h"
|
2024-03-18 14:51:14 +01:00
|
|
|
@@ -126,10 +129,6 @@ i32 Count[10]; /* the 10 \count variabl
|
2011-12-20 18:29:17 +01:00
|
|
|
/* save some string space: we use this a lot */
|
|
|
|
char writeerr[] = "error writing DVI file";
|
|
|
|
|
|
|
|
-#ifndef KPATHSEA
|
2021-04-09 20:35:30 +02:00
|
|
|
-void *malloc(), *realloc();
|
|
|
|
-void free();
|
2011-12-20 18:29:17 +01:00
|
|
|
-#endif
|
|
|
|
/*
|
|
|
|
* You may get lint warnings about sprintf's return value.
|
|
|
|
* Older versions of 4BSD have `char *sprintf()'. ANSI and
|
|
|
|
--- texk/seetexk/dviconcat.c
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/dviconcat.c 2021-04-07 09:56:20.322745677 +0000
|
2024-03-18 14:51:14 +01:00
|
|
|
@@ -46,6 +46,8 @@ extern int optind;
|
|
|
|
#include <sys/stat.h>
|
2011-12-20 18:29:17 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
+#include <stdlib.h>
|
|
|
|
+#include <string.h>
|
|
|
|
#include "types.h"
|
|
|
|
#include "dviclass.h"
|
|
|
|
#include "dvicodes.h"
|
2024-03-18 14:51:14 +01:00
|
|
|
@@ -113,10 +115,6 @@ char writeerr[] = "error writing DVI fil
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
static void HandleDVIFile(void);
|
2015-03-30 13:39:58 +02:00
|
|
|
|
2011-12-20 18:29:17 +01:00
|
|
|
-#ifndef KPATHSEA
|
|
|
|
-char *malloc(), *realloc();
|
|
|
|
-#endif
|
2015-03-30 13:39:58 +02:00
|
|
|
-
|
2011-12-20 18:29:17 +01:00
|
|
|
/* extern int getopt(int, char **, char*); */
|
|
|
|
|
2015-03-30 13:39:58 +02:00
|
|
|
/*
|
2011-12-20 18:29:17 +01:00
|
|
|
--- texk/seetexk/dviselect.c
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/dviselect.c 2021-04-07 09:59:54.141870365 +0000
|
2018-05-02 15:10:44 +02:00
|
|
|
@@ -57,6 +57,8 @@ extern int optind;
|
2011-12-20 18:29:17 +01:00
|
|
|
#include "gripes.h"
|
|
|
|
#include "search.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
+#include <stdlib.h>
|
|
|
|
+#include <string.h>
|
2018-05-02 15:10:44 +02:00
|
|
|
#include <ctype.h>
|
2021-04-09 20:35:30 +02:00
|
|
|
#include "common.h"
|
2011-12-20 18:29:17 +01:00
|
|
|
|
2021-04-09 20:35:30 +02:00
|
|
|
@@ -173,10 +175,6 @@ static void HandleDVIFile(void);
|
2011-12-20 18:29:17 +01:00
|
|
|
static void PutFontSelector(i32);
|
2015-03-30 13:39:58 +02:00
|
|
|
static void WritePreAmble(void);
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
-#ifndef KPATHSEA
|
|
|
|
-char *malloc(), *realloc();
|
|
|
|
-#endif /* not KPATHSEA */
|
2015-03-30 13:39:58 +02:00
|
|
|
-
|
2011-12-20 18:29:17 +01:00
|
|
|
/*
|
|
|
|
* You may get lint warnings about sprintf's return value.
|
2015-03-30 13:39:58 +02:00
|
|
|
* Older versions of 4BSD have `char *sprintf()'. ANSI and
|
2024-03-18 14:51:14 +01:00
|
|
|
@@ -635,7 +633,7 @@ Usage: %s [-s] [-i infile] [-o outfile]
|
2011-12-20 18:29:17 +01:00
|
|
|
static struct pagelist *
|
|
|
|
InstallPL(struct pagesel *ps, int n, int absolute)
|
|
|
|
{
|
|
|
|
- register struct pagelist *pl;
|
|
|
|
+ struct pagelist *pl;
|
|
|
|
|
|
|
|
pl = (struct pagelist *)malloc(sizeof *pl);
|
|
|
|
if (pl == NULL)
|
|
|
|
--- texk/seetexk/dvitodvi.c
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/dvitodvi.c 2021-04-07 10:02:34.816217795 +0000
|
2018-05-02 15:10:44 +02:00
|
|
|
@@ -46,6 +46,7 @@ extern char *optarg;
|
2011-12-20 18:29:17 +01:00
|
|
|
extern int optind;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#include <stdlib.h>
|
|
|
|
#include "types.h"
|
|
|
|
#include "dviclass.h"
|
|
|
|
#include "dvicodes.h"
|
2018-05-02 15:10:44 +02:00
|
|
|
@@ -54,6 +55,8 @@ extern int optind;
|
2011-12-20 18:29:17 +01:00
|
|
|
#include "gripes.h"
|
|
|
|
#include "search.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
+#include <stdlib.h>
|
|
|
|
+#include <unistd.h>
|
|
|
|
#include <ctype.h>
|
2018-05-02 15:10:44 +02:00
|
|
|
#include "seek.h"
|
2021-04-09 20:35:30 +02:00
|
|
|
#include "common.h"
|
|
|
|
@@ -89,6 +92,7 @@ struct fontinfo {
|
2011-12-20 18:29:17 +01:00
|
|
|
i32 Width; /* width of page */
|
|
|
|
i32 Height; /* height of page */
|
|
|
|
i32 Magnification; /* Magnification of pages */
|
|
|
|
+i32 MyMag;
|
|
|
|
int Modulo; /* page spec modulo */
|
|
|
|
struct pagespec *PageSpecs; /* page specification list */
|
|
|
|
|
2021-04-09 20:35:30 +02:00
|
|
|
@@ -128,10 +132,6 @@ i32 Count[10]; /* the 10 \count variabl
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
/* save some string space: we use this a lot */
|
|
|
|
char writeerr[] = "error writing DVI file";
|
|
|
|
-#ifndef KPATHSEA
|
2021-04-09 20:35:30 +02:00
|
|
|
-void *malloc(), *realloc();
|
|
|
|
-void free();
|
2011-12-20 18:29:17 +01:00
|
|
|
-#endif
|
|
|
|
|
|
|
|
static void WriteFont(struct fontinfo *fi);
|
|
|
|
static void PutFontSelector(i32 index);
|
2021-04-09 20:35:30 +02:00
|
|
|
@@ -192,6 +192,15 @@ scale(i32 whole, int num, int den, i32 s
|
2011-12-20 18:29:17 +01:00
|
|
|
return (v) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
+i32 myscale(i32 whole, i32 verus, i32 sf)
|
|
|
|
+{
|
|
|
|
+ i32 v;
|
|
|
|
+
|
|
|
|
+ v = (i32) (( (double)whole * ( (double)sf / (double)verus ) ) + 0.5 );
|
|
|
|
+ return(v);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
struct pagespec {
|
|
|
|
int reversed, pageno, add;
|
|
|
|
i32 xoff, yoff;
|
2021-04-09 20:35:30 +02:00
|
|
|
@@ -299,6 +308,8 @@ parsedimen(char **sp)
|
2011-12-20 18:29:17 +01:00
|
|
|
fac = Height;
|
|
|
|
s++;
|
|
|
|
}
|
|
|
|
+ if (MyMag)
|
|
|
|
+ fac = myscale(fac,MyMag,1000);
|
|
|
|
whole = scale(whole, num, den, fac) ;
|
|
|
|
*sp = s;
|
|
|
|
return (neg ? -whole : whole);
|
2021-04-09 20:35:30 +02:00
|
|
|
@@ -501,9 +512,15 @@ HandlePostAmble(void)
|
2011-12-20 18:29:17 +01:00
|
|
|
PutLong(outf, Denominator);
|
|
|
|
PutLong(outf, DVIMag);
|
|
|
|
c = GetLong(inf);
|
|
|
|
- PutLong(outf, c); /* tallest page height */
|
|
|
|
+ if ( c >= Height )
|
|
|
|
+ PutLong(outf, c); /* tallest page height */
|
|
|
|
+ else
|
|
|
|
+ PutLong(outf, Height);
|
|
|
|
c = GetLong(inf);
|
|
|
|
- PutLong(outf, c); /* widest page width */
|
|
|
|
+ if ( c >= Width )
|
|
|
|
+ PutLong(outf, c); /* widest page width */
|
|
|
|
+ else
|
|
|
|
+ PutLong(outf, Width);
|
|
|
|
c = GetWord(inf)+1;
|
|
|
|
PutWord(outf, c); /* DVI stack size */
|
|
|
|
PutWord(outf, NumberOfOutputPages);
|
2021-04-09 20:35:30 +02:00
|
|
|
@@ -601,7 +618,8 @@ HandlePreAmble(void)
|
2011-12-20 18:29:17 +01:00
|
|
|
DVIFileName, DVI_VERSION);
|
|
|
|
Numerator = GetLong(inf);
|
|
|
|
Denominator = GetLong(inf);
|
|
|
|
- DVIMag = GetLong(inf) * Magnification / 1000;
|
|
|
|
+ MyMag = GetLong(inf);
|
|
|
|
+ DVIMag = MyMag * Magnification / 1000;
|
|
|
|
putbyte(outf, DVI_PRE);
|
|
|
|
putbyte(outf, DVI_VERSION);
|
|
|
|
PutLong(outf, Numerator);
|
2024-03-18 14:51:14 +01:00
|
|
|
@@ -641,6 +659,7 @@ main(int argc, char **argv)
|
2011-12-20 18:29:17 +01:00
|
|
|
Width = 0;
|
|
|
|
Height = 0;
|
|
|
|
Magnification = 1000;
|
|
|
|
+ MyMag = 0;
|
|
|
|
Modulo = 1;
|
|
|
|
|
|
|
|
ProgName = *argv;
|
2024-03-18 14:51:14 +01:00
|
|
|
@@ -752,12 +771,16 @@ Usage: %s [-q] [-i infile] [-o outfile]
|
2011-12-20 18:29:17 +01:00
|
|
|
if (fseek(inf, 16L, 1) == -1)
|
|
|
|
error(1, -1, "can't seek postamble");
|
|
|
|
if (Height == 0) /* get height from postamble */
|
|
|
|
- Height = GetLong(inf);
|
|
|
|
+ Height = myscale(GetLong(inf),1000,MyMag);
|
|
|
|
else
|
|
|
|
(void) GetLong(inf); /* ignore height */
|
|
|
|
if (Width == 0) /* get width from postamble */
|
|
|
|
- Width = GetLong(inf);
|
2012-04-13 18:41:24 +02:00
|
|
|
+ Width = myscale(GetLong(inf),1000,MyMag);
|
2011-12-20 18:29:17 +01:00
|
|
|
+ else
|
|
|
|
+ (void) GetLong(inf);
|
|
|
|
PageSpecs = ParseSpecs(specstring, 1);
|
|
|
|
+ Height = myscale(Height,MyMag,1000);
|
|
|
|
+ Width = myscale(Width,MyMag,1000);
|
|
|
|
|
|
|
|
HandleDVIFile();
|
2021-04-09 20:35:30 +02:00
|
|
|
free(StartOfPage);
|
2011-12-20 18:29:17 +01:00
|
|
|
--- texk/seetexk/error.c
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/error.c 2021-04-07 09:56:20.326745736 +0000
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -29,7 +29,12 @@
|
|
|
|
#include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2011-12-20 18:29:17 +01:00
|
|
|
+#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
+#include <stdlib.h>
|
|
|
|
+#include <string.h>
|
|
|
|
+#include <c-auto.h>
|
|
|
|
+#include <errno.h>
|
|
|
|
|
2016-02-01 17:10:03 +01:00
|
|
|
#include "types.h"
|
2015-03-30 13:39:58 +02:00
|
|
|
#include "error.h"
|
|
|
|
@@ -37,20 +42,11 @@
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
extern char *ProgName; /* program name from argv[0] */
|
|
|
|
|
|
|
|
-#include <errno.h>
|
|
|
|
-#ifndef errno
|
|
|
|
-extern int errno;
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
static FILE *trap_file; /* error diversion file, if any */
|
|
|
|
static void (*trap_fn)(int, const char *); /* trap function */
|
|
|
|
static char *trap_buf; /* buffer for trapped error strings */
|
|
|
|
static int trap_size; /* size of trap_buf */
|
|
|
|
|
|
|
|
-#ifndef KPATHSEA
|
|
|
|
-extern char *malloc(), *realloc();
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
#if !defined (HAVE_STRERROR) && !defined (strerror)
|
|
|
|
static char *
|
|
|
|
strerror (int errnum)
|
|
|
|
--- texk/seetexk/gripes.h
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/gripes.h 2021-04-07 09:56:20.326745736 +0000
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -28,16 +28,17 @@ extern const char *DVIFileName;
|
2011-12-20 18:29:17 +01:00
|
|
|
* Declarations for the various gripes.
|
|
|
|
*/
|
|
|
|
|
|
|
|
-void GripeOutOfMemory(int n, const char *why);
|
|
|
|
+#define __NR__ __attribute__ ((noreturn))
|
|
|
|
+void GripeOutOfMemory(int n, const char *why) __NR__;
|
|
|
|
void GripeCannotGetFont(const char *name, i32 mag, i32 dsz, const char *dev, const char *fullname);
|
|
|
|
void GripeDifferentChecksums(const char *font, i32 tfmsum, i32 fontsum);
|
|
|
|
-void GripeMissingFontsPreventOutput(int n);
|
|
|
|
-void GripeNoSuchFont(i32 n);
|
|
|
|
-void GripeFontAlreadyDefined(i32 n);
|
|
|
|
-void GripeUnexpectedDVIEOF(void);
|
|
|
|
-void GripeUnexpectedOp(const char *s);
|
|
|
|
-void GripeMissingOp(const char *s);
|
|
|
|
-void GripeCannotFindPostamble(void);
|
|
|
|
-void GripeMismatchedValue(const char *s);
|
|
|
|
-void GripeUndefinedOp(int n);
|
|
|
|
+void GripeMissingFontsPreventOutput(int n) __NR__;
|
|
|
|
+void GripeNoSuchFont(i32 n) __NR__;
|
|
|
|
+void GripeFontAlreadyDefined(i32 n) __NR__;
|
|
|
|
+void GripeUnexpectedDVIEOF(void) __NR__;
|
|
|
|
+void GripeUnexpectedOp(const char *s) __NR__;
|
|
|
|
+void GripeMissingOp(const char *s) __NR__;
|
|
|
|
+void GripeCannotFindPostamble(void) __NR__;
|
|
|
|
+void GripeMismatchedValue(const char *s) __NR__;
|
|
|
|
+void GripeUndefinedOp(int n) __NR__;
|
|
|
|
void GripeBadGlyph(i32 c, struct font *f);
|
|
|
|
--- texk/seetexk/gripes0.c
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/gripes0.c 2021-04-07 09:56:20.326745736 +0000
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -28,10 +28,8 @@
|
2011-12-20 18:29:17 +01:00
|
|
|
#include "error.h"
|
|
|
|
#include "gripes.h"
|
2015-03-30 13:39:58 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
-
|
2011-12-20 18:29:17 +01:00
|
|
|
-#ifndef WIN32
|
|
|
|
-extern int errno;
|
|
|
|
-#endif
|
2015-03-30 13:39:58 +02:00
|
|
|
+#include <stdlib.h>
|
|
|
|
+#include <errno.h>
|
|
|
|
|
2011-12-20 18:29:17 +01:00
|
|
|
/*
|
|
|
|
* Cannot allocate memory.
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -41,7 +39,7 @@ GripeOutOfMemory(int n, const char *why)
|
2011-12-20 18:29:17 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
error(1, -1, "ran out of memory allocating %d bytes for %s", n, why);
|
|
|
|
- /* NOTREACHED */
|
|
|
|
+ exit(-1); /* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -86,7 +84,7 @@ WARNING: TeX and I have different checks
|
2011-12-20 18:29:17 +01:00
|
|
|
\t\"%s\"\n\
|
|
|
|
\tPlease notify your TeX maintainer\n\
|
|
|
|
\t(TFM checksum = 0%lo, my checksum = 0%lo)",
|
|
|
|
- font, (long)tfmsum, (long)fontsum);
|
|
|
|
+ font ? font : "", (long)tfmsum, (long)fontsum);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -99,5 +97,5 @@ GripeMissingFontsPreventOutput(int n)
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
error(1, 0, "%d missing font%s prevent%s output (sorry)", n,
|
|
|
|
n > 1 ? s : &s[1], n == 1 ? s : &s[1]);
|
|
|
|
- /* NOTREACHED */
|
|
|
|
+ exit(0); /* NOTREACHED */
|
|
|
|
}
|
|
|
|
--- texk/seetexk/gripes1.c
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/gripes1.c 2021-04-07 09:56:20.326745736 +0000
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -29,6 +29,7 @@
|
|
|
|
#include "font.h"
|
|
|
|
#include "gripes.h"
|
2011-12-20 18:29:17 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
+#include <stdlib.h>
|
2015-03-30 13:39:58 +02:00
|
|
|
|
|
|
|
static const char *
|
|
|
|
dfn(void)
|
|
|
|
@@ -40,7 +41,7 @@ dfn(void)
|
2011-12-20 18:29:17 +01:00
|
|
|
/*
|
|
|
|
* Save string space by declaring these here.
|
|
|
|
*/
|
|
|
|
-#if __STDC__ >= 1
|
|
|
|
+#if 0
|
|
|
|
static const char dfl[] = "DVI file";
|
|
|
|
static const char areyousure[] = "(are you sure %s is a %s?)";
|
|
|
|
#else
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -57,7 +58,7 @@ GripeNoSuchFont(i32 n)
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
error(0, 0, "%s wants font %ld, which it never defined", dfl, (long)n);
|
|
|
|
error(1, 0, areyousure, dfn(), dfl);
|
|
|
|
- /* NOTREACHED */
|
|
|
|
+ exit (0); /* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -69,7 +70,7 @@ GripeFontAlreadyDefined(i32 n)
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
error(0, 0, "%s redefines font %ld", dfl, n);
|
|
|
|
error(1, 0, areyousure, dfn(), dfl);
|
|
|
|
- /* NOTREACHED */
|
|
|
|
+ exit (0); /* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -92,7 +93,7 @@ GripeUnexpectedOp(const char *s)
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
error(0, 0, "unexpected %s in %s", s, dfl);
|
|
|
|
error(1, 0, areyousure, dfn(), dfl);
|
|
|
|
- /* NOTREACHED */
|
|
|
|
+ exit (0); /* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -104,7 +105,7 @@ GripeMissingOp(const char *s)
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
error(0, 0, "missing %s in %s", s, dfl);
|
|
|
|
error(1, 0, areyousure, dfn(), dfl);
|
|
|
|
- /* NOTREACHED */
|
|
|
|
+ exit (0); /* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -116,7 +117,7 @@ GripeCannotFindPostamble(void)
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
error(0, 0, "cannot find postamble");
|
|
|
|
error(1, 0, areyousure, dfn(), dfl);
|
|
|
|
- /* NOTREACHED */
|
|
|
|
+ exit (0); /* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -128,7 +129,7 @@ GripeMismatchedValue(const char *s)
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
error(0, 0, "mismatched %s in %s", s, dfl);
|
|
|
|
error(1, 0, areyousure, dfn(), dfl);
|
|
|
|
- /* NOTREACHED */
|
|
|
|
+ exit (0); /* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -140,7 +141,7 @@ GripeUndefinedOp(int n)
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
error(0, 0, "undefined DVI opcode %d", n);
|
|
|
|
error(1, 0, areyousure, dfn(), dfl);
|
|
|
|
- /* NOTREACHED */
|
|
|
|
+ exit (0); /* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
--- texk/seetexk/mydvichk
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/mydvichk 2021-04-07 09:56:20.326745736 +0000
|
2011-12-20 18:29:17 +01:00
|
|
|
@@ -0,0 +1,12 @@
|
|
|
|
+#!/bin/csh -f
|
|
|
|
+# 1993 (c) Werner Fink <Werner.Fink@itap.physik.uni-stuttgart.de>
|
|
|
|
+#
|
|
|
|
+dvitype ${1} <<DONE |& tr " " "\012" | fgrep totalpages
|
|
|
|
+0
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+0
|
|
|
|
+DONE
|
|
|
|
+
|
|
|
|
+exit(0)
|
|
|
|
--- texk/seetexk/odd2even
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/odd2even 2021-04-07 09:56:20.330745794 +0000
|
2011-12-20 18:29:17 +01:00
|
|
|
@@ -0,0 +1,22 @@
|
|
|
|
+#!/bin/csh -f
|
|
|
|
+# 1993 (c) Werner Fink <Werner.Fink@itap.physik.uni-stuttgart.de>
|
|
|
|
+#
|
|
|
|
+
|
|
|
|
+if (${#argv} <= 1) then
|
|
|
|
+ echo " ${0}: Usage: infile outfile"
|
|
|
|
+ exit
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+set NumP=`mydvichk $1 | sed -e 's/totalpages=//g'`
|
|
|
|
+
|
|
|
|
+if (${NumP} % 2) then
|
|
|
|
+ dviselect -s '=1' $1 | \
|
|
|
|
+ dvibook -q | \
|
|
|
|
+ dviselect -s '=1' | \
|
|
|
|
+ dviconcat -o $2 - $1 >& /dev/null
|
|
|
|
+ echo " ${0}: ready"
|
|
|
|
+else
|
|
|
|
+ echo " ${0}: even number of pages --- nothing to do"
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+exit 0
|
2015-03-30 13:39:58 +02:00
|
|
|
--- texk/seetexk/search.c
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/search.c 2021-04-07 09:56:20.330745794 +0000
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -34,6 +34,7 @@
|
|
|
|
* it runs in increasing-key-value sequence).
|
|
|
|
*/
|
|
|
|
|
|
|
|
+#include <stdlib.h>
|
|
|
|
#include "types.h"
|
|
|
|
#include "search.h"
|
|
|
|
|
|
|
|
@@ -45,10 +46,6 @@
|
|
|
|
|
|
|
|
static int DOffset; /* part of alignment code */
|
|
|
|
|
|
|
|
-#ifndef KPATHSEA
|
|
|
|
-char *malloc(), *realloc();
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
struct search *
|
|
|
|
SCreate(unsigned int dsize)
|
|
|
|
{
|
2011-12-20 18:29:17 +01:00
|
|
|
--- texk/seetexk/seek.c
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/seek.c 2021-04-07 09:56:20.330745794 +0000
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -43,6 +43,10 @@
|
2011-12-20 18:29:17 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
+#include <stdlib.h>
|
|
|
|
+#include <sys/types.h>
|
|
|
|
+#include <unistd.h>
|
|
|
|
+#include <errno.h>
|
|
|
|
#include "types.h" /* for BSD_FILE_SYSTEM */
|
|
|
|
#include "seek.h"
|
|
|
|
#include "tempfile.h"
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -55,12 +59,7 @@
|
2011-12-20 18:29:17 +01:00
|
|
|
#endif
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
|
|
|
-#ifndef KPATHSEA
|
|
|
|
-long lseek();
|
|
|
|
-char *malloc();
|
|
|
|
-
|
|
|
|
-extern int errno;
|
|
|
|
-#endif
|
|
|
|
+extern int MakeRWTempFile();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Make and return a version of `f' on which fseek works (unconditionally).
|
|
|
|
--- texk/seetexk/tempfile.c
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/tempfile.c 2021-04-07 09:56:20.330745794 +0000
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -25,6 +25,7 @@
|
2011-12-20 18:29:17 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
+#include <stdlib.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_UNISTD_H
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -39,9 +40,7 @@
|
2011-12-20 18:29:17 +01:00
|
|
|
#include "types.h"
|
|
|
|
#else
|
|
|
|
#include <sys/file.h>
|
|
|
|
-
|
|
|
|
-char *getenv();
|
|
|
|
-
|
|
|
|
+#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "tempfile.h"
|
|
|
|
--- texk/seetexk/types.h
|
2021-04-09 20:35:30 +02:00
|
|
|
+++ texk/seetexk/types.h 2021-04-07 09:56:20.330745794 +0000
|
2015-03-30 13:39:58 +02:00
|
|
|
@@ -58,7 +58,7 @@
|
2011-12-20 18:29:17 +01:00
|
|
|
*
|
|
|
|
* (The bcopy provided in lib/bcopy.c does handle overlap.)
|
|
|
|
*/
|
|
|
|
-/* #define BLOCK_COPY(from, to, len) memmove(to, from, len) */
|
|
|
|
+#include <string.h>
|
2015-03-30 13:39:58 +02:00
|
|
|
#define BLOCK_COPY(from, to, len) memmove(to, from, len)
|
2011-12-20 18:29:17 +01:00
|
|
|
|
|
|
|
/*
|