BSD 4_1_snap release
[unix-history] / usr / src / cmd / pi / nl.c
index 726c9da..10546f1 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)nl.c 1.2 10/2/80";
+static char sccsid[] = "@(#)nl.c 1.5 6/1/81";
 
 #include "whoami.h"
 #include "0.h"
 
 #include "whoami.h"
 #include "0.h"
@@ -214,7 +214,7 @@ int in_fops[] =
 int in_pops[] =
     {
        O_DATE|NSTAND,
 int in_pops[] =
     {
        O_DATE|NSTAND,
-       O_DISPOSE,
+       O_DISPOSE|NSTAND,
        O_FLUSH|NSTAND,
        O_GET,
        0,
        O_FLUSH|NSTAND,
        O_GET,
        0,
@@ -336,6 +336,10 @@ initnl()
                input = hdefnl ( *cp++ , VAR , np , 0 );
                output = hdefnl ( *cp++ , VAR , np , 0 );
 #      endif
                input = hdefnl ( *cp++ , VAR , np , 0 );
                output = hdefnl ( *cp++ , VAR , np , 0 );
 #      endif
+#      ifdef PC
+           input -> extra_flags |= NGLOBAL;
+           output -> extra_flags |= NGLOBAL;
+#      endif PC
 
        /*
         *      built in constants
 
        /*
         *      built in constants
@@ -616,6 +620,21 @@ casedef:
                                printf("\tVTOREC=[%d]", nloff(p->ptr[NL_VTOREC]));
                                break;
                }
                                printf("\tVTOREC=[%d]", nloff(p->ptr[NL_VTOREC]));
                                break;
                }
+#              ifdef PC
+                   if ( p -> extra_flags != 0 ) {
+                       pchr( '\t' );
+                       if ( p -> extra_flags & NEXTERN )
+                           printf( "NEXTERN " );
+                       if ( p -> extra_flags & NLOCAL )
+                           printf( "NLOCAL " );
+                       if ( p -> extra_flags & NPARAM )
+                           printf( "NPARAM " );
+                       if ( p -> extra_flags & NGLOBAL )
+                           printf( "NGLOBAL " );
+                       if ( p -> extra_flags & NREGVAR )
+                           printf( "NREGVAR " );
+                   }
+#              endif PC
 #              ifdef PTREE
                    pchr( '\t' );
                    pPrintPointer( stdout , "%s" , p -> inTree );
 #              ifdef PTREE
                    pchr( '\t' );
                    pPrintPointer( stdout , "%s" , p -> inTree );
@@ -680,11 +699,11 @@ defnl(sym, cls, typ, val)
        if (nlp >= nlact->nls_high) {
                i = NLINC;
                cp = malloc(NLINC * sizeof *nlp);
        if (nlp >= nlact->nls_high) {
                i = NLINC;
                cp = malloc(NLINC * sizeof *nlp);
-               if (cp == -1) {
+               if (cp == 0) {
                        i = NLINC / 2;
                        cp = malloc((NLINC / 2) * sizeof *nlp);
                }
                        i = NLINC / 2;
                        cp = malloc((NLINC / 2) * sizeof *nlp);
                }
-               if (cp == -1) {
+               if (cp == 0) {
                        error("Ran out of memory (defnl)");
                        pexit(DIED);
                }
                        error("Ran out of memory (defnl)");
                        pexit(DIED);
                }