rename tmpfile to bibtmpfile to avoid apparent name clash on suns
authorGary M. Levin <garrison@ucbvax.Berkeley.EDU>
Fri, 6 Mar 1987 12:21:54 +0000 (04:21 -0800)
committerGary M. Levin <garrison@ucbvax.Berkeley.EDU>
Fri, 6 Mar 1987 12:21:54 +0000 (04:21 -0800)
(mlvdv)

SCCS-vsn: contrib/bib/src/bib.c 2.10
SCCS-vsn: contrib/bib/src/invert.c 2.6

usr/src/contrib/bib/src/bib.c
usr/src/contrib/bib/src/invert.c

index 58b2775..17cd1b1 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)bib.c      2.    %G%";
+static char sccsid[] = "@(#)bib.c      2.10    %G%";
 #endif not lint
 /*
         Bib - bibliographic formatter
 #endif not lint
 /*
         Bib - bibliographic formatter
@@ -41,7 +41,7 @@ static char sccsid[] = "@(#)bib.c     2.9     %G%";
    long int rend = 1;           /* last position in rfd (first char unused)*/
    int numrefs = 0;            /* number of references generated so far */
    FILE *tfd;                   /* output of pass 1 of file(s)           */
    long int rend = 1;           /* last position in rfd (first char unused)*/
    int numrefs = 0;            /* number of references generated so far */
    FILE *tfd;                   /* output of pass 1 of file(s)           */
-   char tmpfile[] = TMPTEXTFILE ; /* output of pass 1                    */
+   char bibtmpfile[] = TMPTEXTFILE ; /* output of pass 1                    */
    char *common = COMFILE;       /* common word file                      */
    int  findex = false;         /* can we read the file INDEX ?          */
 
    char *common = COMFILE;       /* common word file                      */
    int  findex = false;         /* can we read the file INDEX ?          */
 
@@ -74,7 +74,7 @@ main(argc, argv)
 
 #ifndef INCORE
    /* open temporaries, reffile will contain references collected in
 
 #ifndef INCORE
    /* open temporaries, reffile will contain references collected in
-      pass 1, and tmpfile will contain text.
+      pass 1, and bibtmpfile will contain text.
    */
    mktemp(reffile);
    rfd = fopen(reffile,"w+");
    */
    mktemp(reffile);
    rfd = fopen(reffile,"w+");
@@ -82,10 +82,10 @@ main(argc, argv)
       error("can't open temporary reference file, %s", reffile);
    putc('x', rfd);      /* put garbage in first position (not used) */
 #endif not INCORE
       error("can't open temporary reference file, %s", reffile);
    putc('x', rfd);      /* put garbage in first position (not used) */
 #endif not INCORE
-   mktemp(tmpfile);
-   tfd = fopen(tmpfile,"w");
+   mktemp(bibtmpfile);
+   tfd = fopen(bibtmpfile,"w");
    if (tfd == NULL)
    if (tfd == NULL)
-      error("can't open temporary output file, %s", tmpfile);
+      error("can't open temporary output file, %s", bibtmpfile);
 
     /*
        pass1 - read files, looking for citations
 
     /*
        pass1 - read files, looking for citations
@@ -111,9 +111,9 @@ main(argc, argv)
    */
 
    fclose(tfd);
    */
 
    fclose(tfd);
-   tfd = fopen(tmpfile,"r");
+   tfd = fopen(bibtmpfile,"r");
    if (tfd == NULL)
    if (tfd == NULL)
-      error("can't open temporary output file %s for reading", tmpfile);
+      error("can't open temporary output file %s for reading", bibtmpfile);
    /*
    pass 2 - reread files, replacing references
    */
    /*
    pass 2 - reread files, replacing references
    */
@@ -134,7 +134,7 @@ cleanup(val)
    unlink(reffile);
 #endif INCORE
 #ifndef DEBUG
    unlink(reffile);
 #endif INCORE
 #ifndef DEBUG
-   unlink(tmpfile);
+   unlink(bibtmpfile);
 #endif DEBUG
    exit(val);
 }
 #endif DEBUG
    exit(val);
 }
index 511d04f..8b7295c 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)invert.c   2.5     %G%";
+static char sccsid[] = "@(#)invert.c   2.6     %G%";
 #endif not lint
 #
 /*  input:  records of lines, separated by blank lines
 #endif not lint
 #
 /*  input:  records of lines, separated by blank lines
@@ -21,7 +21,7 @@ char    *common =           /*  name of file of common words            */
 char    *INDEX=             /*  name of output file                     */
             INDXFILE;
 
 char    *INDEX=             /*  name of output file                     */
             INDXFILE;
 
-char    *tmpfile =          /*  name of temporary file                  */
+char    *bibtmpfile =          /*  name of temporary file                  */
             INVTEMPFILE;
 
 int    silent = 0;         /*  0 => statistics printed                 */
             INVTEMPFILE;
 
 int    silent = 0;         /*  0 => statistics printed                 */
@@ -54,8 +54,8 @@ char **arglist;
 
     argc= argcount-1;
     argv= arglist+1;
 
     argc= argcount-1;
     argv= arglist+1;
-    mktemp(tmpfile);
-    output= fopen(tmpfile,"w");
+    mktemp(bibtmpfile);
+    output= fopen(bibtmpfile,"w");
 
     for ( flags() ; argc>0 ; argc--, argv++ ,flags() )
     {   /* open input file              */
 
     for ( flags() ; argc>0 ; argc--, argv++ ,flags() )
     {   /* open input file              */
@@ -90,10 +90,10 @@ char **arglist;
     }
     fclose(output);
 
     }
     fclose(output);
 
-    sprintf(sortcmd, sort_it, tmpfile, tmpfile);
+    sprintf(sortcmd, sort_it, bibtmpfile, bibtmpfile);
     system(sortcmd);
 
     system(sortcmd);
 
-    distinct = shorten(tmpfile,INDEX);
+    distinct = shorten(bibtmpfile,INDEX);
     if( silent == 0 )
        fprintf(stderr,
            "%d documents   %d distinct keys  %d key occurrences\n",
     if( silent == 0 )
        fprintf(stderr,
            "%d documents   %d distinct keys  %d key occurrences\n",