From 1e1cea296a776857a4c4a0180d3fa35a11e8c78e Mon Sep 17 00:00:00 2001 From: wkj Date: Mon, 17 May 2004 02:22:23 +0000 Subject: Tweak grap to make it compile silently. --- src/cmd/grap/grap.h | 3 +++ src/cmd/grap/input.c | 2 +- src/cmd/grap/main.c | 11 ++++++----- src/cmd/grap/print.c | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'src/cmd') 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); -- cgit v1.2.3