summaryrefslogtreecommitdiffstats
path: root/contrib/groff/pic
diff options
context:
space:
mode:
authorasmodai <asmodai@FreeBSD.org>2000-01-12 09:51:43 +0000
committerasmodai <asmodai@FreeBSD.org>2000-01-12 09:51:43 +0000
commita7003a9d6efc5e7d660d2ae2f750c82588dc0934 (patch)
tree8690d3aaa0a5083e22e5b57e5ace6ad851479865 /contrib/groff/pic
parent4b4a2e733a2332d82db33d43f90c3e14fb0ff31e (diff)
parent2e2c9047c3a8b5b6fdcdcd4585d5b114f31cd386 (diff)
downloadFreeBSD-src-a7003a9d6efc5e7d660d2ae2f750c82588dc0934.zip
FreeBSD-src-a7003a9d6efc5e7d660d2ae2f750c82588dc0934.tar.gz
This commit was generated by cvs2svn to compensate for changes in r55839,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/groff/pic')
-rw-r--r--contrib/groff/pic/main.cc7
-rw-r--r--contrib/groff/pic/pic.h2
-rw-r--r--contrib/groff/pic/pic.man20
-rw-r--r--contrib/groff/pic/pic.y9
-rw-r--r--contrib/groff/pic/tex.cc3
-rw-r--r--contrib/groff/pic/troff.cc2
6 files changed, 30 insertions, 13 deletions
diff --git a/contrib/groff/pic/main.cc b/contrib/groff/pic/main.cc
index 87beb5d..cb4444f 100644
--- a/contrib/groff/pic/main.cc
+++ b/contrib/groff/pic/main.cc
@@ -29,7 +29,7 @@ int zero_length_line_flag = 0;
// Non-zero means we're using a groff driver.
int driver_extension_flag = 1;
int compatible_flag = 0;
-int safer_flag = 0;
+int safer_flag = 1;
int command_char = '.'; // the character that introduces lines
// that should be passed through tranparently
static int lf_flag = 1; // non-zero if we should attempt to understand
@@ -518,7 +518,7 @@ int main(int argc, char **argv)
int whole_file_flag = 0;
int fig_flag = 0;
#endif
- while ((opt = getopt(argc, argv, "T:CDStcvnxzpf")) != EOF)
+ while ((opt = getopt(argc, argv, "T:CDSUtcvnxzpf")) != EOF)
switch (opt) {
case 'C':
compatible_flag = 1;
@@ -529,6 +529,9 @@ int main(int argc, char **argv)
case 'S':
safer_flag = 1;
break;
+ case 'U':
+ safer_flag = 0;
+ break;
case 'f':
#ifdef FIG_SUPPORT
whole_file_flag++;
diff --git a/contrib/groff/pic/pic.h b/contrib/groff/pic/pic.h
index 70e9567..77e59c7 100644
--- a/contrib/groff/pic/pic.h
+++ b/contrib/groff/pic/pic.h
@@ -24,9 +24,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdlib.h>
#include <errno.h>
+#ifndef MATH_H_DECLARES_HYPOT
extern "C" {
double hypot(double, double);
}
+#endif
#include "assert.h"
#include "cset.h"
diff --git a/contrib/groff/pic/pic.man b/contrib/groff/pic/pic.man
index 5e2d142..70ab946 100644
--- a/contrib/groff/pic/pic.man
+++ b/contrib/groff/pic/pic.man
@@ -1,5 +1,5 @@
.ig \"-*- nroff -*-
-Copyright (C) 1989-1995 Free Software Foundation, Inc.
+Copyright (C) 1989-1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -35,7 +35,7 @@ the original English.
.SH SYNOPSIS
.B @g@pic
[
-.B \-nvC
+.B \-nvCSU
]
[
.I filename
@@ -45,7 +45,7 @@ the original English.
.B @g@pic
.B \-t
[
-.B \-cvzC
+.B \-cvzCSU
]
[
.I filename
@@ -104,6 +104,11 @@ Safer mode; do not execute
.B sh
commands.
This can be useful when operating on untrustworthy input.
+(enabled by default)
+.TP
+.B \-U
+Unsafe mode; revert the default option
+.BR \-S .
.TP
.B \-n
Don't use the groff extensions to the troff drawing commands.
@@ -734,10 +739,11 @@ macros.
.br
Tpic: Pic for \*(tx
.br
-AT&T Bell Laboratories, Computing Science Technical Report No.\ 116,
-PIC \(em A Graphics Language for Typesetting.
-(This can be obtained by sending a mail message to netlib@research.att.com
-with a body of `send\ 116\ from\ research/cstr'.)
+Brian W. Kernighan,
+PIC \(em A Graphics Language for Typesetting (User Manual).
+AT&T Bell Laboratories, Computing Science Technical Report No.\ 116
+<URL:http://cm.bell-labs.com/cm/cs/cstr/116.ps.gz>
+(revised May, 1991).
.SH BUGS
.LP
Input characters that are illegal for
diff --git a/contrib/groff/pic/pic.y b/contrib/groff/pic/pic.y
index 6c7f4ae..46f1a8d 100644
--- a/contrib/groff/pic/pic.y
+++ b/contrib/groff/pic/pic.y
@@ -30,11 +30,14 @@ extern void do_for(char *var, double from, double to,
int by_is_multiplicative, double by, char *body);
extern void do_lookahead();
-#undef fmod
-#undef rand
-
+#ifndef HAVE_FMOD
extern "C" {
double fmod(double, double);
+}
+#endif
+
+#undef rand
+extern "C" {
int rand();
}
diff --git a/contrib/groff/pic/tex.cc b/contrib/groff/pic/tex.cc
index 5310782..2a91b62 100644
--- a/contrib/groff/pic/tex.cc
+++ b/contrib/groff/pic/tex.cc
@@ -237,7 +237,8 @@ void tex_output::solid_arc(const position &cent, double rad,
milliinches(rad/scale),
milliinches(rad/scale),
-end_angle,
- (-end_angle > -start_angle) ? M_PI * 2 - start_angle : -start_angle);
+ (-end_angle > -start_angle) ? (double)M_PI * 2 - start_angle
+ : -start_angle);
}
void tex_output::arc(const position &start, const position &cent,
diff --git a/contrib/groff/pic/troff.cc b/contrib/groff/pic/troff.cc
index 71444cd..1656854 100644
--- a/contrib/groff/pic/troff.cc
+++ b/contrib/groff/pic/troff.cc
@@ -272,6 +272,7 @@ void troff_output::start_picture(double sc,
printf(" %s\n", args);
else
putchar('\n');
+ printf(".if '\\*(.T'html' \\X(graphic-start(\n");
printf(".\\\" %g %g %g %g\n", ll.x, ll.y, ur.x, ur.y);
printf(".\\\" %.3fi %.3fi %.3fi %.3fi\n", 0.0, height, width, 0.0);
printf(".nr " FILL_REG " \\n(.u\n.nf\n");
@@ -290,6 +291,7 @@ void troff_output::finish_picture()
printf(".if \\n(" FILL_REG " .fi\n");
printf(".br\n");
printf(".nr " EQN_NO_EXTRA_SPACE_REG " 0\n");
+ printf(".if '\\*(.T'html' \\X(graphic-end(\n");
// this is a little gross
set_location(current_filename, current_lineno);
fputs(flyback_flag ? ".PF\n" : ".PE\n", stdout);
OpenPOWER on IntegriCloud