summaryrefslogtreecommitdiffstats
path: root/contrib/groff/xditview
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2000-12-05 18:49:44 +0000
committerru <ru@FreeBSD.org>2000-12-05 18:49:44 +0000
commita812d8b090bc4edc23150bff257717b24f282e41 (patch)
tree19d4540966cb92612af25d5154efcc062eefb5c5 /contrib/groff/xditview
parent2e2c9047c3a8b5b6fdcdcd4585d5b114f31cd386 (diff)
downloadFreeBSD-src-a812d8b090bc4edc23150bff257717b24f282e41.zip
FreeBSD-src-a812d8b090bc4edc23150bff257717b24f282e41.tar.gz
Virgin import of FSF groff v1.16.1
Diffstat (limited to 'contrib/groff/xditview')
-rw-r--r--contrib/groff/xditview/ChangeLog36
-rw-r--r--contrib/groff/xditview/Dvi.c10
-rw-r--r--contrib/groff/xditview/DviChar.c6
-rw-r--r--contrib/groff/xditview/Imakefile.in99
-rw-r--r--contrib/groff/xditview/README4
-rw-r--r--contrib/groff/xditview/xtotroff.c12
6 files changed, 151 insertions, 16 deletions
diff --git a/contrib/groff/xditview/ChangeLog b/contrib/groff/xditview/ChangeLog
index 6dffe9e..88235e6 100644
--- a/contrib/groff/xditview/ChangeLog
+++ b/contrib/groff/xditview/ChangeLog
@@ -1,3 +1,37 @@
+2000-05-18 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c: Adding `cq' as an alias for "'" in latin-1 map.
+
+2000-05-03 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c: Adding `dq' as an alias for `"' in latin-1 map.
+
+2000-04-28 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c: Replacing `md' glyph name with `pc' in latin-1 map to
+ make it distinct from the `md' glyph in the symbol font.
+
+2000-03-03 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile replaced with Imakefile.in which will be configured by
+ the main configure script of groff. This will set the correct font
+ path, and it will make it possible to build xditview in a directory
+ different from $srcdir.
+
+2000-03-01 Colin Phipps <crp22@cam.ac.uk>
+
+ * Dvi.c (OpenFile): Use tmpdir() for security reasons.
+ * xtotroff.c (MapFont): Avoid race while opening file.
+
+2000-02-06 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile: Adapted to new directory structure.
+
+ * README: Updated.
+
+Version 1.15 released
+=====================
+
1999-12-21 Werner LEMBERG <wl@gnu.org>
* README: Fixed ftp GNU address.
@@ -293,7 +327,7 @@ Sun May 26 14:14:01 1991 James Clark (jjc at jclark)
* xditview.c: Add -resolution argument.
* GXditview.ad: Add default for GXditview.height.
* Dvi.c (Initialize, SetDevice): Use default_resolution.
-
+
* Dvi.c: Make MY_HEIGHT and MY_WIDTH use the paperlength and
paperwidth commands in the DESC file.
diff --git a/contrib/groff/xditview/Dvi.c b/contrib/groff/xditview/Dvi.c
index 5eae76d..08eb810 100644
--- a/contrib/groff/xditview/Dvi.c
+++ b/contrib/groff/xditview/Dvi.c
@@ -379,15 +379,9 @@ static void CloseFile (dw)
static void OpenFile (dw)
DviWidget dw;
{
- char tmpName[sizeof ("/tmp/dviXXXXXX")];
-
dw->dvi.tmpFile = 0;
- if (!dw->dvi.seek) {
- strcpy (tmpName, "/tmp/dviXXXXXX");
- mktemp (tmpName);
- dw->dvi.tmpFile = fopen (tmpName, "w+");
- unlink (tmpName);
- }
+ if (!dw->dvi.seek)
+ dw->dvi.tmpFile = tmpfile();
dw->dvi.requested_page = 1;
dw->dvi.last_page = 0;
}
diff --git a/contrib/groff/xditview/DviChar.c b/contrib/groff/xditview/DviChar.c
index 90c6369..2aaba45 100644
--- a/contrib/groff/xditview/DviChar.c
+++ b/contrib/groff/xditview/DviChar.c
@@ -166,12 +166,12 @@ static DviCharNameMap ISO8859_1_map = {
{ 0, /* 31 */},
{ 0, /* 32 */},
{ "!", /* 33 */},
-{ "\"", /* 34 */},
+{ "\"","dq", /* 34 */},
{ "#","sh", /* 35 */},
{ "$","Do", /* 36 */},
{ "%", /* 37 */},
{ "&", /* 38 */},
-{ "'", /* 39 */},
+{ "'","cq", /* 39 */},
{ "(", /* 40 */},
{ ")", /* 41 */},
{ "*", /* 42 */},
@@ -317,7 +317,7 @@ static DviCharNameMap ISO8859_1_map = {
symbol font. */
{ "\265", /* 181 */},
{ "ps", "\266", /* 182 */},
-{ "md", "\267", /* 183 */},
+{ "pc", "\267", /* 183 */},
{ "ac", "\270", /* 184 */},
{ "S1", "\271", /* 185 */},
{ "Om", "\272", /* 186 */},
diff --git a/contrib/groff/xditview/Imakefile.in b/contrib/groff/xditview/Imakefile.in
new file mode 100644
index 0000000..a720205
--- /dev/null
+++ b/contrib/groff/xditview/Imakefile.in
@@ -0,0 +1,99 @@
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+VPATH=@srcdir@
+top_builddir=@top_builddir@
+
+GROFF_PREFIX = @prefix@
+GROFF_DATADIR = $(GROFF_PREFIX)/share
+GROFF_LIBDIR = $(GROFF_DATADIR)/groff
+GROFF_FONTDIR = $(GROFF_LIBDIR)/font
+GROFF_FONTPATH = .:$(GROFF_FONTDIR):/usr/local/lib/font:/usr/lib/font
+DPIS = 75 100
+
+PROGRAMS = \
+ gxditview \
+ xtotroff
+DEPLIBS = XawClientDepLibs
+LOCAL_LIBRARIES = XawClientLibs
+SRCS1 = \
+ $(srcdir)/xditview.c \
+ $(srcdir)/Dvi.c \
+ $(srcdir)/draw.c \
+ $(srcdir)/font.c \
+ $(srcdir)/lex.c \
+ $(srcdir)/page.c \
+ $(srcdir)/parse.c \
+ $(srcdir)/XFontName.c \
+ $(srcdir)/DviChar.c \
+ $(srcdir)/device.c
+OBJS1 = \
+ xditview.o \
+ Dvi.o \
+ draw.o \
+ font.o \
+ lex.o \
+ page.o \
+ parse.o \
+ XFontName.o \
+ DviChar.o \
+ device.o
+SRCS2 = \
+ $(srcdir)/xtotroff.c \
+ $(srcdir)/XFontName.c \
+ $(srcdir)/DviChar.c
+OBJS2 = \
+ xtotroff.o \
+ XFontName.o \
+ DviChar.o
+INCLUDES = \
+ -I$(TOOLKITSRC) \
+ -I$(TOP)
+MATHLIB = -lm
+DEFINES = \
+ $(SIGNAL_DEFINES) \
+ -DFONTPATH=\"$(GROFF_FONTPATH)\" # -DX_NOT_STDC_ENV
+
+DEVDIR = $(top_builddir)/font
+MKINSTALLDIRS = $(top_srcdir)/mkinstalldirs
+
+ComplexProgramTarget_1(gxditview,$(LOCAL_LIBRARIES),$(MATHLIB))
+NormalProgramTarget(xtotroff,$(OBJS2),$(DEPXLIB),$(XLIB), /**/)
+
+InstallAppDefaults(GXditview)
+
+fonts: xtotroff $(srcdir)/DESC $(srcdir)/FontMap
+ @dir=`pwd`; \
+ fonts=`sed -e 's/[ ].*//' $(srcdir)/FontMap`; \
+ for dpi in $(DPIS); do \
+ echo Making devX$$dpi; \
+ test -d $(DEVDIR)/devX$$dpi || \
+ $(MKINSTALLDIRS) $(DEVDIR)/devX$$dpi; \
+ rm -f $(DEVDIR)/devX$$dpi/DESC; \
+ sed -e "s/res 75/res $$dpi/" $(srcdir)/DESC \
+ >$(DEVDIR)/devX$$dpi/DESC; \
+ (cd $(DEVDIR)/devX$$dpi; \
+ rm -f Makefile.sub; \
+ echo DEV=X$$dpi >Makefile.sub; \
+ echo DEVFILES=DESC $$fonts >>Makefile.sub; \
+ $$dir/xtotroff -g -r $$dpi -s 10 $(srcdir)/FontMap); \
+ echo Making devX$$dpi-12; \
+ test -d $(DEVDIR)/devX$$dpi-12 || \
+ $(MKINSTALLDIRS) $(DEVDIR)/devX$$dpi-12; \
+ rm -f $(DEVDIR)/devX$$dpi-12/DESC; \
+ sed -e "s/res 75/res $$dpi/" \
+ -e 's/unitwidth 10/unitwidth 12/' $(srcdir)/DESC \
+ >$(DEVDIR)/devX$$dpi-12/DESC; \
+ (cd $(DEVDIR)/devX$$dpi-12; \
+ rm -f Makefile.sub; \
+ echo DEV=X$$dpi-12 >Makefile.sub; \
+ echo DEVFILES=DESC $$fonts >>Makefile.sub; \
+ $$dir/xtotroff -g -r $$dpi -s 12 $(srcdir)/FontMap); \
+ done
+
+GXditview-ad.h: $(srcdir)/GXditview.ad
+ /bin/sh $(srcdir)/ad2c $(srcdir)/GXditview.ad >GXditview-ad.h
+
+extraclean: clean
+ -rm -f junk tmp grot old Makefile Imakefile
+
+FORCE:
diff --git a/contrib/groff/xditview/README b/contrib/groff/xditview/README
index 7e061b0..b18f64a 100644
--- a/contrib/groff/xditview/README
+++ b/contrib/groff/xditview/README
@@ -1,7 +1,7 @@
This is gxditview, a X11 previewer for groff based on MIT's xditview.
This version can be used with the output of gtroff -Tps as well as
-with -TX75 and -TX100. You will need X11R5 to install it (it might
-work on X11R4, but I haven't tested it.)
+with -TX75 and -TX100. You will need X11R5 or newer to install it (it
+might work on X11R4, but I haven't tested it.)
See the file INSTALL in this directory for installation instructions.
diff --git a/contrib/groff/xditview/xtotroff.c b/contrib/groff/xditview/xtotroff.c
index 3e4e78b..97cac0a 100644
--- a/contrib/groff/xditview/xtotroff.c
+++ b/contrib/groff/xditview/xtotroff.c
@@ -7,6 +7,9 @@
#include <X11/Xlib.h>
#include <stdio.h>
#include <ctype.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <fcntl.h>
#include "XFontName.h"
#include "DviChar.h"
@@ -148,8 +151,13 @@ MapFont (font_name, troff_name)
printf ("%s -> %s\n", names[0], troff_name);
- (void) unlink (troff_name);
- out = fopen (troff_name, "w");
+ { /* Avoid race while opening file */
+ int fd;
+ (void) unlink (troff_name);
+ fd = open (troff_name, O_WRONLY | O_CREAT | O_EXCL, 0600);
+ out = fdopen (fd, "w");
+ }
+
if (!out) {
perror (troff_name);
return 0;
OpenPOWER on IntegriCloud