aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/grap
diff options
context:
space:
mode:
authorwkj <devnull@localhost>2004-05-17 02:22:23 +0000
committerwkj <devnull@localhost>2004-05-17 02:22:23 +0000
commit1e1cea296a776857a4c4a0180d3fa35a11e8c78e (patch)
tree8e66cce26ee7557707a570e93e09ccd269d9a923 /src/cmd/grap
parent75347226678394e8316d3e38ea64f44524e4f089 (diff)
downloadplan9port-1e1cea296a776857a4c4a0180d3fa35a11e8c78e.tar.gz
plan9port-1e1cea296a776857a4c4a0180d3fa35a11e8c78e.tar.bz2
plan9port-1e1cea296a776857a4c4a0180d3fa35a11e8c78e.zip
Tweak grap to make it compile silently.
Diffstat (limited to 'src/cmd/grap')
-rw-r--r--src/cmd/grap/grap.h3
-rw-r--r--src/cmd/grap/input.c2
-rw-r--r--src/cmd/grap/main.c11
-rw-r--r--src/cmd/grap/print.c2
4 files changed, 11 insertions, 7 deletions
diff --git a/src/cmd/grap/grap.h b/src/cmd/grap/grap.h
index da761081..bab62478 100644
--- a/src/cmd/grap/grap.h
+++ b/src/cmd/grap/grap.h
@@ -132,6 +132,8 @@ extern int pointsize, ps_set;
#define min(x,y) (((x) <= (y)) ? (x) : (y))
#define max(x,y) (((x) >= (y)) ? (x) : (y))
+extern char *unsharp(char*);
+
extern void yyerror(char *);
extern void coord_x(Point);
extern void coord_y(Point);
@@ -202,6 +204,7 @@ extern void plot(Attr *, Point);
extern void plotnum(double, char *, Point);
extern void drawdesc(int, Obj *, Attr *, char *);
extern void next(Obj *, Point, Attr *);
+#define print grapprint
extern void print(void);
extern void endstat(void);
extern void graph(char *);
diff --git a/src/cmd/grap/input.c b/src/cmd/grap/input.c
index 0c25bba1..c9c6c016 100644
--- a/src/cmd/grap/input.c
+++ b/src/cmd/grap/input.c
@@ -540,7 +540,7 @@ void copy(void) /* begin input from file, etc. */
FILE *fin;
if (newfile) {
- if ((fin = fopen(newfile, "r")) == NULL)
+ if ((fin = fopen(unsharp(newfile), "r")) == NULL)
ERROR "can't open file %s", newfile FATAL;
curfile++;
curfile->fin = fin;
diff --git a/src/cmd/grap/main.c b/src/cmd/grap/main.c
index 41797562..ea0309d4 100644
--- a/src/cmd/grap/main.c
+++ b/src/cmd/grap/main.c
@@ -7,10 +7,11 @@
#include "grap.h"
#include "y.tab.h"
-extern char *unsharp(char*);
-
int dbg = 0;
+#ifndef GRAPDEFINES
+#define GRAPDEFINES "#9/sys/lib/grap.defines"
+#endif
char *lib_defines;
int lib = 1; /* 1 to include lib_defines */
@@ -40,7 +41,7 @@ main(int argc, char *argv[])
{
extern void onintr(int), fpecatch(int);
- lib_defines = unsharp("#9/lib/grap.defines");
+ lib_defines = unsharp(GRAPDEFINES);
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
signal(SIGINT, onintr);
@@ -90,8 +91,8 @@ main(int argc, char *argv[])
void onintr(int n)
{
- //n;
- if (!dbg)
+ if(n){}
+ if(!dbg)
unlink(tempfile);
exit(1);
}
diff --git a/src/cmd/grap/print.c b/src/cmd/grap/print.c
index 9364d110..1636ec21 100644
--- a/src/cmd/grap/print.c
+++ b/src/cmd/grap/print.c
@@ -184,7 +184,7 @@ void do_first(void) /* done at first .G1: definitions, etc. */
sprintf(buf, "define pid /%d/\n", getpid());
pbstr(buf);
if (lib != 0) {
- if ((fp = fopen(lib_defines, "r")) != NULL) {
+ if ((fp = fopen(unsharp(lib_defines), "r")) != NULL) {
sprintf(buf1, "copy \"%s\"\n", lib_defines);
pbstr(buf1);
fclose(fp);