URI: 
       tTweak grap to make it compile silently. - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 1e1cea296a776857a4c4a0180d3fa35a11e8c78e
   DIR parent 75347226678394e8316d3e38ea64f44524e4f089
  HTML Author: wkj <devnull@localhost>
       Date:   Mon, 17 May 2004 02:22:23 +0000
       
       Tweak grap to make it compile silently.
       
       Diffstat:
         M src/cmd/grap/grap.h                 |       3 +++
         M src/cmd/grap/input.c                |       2 +-
         M src/cmd/grap/main.c                 |      11 ++++++-----
         M src/cmd/grap/print.c                |       2 +-
       
       4 files changed, 11 insertions(+), 7 deletions(-)
       ---
   DIR diff --git a/src/cmd/grap/grap.h b/src/cmd/grap/grap.h
       t@@ -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);
       t@@ -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 *);
   DIR diff --git a/src/cmd/grap/input.c b/src/cmd/grap/input.c
       t@@ -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;
   DIR diff --git a/src/cmd/grap/main.c b/src/cmd/grap/main.c
       t@@ -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 */
       t@@ -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);
       t@@ -90,8 +91,8 @@ main(int argc, char *argv[])
        
        void onintr(int n)
        {
       -        //n;
       -        if (!dbg)
       +        if(n){}
       +        if(!dbg)
                        unlink(tempfile);
                exit(1);
        }
   DIR diff --git a/src/cmd/grap/print.c b/src/cmd/grap/print.c
       t@@ -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);