BSD 4_2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Sun, 25 Sep 1983 11:05:54 +0000 (03:05 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Sun, 25 Sep 1983 11:05:54 +0000 (03:05 -0800)
Work on file usr/src/ucb/pascal/pc0/makefile
Work on file usr/src/ucb/pascal/pi/makefile
Work on file usr/src/ucb/sendbug/Makefile
Work on file usr/src/ucb/sysline/sysline.c
Work on file usr/src/ucb/vlp/vlpmacs
Work on file usr/src/usr.bin/efl/Makefile
Work on file usr/src/usr.bin/f77/src/f77pass1/stab.c
Work on file usr/src/usr.bin/lint/llib-lc
Work on file usr/src/usr.lib/libplot/t300/Makefile
Work on file usr/src/usr.lib/libplot/Makefile
Work on file usr/src/usr.lib/libplot/t300s/Makefile
Work on file usr/src/usr.lib/libplot/t4014/Makefile
Work on file usr/src/usr.lib/libplot/t450/Makefile
Work on file usr/src/usr.lib/lpr/lp.local.h

Synthesized-from: CSRG/cd1/4.2

14 files changed:
usr/src/ucb/pascal/pc0/makefile [new symlink]
usr/src/ucb/pascal/pi/makefile [new symlink]
usr/src/ucb/sendbug/Makefile [new file with mode: 0644]
usr/src/ucb/sysline/sysline.c [new file with mode: 0644]
usr/src/ucb/vlp/vlpmacs [new file with mode: 0644]
usr/src/usr.bin/efl/Makefile [new file with mode: 0644]
usr/src/usr.bin/f77/src/f77pass1/stab.c [new file with mode: 0644]
usr/src/usr.bin/lint/llib-lc [new file with mode: 0644]
usr/src/usr.lib/libplot/Makefile [new file with mode: 0644]
usr/src/usr.lib/libplot/t300/Makefile [new file with mode: 0644]
usr/src/usr.lib/libplot/t300s/Makefile [new file with mode: 0644]
usr/src/usr.lib/libplot/t4014/Makefile [new file with mode: 0644]
usr/src/usr.lib/libplot/t450/Makefile [new file with mode: 0644]
usr/src/usr.lib/lpr/lp.local.h [new file with mode: 0644]

diff --git a/usr/src/ucb/pascal/pc0/makefile b/usr/src/ucb/pascal/pc0/makefile
new file mode 120000 (symlink)
index 0000000..3d35a53
--- /dev/null
@@ -0,0 +1 @@
+../src/pcmakefile
\ No newline at end of file
diff --git a/usr/src/ucb/pascal/pi/makefile b/usr/src/ucb/pascal/pi/makefile
new file mode 120000 (symlink)
index 0000000..7addeb9
--- /dev/null
@@ -0,0 +1 @@
+../src/pimakefile
\ No newline at end of file
diff --git a/usr/src/ucb/sendbug/Makefile b/usr/src/ucb/sendbug/Makefile
new file mode 100644 (file)
index 0000000..b42a28f
--- /dev/null
@@ -0,0 +1,16 @@
+#      Makefile        4.2     83/08/23
+#
+# Bug report processor and associated programs
+#
+
+CFLAGS = -O -DUNIXCOMP
+LIBDIR=        /usr/lib
+DESTDIR=
+
+bugfiler: bugfiler.c
+       ${CC} ${CFLAGS} -o bugfiler bugfiler.c
+
+install: bugfiler sendbug.sh bugformat
+       install -s bugfiler ${DESTDIR}${LIBDIR}/bugfiler
+       install -c sendbug.sh ${DESTDIR}/usr/ucb/sendbug
+       install -c -m 644 bugformat ${DESTDIR}/usr/ucb/bugformat
diff --git a/usr/src/ucb/sysline/sysline.c b/usr/src/ucb/sysline/sysline.c
new file mode 100644 (file)
index 0000000..f4ae572
--- /dev/null
@@ -0,0 +1,1298 @@
+static char rcsid[] = "$Header: sysline.c,v 1.4 83/07/31 23:47:49 layer Exp $";
+
+/*
+ * sysline - system status display on 25th line of terminal
+ * j.k.foderaro
+ *
+ * Prints a variety of information on the special status line of terminals
+ * that have a status display capability.  Cursor motions, status commands,
+ * etc. are gleamed from /etc/termcap.
+ * By default, all information is printed, and flags are given on the command
+ * line to disable the printing of information.  The information and
+ * disabling flags are:
+ *
+ *  flag       what
+ *  -----      ----
+ *             time of day
+ *             load average and change in load average in the last 5 mins
+ *             number of user logged on
+ *   -p                # of processes the users owns which are runnable and the
+ *               number which are suspended.  Processes whose parent is 1
+ *               are not counted.
+ *   -l                users who've logged on and off.
+ *   -m                summarize new mail which has arrived
+ * 
+ *  <other flags>
+ *   -r                use non reverse video
+ *   -c                turn off 25th line for 5 seconds before redisplaying.
+ *   -b                beep once one the half hour, twice on the hour
+ *   +N                refresh display every N seconds.
+ *   -i                print pid first thing
+ *   -e                do simple print designed for an emacs buffer line
+ *   -h                print hostname between time and load average
+ *   -D                print day/date before time of day
+ *   -d                debug mode - print status line data in human readable format
+ *   -q                quiet mode - don't output diagnostic messages
+ *   -s                print Short (left-justified) line if escapes not allowed
+ *   -j                Print left Justified line regardless
+ *
+ */
+
+/* for 4.2 BSD */
+#define BSD4_2
+
+#define NETPREFIX "ucb"
+
+/* turn this on always */
+#define WHO
+
+/* turn this on if you are on running 4.1a or greater (i.e. a system
+   with the gethostname() function */
+#define HOSTNAME
+#define RWHO
+
+/* turn this on if you are running on vmunix */
+#define VMUNIX
+
+/* turn this on if you are running on 4.1c or greater */
+#define NEW_BOOTTIME 
+
+#include <sys/param.h>
+#include <signal.h>
+#include <stdio.h>
+#include <utmp.h>
+#include <ctype.h>
+#ifndef BSD4_2
+#include <unctrl.h>
+#endif
+#include <sys/time.h>
+#include <sys/stat.h>
+#ifdef VMUNIX
+#include <nlist.h>
+#include <sys/vtimes.h>
+#include <sys/proc.h>
+#endif
+#ifdef pdp11
+#include <a.out.h>
+#include <sys/proc.h>
+#define strcmpn strncmp
+#endif
+#include <curses.h>
+#undef nl
+#ifdef TERMINFO
+#include <term.h>
+#endif
+
+#ifdef RWHO
+#define        DOWN_THRESHOLD  (2 * 60)
+#define        RWHOLEADER      "/usr/spool/rwho/whod."
+#define        MAXFILENAME     128
+
+struct whod {
+    char       wd_vers;
+    char       wd_type;
+    char       wd_fill[2];
+    int                wd_sendtime;
+    int                wd_recvtime;
+    char       wd_hostname[32];
+    int                wd_loadav[3];
+    int                wd_boottime;
+};
+
+struct outmp {
+    char       out_line[8];    /* tty name */
+    char       out_name[8];    /* user id */
+    long       out_time;       /* time on */
+};
+#endif RWHO
+
+#ifdef VMUNIX
+#define MAXUSERS 100
+#else
+#define MAXUSERS 40
+#endif
+#define DEFDELAY 60    /* update status once per minute */
+#define MAILDIR "/usr/spool/mail"
+
+/* if MaxLoad is defined, then if the load average exceeded MaxLoad
+ * then the process table will not be scanned and the log in/out data
+ * will not be checked.   The purpose of this is to reduced the load
+ * on the system when it is loaded.
+ */
+#define MaxLoad 6.0
+
+
+struct nlist nl[] =
+#ifdef NEW_BOOTTIME
+  { { "_boottime" },   /* After 4.1a the label changed to "boottime" */
+#else
+  { { "_bootime" },    /* Under 4.1a and earlier it is "bootime" */
+#endif
+#define        NL_BOOT 0
+    { "_proc" },
+#define NL_PROC 1
+    { "_avenrun" },
+#define NL_AVEN 2
+#ifdef VMUNIX
+    { "_nproc" },
+#define NL_NPROC 3
+#endif
+    { 0 }};
+
+struct proc *pr;
+int nproc;
+int procadr;
+
+double avenrun[3];     /* used for storing load averages */
+
+int kmem;              /* file pointers for memory */
+int ut;
+int users, nentries;
+
+#ifdef WHO
+char whofilename[100];
+#endif
+
+#ifdef RWHO
+char *remotehost[10];
+int nremotes = 0;
+#endif RWHO
+
+#ifdef HOSTNAME
+char hostname[32];
+#endif
+
+char lockfilename[100];        /* if exists, will prevent us from running */
+
+/* flags which determine which info is printed */
+int mailcheck = 1;     /* m - do biff like checking of mail    */
+int proccheck = 1;     /* p - give information on processes    */
+int logcheck  = 1;     /* l - tell who logs in and out         */
+int hostprint = 0;     /* h - print out hostname               */
+int dateprint = 0;     /* h - print out day/date               */
+int quiet     = 0;     /* q - hush diagnostic messages         */
+
+/* flags which determine how things are printed */
+int clr_bet_ref = 0;   /* c - clear line between refeshes      */
+int reverse     = 1;   /* r - use reverse video                */
+int shortline   = 0;   /* s - short (left-justified) if escapes not allowed */
+int leftline    = 0;   /* j - left-justified even if escapes allowed */
+int sawmail;   /* remember mail was seen to print bells        */
+
+/* flags which have terminal do random things  */
+int beep      = 0;     /* b - beep every half hour and twice every hour */
+int synch     = 1;     /* synchronize with clock               */
+int printid   = 0;     /* print pid of this process at startup */
+
+/*
+ * used to turn off reverse video every REVOFF times
+ * in an attempt to not wear out the phospher.
+ */
+#define REVOFF 5
+int revtime = 1;
+
+/* select output device (status display or straight output (emacs window)) */
+int emacs = 0;         /* assume status display */
+int dbug = 0;
+
+/* used by mail checker */
+off_t mailsize = 0;
+off_t linebeg = 0;             /* place where we last left off reading */
+
+/* globals */
+int mailprocessed;
+char *username;
+struct stat stbuf, mstbuf;     /* mstbuf for mail check only */
+char *ourtty,*ttyname();       /* keep track of what tty we're on */
+char *getenv();
+char *tparm(), *tgoto();
+unsigned delay = DEFDELAY;
+int chars;
+short uid;
+double loadavg = 0.0;          /* current load average */
+int fullprocess;
+int users = 0;
+
+/* strings which control status line display */
+#ifdef TERMINFO
+
+char   *rev_out, *rev_end, *arrows;
+
+#else  /* TERMCAP */
+
+char   to_status_line[64];
+char   from_status_line[64];
+char   dis_status_line[64];
+char   rev_out[20], rev_end[20];
+char   *arrows, *bell = "\007";
+int    eslok;  /* escapes on status line okay (reverse, cursor addressing) */
+int    columns;
+#endif
+
+/* 
+ * In order to determine how many people are logged on and who has
+ * logged in or out, we read in the /etc/utmp file. We also keep track of 
+ * the previous utmp file.
+ */
+struct utmp uts[2][MAXUSERS];
+
+outc(c)
+char c;
+{
+       if (dbug)
+               printf("%s", unctrl(c));
+       else putchar(c);
+}
+
+erroutc(c)
+char c;
+{
+       if (dbug)
+               fprintf(stderr,"%s", unctrl(c));
+       else fputc(c,stderr);
+}
+
+main(argc,argv)
+char **argv;
+{
+    register new,old,tmp;
+    int clearbotl();
+    char *cp;
+    extern char _sobuf[];
+
+
+    setbuf(stdout, _sobuf);
+    signal(SIGINT,SIG_IGN);
+    signal(SIGQUIT,SIG_IGN);
+    signal(SIGALRM,SIG_IGN);
+#ifdef VMUNIX
+    signal(SIGTTOU,SIG_IGN);
+#endif
+    /*
+     * When we logoff, init will do a "vhangup()" on this
+     * tty which turns off I/O access and sends a SIGHUP
+     * signal.  We catch this and thereby clear the status
+     * display.  Note that a bug in 4.1bsd caused the SIGHUP
+     * signal to be sent to the wrong process, so you had to
+     * `kill -HUP' yourself in your .logout file.
+     */
+    signal(SIGHUP,clearbotl);
+
+#ifdef HOSTNAME
+    gethostname(hostname,sizeof(hostname));
+#endif
+
+    argv++;
+    while(--argc > 0) {
+       switch(argv[0][0]) {
+           case '-': for(cp = &argv[0][1]; *cp ; cp++)
+                     { 
+                       switch(*cp) {
+                       case 'r' : reverse = 0; /* turn off reverse video */
+                                  break;
+                       case 'c':  clr_bet_ref = 1;
+                                  break;
+                       case 'h':  hostprint = 1;
+                                  break;
+                       case 'D':  dateprint = 1;
+                                  break;
+#ifdef RWHO
+                       case 'H':  if(!strcmp(hostname,argv[1]) ||
+                                     !strcmp(&hostname[strlen(NETPREFIX)]
+                                               ,argv[1]))
+                                  {
+                                          argv++, argc--;
+                                          break;
+                                  }
+                                  remotehost[nremotes++] = argv[1];
+                                  argv++, argc--;
+                                  break;
+#endif RWHO
+                       case 'm':  mailcheck = 0;
+                                  break;
+                       case 'p':  proccheck = 0;
+                                  break;
+                       case 'l':  logcheck = 0;
+                                  break;
+                       case 'b':  beep = 1;    
+                                  break;
+                       case 'i':  printid = 1;
+                                  break;
+                       case 'e':  emacs = 1;
+                                  break;
+                       case 'd':  dbug = 1;
+                                  signal(SIGINT, SIG_DFL);
+                                  signal(SIGQUIT, SIG_DFL);
+                                  break;
+                       case 'q':  quiet = 1;
+                                  break;
+                       case 's':  shortline = 1;
+                                  break;
+                       case 'j':  leftline = 1;
+                                  break;
+                       default:   fprintf(stderr,
+                                       "sysline: bad flag: %c\n",*cp);
+                       }
+                     }
+                     break;
+           case '+': delay = atoi(&argv[0][1]);
+                     if((delay <= 10) || (delay > 500)) delay = DEFDELAY;
+                     synch = 0;        /* no more sync */
+                     break;
+           default:  fprintf(stderr,"sysline: illegal argument %s\n",argv[0]);
+       }
+       argv++;
+    }
+    if(emacs) {
+       columns = 80;
+    } else {
+       /* if not to emacs window, initialize terminal dependent info */
+       initterm();
+    }
+    
+    /* immediately fork and let the parent die if not emacs mode */
+    if(!emacs && !dbug && fork()) exit(0); 
+    uid = getuid();
+
+    ourtty = ttyname(2);       /* remember what tty we are on */
+    if(printid) { printf("%d\n",getpid()); fflush(stdout);}
+    close(1);
+    dup2(2, 1);
+
+    strcpy(whofilename,getenv("HOME"));
+    strcat(whofilename,"/.who");
+
+    strcpy(lockfilename,getenv("HOME"));
+    strcat(lockfilename,"/.syslinelock");
+    
+    if((ut = open("/etc/utmp",0)) < 0)
+    {
+       fprintf(stderr,"Can't open utmp");
+       exit(1);
+    }
+
+    if((kmem = open("/dev/kmem",0)) < 0)
+    {
+       fprintf(stderr,"Can't open kmem");
+       exit(1);
+    }
+
+    /* read in namelist in order to get location of symbols */
+    readnamelist();
+
+    if(proccheck) initprocread();
+
+    if(mailcheck) 
+    {
+       chdir(MAILDIR);
+       username = getenv("USER");
+       if(stat(username,&mstbuf) != -1)
+       {
+               mailsize = mstbuf.st_size;
+       }
+       else mailsize = 0;
+    }
+
+    old = 0;
+    new = 1;
+
+    while(emacs || isloggedin())
+    {
+       if(access(lockfilename,0))
+       {
+           mailprocessed = 0;
+           prtinfo(old,new);
+           sleep(delay);
+           if(clr_bet_ref)
+           {
+               tputs(dis_status_line, 1, outc);
+               fflush(stdout);
+               sleep(5);
+           }
+           revtime = (1 + revtime) % REVOFF;
+
+           /*
+            * if we have processed mail, then dont switch utmp pointers
+            * since we havent printed the people whove logged in and out
+            */
+           if(!mailprocessed || !fullprocess)
+           {
+               tmp = old;
+               old = new;
+               new = tmp;
+           }
+       } else sleep(60);
+    }
+    clearbotl();
+    /* NOTREACHED */
+}
+
+isloggedin()
+{
+   /*
+    * you can tell if a person has logged out if the owner of
+    * the tty has changed
+    */
+    struct stat statbuf;
+    if(fstat(2,&statbuf) == 0)
+    {
+       if(statbuf.st_uid == uid) return(1);
+    }
+    return(0); /* not logged in */
+}
+
+
+readnamelist()
+{
+       time_t bootime, clock, nintv, time();
+
+#ifdef pdp11
+       nlist("/unix",nl);
+#else
+       nlist("/vmunix",nl);
+#endif
+       if(nl[0].n_value == 0) {
+           if (!quiet)
+               fprintf(stderr, "No namelist\n");
+           return;
+       }
+       lseek(kmem, (long)nl[NL_BOOT].n_value, 0);
+       read(kmem, &bootime, sizeof(bootime));
+       (void) time(&clock);
+       nintv = clock - bootime;
+       if (nintv <= 0L || nintv > 60L*60L*24L*365L) {
+          if (!quiet)
+               fprintf(stderr, "Time makes no sense... namelist must be wrong\n");
+          nl[NL_PROC].n_value = nl[NL_AVEN].n_value = 0;
+       }
+}
+
+readutmp(n)
+{
+       lseek(ut,0L,0);
+       nentries = read(ut,&uts[n][0],MAXUSERS*sizeof(struct utmp)) 
+                  / sizeof(struct utmp);
+}
+
+/* 
+ * read in the process table locations and sizes, and allocate space
+ * for storing the process table.  This is done only once.
+ */
+initprocread()
+{
+       if (nl[NL_PROC].n_value == 0) return;
+#ifdef VMUNIX
+       lseek(kmem,(long)nl[NL_PROC].n_value,0);
+       read(kmem,&procadr,sizeof(procadr));
+       lseek(kmem,(long)nl[NL_NPROC].n_value,0);
+       read(kmem,&nproc,sizeof(nproc));
+#endif
+#ifdef pdp11
+       procadr = nl[NL_PROC].n_value;
+       nproc = NPROC;  /* from param.h */
+#endif
+       pr = (struct proc *) calloc(nproc,sizeof(struct proc));
+}
+
+/*
+ * read in the process table.  This assumes that initprocread has alread been
+ * called to set up storage.
+ */
+readproctab()
+{
+       if (nl[NL_PROC].n_value == 0) return(0);
+       /* printf("There are %d entries beginning at %x\n",nproc,procadr); */
+       lseek(kmem,(long)procadr,0);
+       read(kmem,pr,nproc * sizeof(struct proc));
+       return(1);
+}
+
+/*
+ * codes to say what has happened to a particular entry in utmp
+ * NOCH means no change, ON means new person logged on,
+ * OFF means person logged off.
+ */
+#define NOCH 0;
+#define ON 0x1
+#define OFF 0x2
+
+prtinfo(old,new)
+int old,new;
+{
+       int procrun,procstop;
+       int on,off;
+       int status[MAXUSERS];
+       register int i;
+       double diff;
+       char *sysrup();
+
+       stringinit();
+
+#ifdef WHO
+       /* check for file named .who in the home directory */
+       whocheck();
+#endif
+
+       timeprint();
+
+       /*
+        * if mail is seen, don't print rest of info, just the mail
+        * reverse new and old so that next time we run, we won't lose log
+        * in and out information
+        */
+       if(mailcheck && (sawmail = mailseen()) )
+       {
+           mailprocessed = 1;
+           goto bottom;
+       }
+
+#ifdef HOSTNAME
+#ifdef RWHO
+       if(remotehost)
+       {
+               for(i=0; i < nremotes; i++)
+                       stringprt(" %s", sysrup(remotehost[i]));
+       }
+#endif
+       /*
+        * print hostname info if requested
+        */
+       if(hostprint)
+       {
+           stringspace();
+           stringcat(hostname,strlen(hostname),1);
+       }
+#endif
+
+       /* 
+        * print load average and difference between current load average
+        * and the load average 5 minutes ago
+        */
+       if (nl[NL_AVEN].n_value != 0) {
+               stringspace();
+#ifdef VMUNIX
+               lseek(kmem,(long)nl[NL_AVEN].n_value,0);
+               read(kmem,avenrun,sizeof(avenrun));
+#endif
+#ifdef pdp11
+               loadav(avenrun);
+#endif
+               stringprt("%.1f ",avenrun[0]);
+               if((diff = avenrun[0] - avenrun[1]) < 0.0)
+                    stringprt("%.1f",diff);
+               else stringprt("+%.1f",diff);
+               loadavg = avenrun[0];   /* remember load average */
+       }
+
+       /*
+        * print log on and off information
+        */
+       stringspace();
+
+       fullprocess = 1;
+       
+#ifdef MaxLoad 
+       if(loadavg > MaxLoad) fullprocess = 0;  /* too loaded to run */
+#endif
+       /* read utmp file (logged in data) only if we are doing a full
+          process or if this is the first time and we are calculating
+          the number of users
+        */
+       if(fullprocess || (users == 0)) readutmp(new);
+
+
+       /* 
+        * make a pass through utmp, checking if person has logged off
+        * or on.  Results are stored in status[]
+        */
+       on = off = 0;
+       /* only do this if it hasn't been done yet (users == 0) or
+        * if the load average is low enough to permit it
+        */
+       if(fullprocess || (users == 0 ))
+       {
+           users = 0;
+           for(i=0 ; i < nentries ; i++)
+           {
+               if(strcmpn(uts[old][i].ut_name,uts[new][i].ut_name,8) != 0)
+               {
+                   if(uts[old][i].ut_name[0] == '\0')
+                   {
+                       status[i] = ON;
+                       on++;
+                   }
+                   else if (uts[new][i].ut_name[0] == '\0')
+                   {
+                       status[i] = OFF;
+                       off++;
+                   }
+                   else {
+                       status[i] = ON | OFF;
+                       on++;
+                       off++;
+                   }
+               }
+               else status[i] = NOCH;
+
+               if(uts[new][i].ut_name[0]) users++;
+           }
+       }
+
+       /* at this point we know how many users there are */
+       stringprt("%du",users);
+
+       /* if there is any unread mail, put out a star */
+       /* fprintf(stderr,"mailsz:%d,mtime:%d,atime:%d\n",
+               mailsize,mstbuf.st_mtime,mstbuf.st_atime); */
+       if((mailsize > 0) && (mstbuf.st_mtime >= mstbuf.st_atime))
+               stringcat("*",1,1);
+
+       /* if the load is too high, then we indicate that with a - sign */
+       if(!fullprocess && (proccheck || logcheck)) stringcat("-",1,1);
+       
+       /* if we are to check on number of process running, do so now */
+       if(fullprocess && proccheck && readproctab())
+       { 
+           /* 
+            * we are only interested in processes which have the same
+            * uid as us, and whose parent process id is not 1.
+            */
+           procrun = procstop = 0;
+           for(i=0; i < nproc ; i++)
+           {
+               if((pr[i].p_stat == 0) || (pr[i].p_pgrp == 0)) continue; 
+               if((pr[i].p_uid == uid) && (pr[i].p_ppid != 1)) 
+               {
+                   /* printf("found pid %d, stat=%o\n", pr[i].p_pid, pr[i].p_stat); */
+                   switch (pr[i].p_stat) {
+
+                   case SSTOP:
+                           procstop++;
+                           break;
+
+                   case SSLEEP:
+                           /*
+                            * sleep can mean waiting for a signal or just
+                            * in a disk or page wait queue ready to run.
+                            * We can tell if it is the later by the pri being
+                            * negative
+                            */
+                           if (pr[i].p_pri < PZERO) procrun++;
+                           break;
+
+                   case SWAIT:
+                   case SRUN:
+                   case SIDL:
+                           procrun++;
+
+                   }
+               }
+           }
+
+           if((procrun > 0) || (procstop > 0))
+           {
+               stringspace();
+               if((procrun > 0) && (procstop > 0)) 
+               {
+                  stringprt("%dr",procrun);
+                  stringprt(" %ds",procstop);
+               }
+               else if(procrun > 0) stringprt("%dr",procrun);
+                    else stringprt("%ds",procstop);
+           }
+       }   
+
+       /* 
+        * if anyone has logged on or off, and we are interested in it,
+        * print it out
+        */
+       if(logcheck && on)
+       {
+           stringspace();
+           stringprt("on:",on);
+           for(i = 0 ; i < nentries ; i++)
+           {
+               if(status[i] & ON)
+               { 
+                   stringprt(" %.8s",uts[new][i].ut_name);
+                   ttyprint(uts[new][i].ut_line);
+               }
+           }
+       }
+
+       /* 
+        * check for people logging off if we are intereste
+        */
+       if(logcheck && off)
+       {
+           stringspace();
+           stringprt("off:",off);
+           for(i = 0 ; i < nentries ; i++)
+           {
+               if(status[i] & OFF)
+               { 
+                   stringprt(" %.8s",uts[old][i].ut_name);
+                   ttyprint(uts[old][i].ut_line);
+               }
+           }
+       }
+bottom:
+       /* dump out what we know */
+       stringdump();
+}
+
+timeprint()
+{
+       long curtime;
+       struct tm *tp, *localtime();
+       static int beepable=0;
+
+       /* always print time */
+       time(&curtime);
+       tp = localtime(&curtime);
+
+       if (dateprint)
+               stringprt("%.11s", ctime(&curtime));
+       stringprt("%d:",(tp->tm_hour > 12 ? tp->tm_hour - 12 
+                                    : (tp->tm_hour == 0 ? 12 : tp->tm_hour)));
+       stringprt("%02d",tp->tm_min);
+
+       if(synch) delay = 60 - tp->tm_sec;      /* sync with clock */
+
+       /* beepable is used to insure that we get at most one set of beeps
+           every half hour */
+       if(beep && beepable && (tp->tm_min == 30)) 
+       {   
+           tputs(bell, 1, outc); fflush(stdout);
+           beepable = 0;
+       }
+       else if(beep && beepable && (tp->tm_min == 00)) 
+       {
+           tputs(bell, 1, outc); fflush(stdout);
+           sleep(2);
+           tputs(bell, 1, outc); fflush(stdout);
+           beepable = 0;
+       }
+       else if(beep && ((tp->tm_min != 00) || (tp->tm_min != 30)))
+           beepable = 1;
+
+}
+
+/*
+ * whocheck -- check for file named .who and print it on the who line first
+ */
+whocheck()
+{
+    register wf,i,chss;
+    char buff[81];
+
+    if((wf = open(whofilename,0)) >= 0)
+    {
+       chss = read(wf,buff,80);
+       if(chss == 0) 
+       {
+           close(wf);
+           return;
+       }
+       buff[chss] = '\0';
+       /* 
+        * remove all line feeds, and replace by spaces if they are within
+        * the message, else replace them by nulls.
+        */
+       for(i = chss; i >= 0; i--)
+       {
+           if(buff[i] == '\n') 
+           {
+               if(buff[i+1]) buff[i] = ' ';
+               else buff[i] = '\0';
+           }
+       }
+       stringprt("%s",buff);
+       stringspace();
+       close(wf);
+    }
+}
+
+/* 
+ * ttyprint -- given the name of a tty, print in the string buffer its
+ * short name surrounded by parenthesis.
+ * ttyxx is printed as (xx)
+ * console is printed as (cty)
+ */
+ttyprint(name)
+char *name;
+{
+    char buff[10];
+
+    if(strcmpn(name,"tty",3)==0)
+    {
+       sprintf(buff,"(%s)",name+3);
+    }
+    else if(strcmp(name,"console")== 0)
+    {
+       sprintf(buff,"(cty)");
+    }
+    else sprintf(buff,"(%s)",name);
+
+    stringcat(buff,strlen(buff),0);
+}
+
+/* 
+ * mail checking function 
+ * returns 0 if no mail seen
+ */
+mailseen()
+{
+    FILE *mfd;
+    int retval = 0;
+    int chs,initchs;
+    register char *rp,*cp;
+    char lbuf[100], sendbuf[100];
+    int toprint,seenspace = 0;
+
+    if(stat(username,&mstbuf) != -1)
+    {
+       if((mstbuf.st_size > mailsize) && ((mfd=fopen(username,"r")) != NULL))
+       {
+           /* fprintf(stderr,"Mail gotten was %db, now %db\n",
+                                mailsize,stbuf.st_size); */
+           fseek(mfd,mailsize,0);
+           while((initchs = readline(mfd, lbuf, sizeof(lbuf))) != EOF)
+           {
+               if(strcmpn(lbuf,"From",4) == 0)
+               {
+                   cp = lbuf+5;        /* start after the From */
+                   while(*cp && (*++cp != ' ')); /* skip to blank */
+                   *cp = '\0';         /* terminate name */
+                   stringspace();
+                   /*  if(!emacs) stringcat(bell,0,0);   BELL MOVED */
+                   sprintf(sendbuf,"Mail from %s ",lbuf+5);
+                   stringcat(sendbuf,strlen(sendbuf),0);
+                   /* print message preceeded by little arrow */
+                   /* skip over the headers and look for blank line */
+                   while(((chs = readline(mfd, lbuf, sizeof(lbuf))) != EOF) && (chs != 0))
+                       if(strcmpn(lbuf,"Subject",7)==0)
+                       {
+                           sprintf(sendbuf,"on %s",lbuf+9);
+                           stringcat(sendbuf,strlen(sendbuf),1);
+                       }
+                   if(!emacs) stringcat(arrows,2,0);
+                   else stringcat(" : ",3,0);
+
+                   if(chs != EOF)
+                   {
+                       cp = sendbuf;
+                       toprint = columns - chars; /* space left on line */
+                       lbuf[0] = '\0';
+                       while((chs = readline(mfd, lbuf, sizeof(lbuf))) != EOF)
+                       {
+                           if(toprint > 0)
+                           {
+                               *cp++ = ' ';    /* space before lines */
+                               toprint--;
+                           }
+                           rp = lbuf;
+                           if(strcmpn(lbuf,"From",4) == 0) break;
+                           while(*rp && (toprint > 0))
+                           {
+                               if(isspace(*rp))
+                               { 
+                                   if(!seenspace)
+                                   {
+                                       *cp++ = ' ';
+                                       seenspace = 1;
+                                       toprint--;
+                                   }
+                               }
+                               else {
+                                   *cp++ = *rp;
+                                   seenspace = 0;
+                                   toprint--;
+                               }
+                               rp++;
+                           }
+                       }
+                       *cp = '\0';
+                       stringcat(sendbuf,strlen(sendbuf),1);
+                       /*  if(!emacs) stringcat(bell,0,0);   BELL MOVED */
+                       retval = 1;
+                   }
+               break;
+               }
+           }
+           if(initchs == EOF) 
+           {
+               stringprt("Mail has just arrived",chs);
+           }
+       /*
+        * want to update write time  so a star will
+        * appear after the number of users until the
+        * user reads his mail 
+        */
+       mailsize = linebeg;     
+       touch(username,mfd);
+       fclose(mfd);
+       }
+       else mailsize = mstbuf.st_size;
+    }
+    else mailsize = 0;
+    return(retval);
+}
+
+/* 
+ * readline -- read a line from fp and store it in buf.
+ * return the number of characters read.
+ */
+readline(fp, buf, maxch)
+FILE *fp;
+char *buf;
+{
+    register char *cp, ch;
+    int size = maxch;
+    long ftell();
+
+    linebeg = ftell(fp);               /* remember loc where line begins */
+    cp = buf;
+    while(((ch=getc(fp)) != EOF) && (ch != '\n') && (size-- > 0)) *cp++ = ch;
+    *cp = '\0';
+    if((size == maxch) && (ch == EOF)) return (EOF);
+    else return(maxch - size);
+}
+    
+
+/* string hacking functions */
+
+int eol;       /* non zero when we have hit the end of line */
+char *sp;
+char strarr[120];
+
+stringinit()
+{
+    sp = strarr;
+    chars = 0;
+    eol = 0;
+}
+
+stringprt(format,value)
+char *format;
+{
+    char tempbuf[150];
+    int bufsiz;
+
+    sprintf(tempbuf,format,value);
+    bufsiz = strlen(tempbuf);
+    stringcat(tempbuf,bufsiz,0);
+}
+
+stringdump()
+{
+    char bigbuf[200];
+    register char *cp;
+    register int i;
+    char blanks[80];
+
+    *sp = '\0';
+    bigbuf[0] = 0;
+    if(!emacs) {
+       if (sawmail) strcat(bigbuf, bell);
+       if (eslok) {
+           if(!leftline)
+               cp = tparm(to_status_line, columns - chars);
+           else 
+               cp = tparm(to_status_line, 0);
+           strcat(bigbuf, cp);
+       } else {
+           strcat(bigbuf, to_status_line);
+           if (!shortline & !leftline) {
+               for (i=0; i < (columns-chars); i++)
+                   blanks[i] = ' ';
+               blanks[columns-chars] = '\0';
+               strcat(bigbuf, blanks);
+           }
+       }
+       if(reverse && !(revtime == 0)) strcat(bigbuf, rev_out);
+    }
+    strcat(bigbuf,strarr);
+    if (!emacs) {
+       if (reverse) strcat(bigbuf, rev_end);
+       strcat(bigbuf, from_status_line);
+       if (sawmail) {
+           strcat(bigbuf, bell);
+           strcat(bigbuf, bell);
+       }
+       tputs(bigbuf, 1, outc);
+       if (dbug) putchar('\n');
+       fflush(stdout);
+    } else
+       write(2,bigbuf,strlen(bigbuf));
+}
+
+stringspace()
+{
+    if(!emacs && reverse && !(revtime == 0)) {
+#ifdef TERMINFO
+       stringcat(rev_end, magic_cookie_glitch<=0?0:magic_cookie_glitch, 0);
+       stringcat(" ",1,0);
+       stringcat(rev_out, magic_cookie_glitch<=0?0:magic_cookie_glitch, 0);
+#else
+       stringcat(rev_end,0,0);
+       stringcat(" ",1,0);
+       stringcat(rev_out,0,0);
+#endif
+    } else stringcat(" ",1,0);
+}
+
+/* 
+ * stringcat :: concatenate the characters in string str to the list we are 
+ *             building to send out.
+ *  
+ * the three args are
+ *    str - the string to print. may contain funny (terminal control) chars.
+ *    chrs - the number of printable characters in the string
+ *    trunc - a flag which is non zero if we should truncate strings which
+ *           don't fit.  If this is 0 then if a string doesn't completely
+ *           fit it wont' be printed, this prevents us from getting 1/2
+ *           way through an escape sequence.
+ */
+stringcat(str,chrs,trunc)
+char *str;
+{
+
+    if((chrs == 0) || (!eol && chars + chrs <= columns)
+                  || (!eol && trunc && (chars < columns)))
+    {
+       while(*sp++ = *str++)
+           if(trunc)
+           {   
+               if(++chars >= columns)  /* check for trunc */
+               {
+                   eol = 1;
+                   return;
+               }
+           }
+       sp--;
+       if(!trunc) chars += chrs;
+    }
+    else eol = 1;
+}
+
+/*
+ * touch :: update the modify time of a file.
+ */
+touch(name,filedes)
+char *name;            /* name of file */
+FILE *filedes;         /* already open for read file descriptor */
+{
+       register fd;
+       char buf[1];
+
+       lseek(fileno(filedes),0L,0);
+       read(fileno(filedes),buf,1);    /* get first byte */
+       if((fd = open(name,2)) >= 0)    /* open in append mode */
+       {
+           lseek(fd,0L,0);             /* go to beginning */
+           write(fd,buf,1);            /* and rewrite first byte */
+           close(fd);
+       }
+}
+
+
+/* 
+ * clearbotl :: clear bottom line.  
+ * called when process quits or is killed.
+ * it clears the bottom line of the terminal.
+ */
+clearbotl()
+{
+       register int fd;
+       int exit();
+
+       signal(SIGALRM,exit);
+       alarm(30);      /* if can't open in 30 secs, just die */
+       if( !emacs && (fd = open(ourtty,1)) >=0)
+       {
+           write(fd,dis_status_line,strlen(dis_status_line));
+           close(fd);
+       }
+       exit(0);
+}
+
+#ifdef TERMINFO
+initterm()
+{
+       static char standbuf[40];
+
+       setupterm(0, 1, 0);
+       if (!has_status_line) {
+               /* not an appropriate terminal */
+               if (!quiet)
+                  fprintf(stderr, "sysline: no status capability for %s\n",
+                       getenv("TERM"));
+               exit(1);
+       }
+       if (status_line_esc_ok) {
+               if (set_attributes) {
+                       /* reverse video mode */
+                       strcpy(standbuf, tparm(set_attributes,0,0,1,0,0,0,0,0,0));
+                       rev_out = standbuf;
+                       rev_end = exit_attribute_mode;
+               } else if (enter_standout_mode && exit_standout_mode) {
+                       rev_out = enter_standout_mode;
+                       rev_end = exit_standout_mode;
+               } else {
+                       rev_out = rev_end = "";
+               }
+       } else
+               rev_out = rev_end = "";
+       columns--;      /* avoid cursor wraparound */
+}
+
+#else  /* TERMCAP */
+
+initterm()
+{
+       char *term, *cp;
+       char tbuf[1024], is2[40];
+       extern char *UP;
+       
+       if ((term=getenv("TERM")) == NULL) {
+               if (!quiet)
+                  fprintf(stderr, "sysline: No TERM variable in enviroment\n");
+               exit(1);
+       }
+       if (tgetent(tbuf, term) <= 0) {
+               if (!quiet)
+                  fprintf(stderr, "sysline: Unknown terminal type: %s\n", term);
+               exit(1);
+       }
+       if (tgetflag("hs") <= 0) {
+               if (!strcmpn(term, "h19", 3)) {
+                       /* for upward compatability with h19sys */
+                       strcpy(to_status_line, "\033j\033x5\033x1\033Y8%+ \033o");
+                       strcpy(from_status_line, "\033k\033y5");
+                       strcpy(dis_status_line, "\033y1");
+                       strcpy(rev_out, "\033p");
+                       strcpy(rev_end, "\033q");
+                       arrows = "\033Fhh\033G";
+                       columns = 80;
+                       UP = "\b";
+                       return;
+               }
+               if (!quiet)
+                  fprintf(stderr, "sysline: No status capability for %s\n", term);
+               exit(1);
+       }
+       cp = is2;
+       if (tgetstr("i2", &cp) != NULL) {
+               /* someday tset will do this */
+               tputs(is2, 1, erroutc);
+               fflush(stdout);
+       }
+
+       /* the "-1" below is to avoid cursor wraparound problems */
+       columns = tgetnum("co") - 1;
+       cp = to_status_line;
+       tgetstr("ts", &cp);
+       cp = from_status_line;
+       tgetstr("fs", &cp);
+       cp = dis_status_line;
+       tgetstr("ds", &cp);
+       eslok = tgetflag("es");
+       if (eslok) {
+               cp = rev_out;
+               tgetstr("so", &cp);
+               cp = rev_end;
+               tgetstr("se", &cp);
+       } else {
+               reverse = 0;    /* turn off reverse video */
+       };
+       UP = "\b";
+       if (!strcmpn(term, "h19", 3))
+               arrows = "\033Fhh\033G";        /* "two tiny graphic arrows" */
+       else
+               arrows = "->";
+}
+
+char *
+tparm(cap, parm)
+char *cap;
+int parm;
+{
+       return tgoto(cap, 0, parm);
+}
+#endif
+
+#ifdef pdp11
+loadav(ap)
+double ap[];
+{
+       register int i;
+       short s_avenrun[3];
+
+       lseek(kmem, (long)nl[NL_AVEN].n_value, 0);
+       read(kmem, s_avenrun, sizeof(s_avenrun));
+       for (i=0; i < (sizeof(s_avenrun)/sizeof(s_avenrun[0])); i++)
+               ap[i] = s_avenrun[i] / 256.0;
+}
+#endif
+
+#ifdef RWHO
+char *
+sysrup(hostname)
+    char       *hostname;
+{
+    char       filename[MAXFILENAME];
+    FILE       *rwhofile;
+    struct whod        wd;
+    char       buffer[BUFSIZ];
+    long       now;
+
+       /*
+        *      try rwho hostname file, and if that fails try ucbhostname.
+        */
+    (void) strcpy(filename, RWHOLEADER);
+    (void) strcat(filename, hostname);
+    rwhofile = fopen(filename, "r");
+    if (rwhofile == NULL) {
+       (void) strcpy(filename, RWHOLEADER);
+       (void) strcat(filename, "ucb");
+       (void) strcat(filename, hostname);
+       rwhofile = fopen(filename, "r");
+       if (rwhofile == NULL) {
+           (void) sprintf(buffer, "%s?", hostname);
+           return buffer;
+       }
+    }
+    if (fread(&wd, sizeof wd, 1, rwhofile) != 1) {
+       (void) sprintf(buffer, "%s ?", hostname);
+       fclose(rwhofile);
+       return buffer;
+    }
+    (void) time(&now);
+    if (now - wd.wd_recvtime > DOWN_THRESHOLD) {
+       long    interval;
+       long    days, hours, minutes;
+
+       interval = now - wd.wd_recvtime;
+       minutes = (interval + 59) / 60; /* round to minutes */
+       hours = minutes / 60;           /* extract hours from minutes */
+       minutes %= 60;                  /* remove hours from minutes */
+       days = hours / 24;              /* extract days from hours */
+       hours %= 24;                    /* remove days from hours */
+       if (days > 7 || days < 0) {
+           (void) sprintf(buffer, "%s down", hostname);
+       } else if (days > 0) {
+           (void) sprintf(buffer, "%s %d+%d:%02d",
+                           hostname, days, hours, minutes);
+       } else {
+           (void) sprintf(buffer, "%s %d:%02d", hostname, hours, minutes);
+       }
+    } else {
+       (void) sprintf(buffer, "%s %.1f", hostname, wd.wd_loadav[0]/100.0);
+    }
+    if (rwhofile != NULL) {
+       fclose(rwhofile);
+    }
+    return buffer;
+}
+#endif RWHO
diff --git a/usr/src/ucb/vlp/vlpmacs b/usr/src/ucb/vlp/vlpmacs
new file mode 100644 (file)
index 0000000..61790a7
--- /dev/null
@@ -0,0 +1,81 @@
+." $Header: /usr/src/ucb/vlp/RCS/vlpmacs,v 1.4 83/08/04 16:15:42 layer Exp $   
+." .Fi   -- print out file name and date, used at beginning of document
+."
+.de Fi
+.ds Hd
+.if !'\\*(F='' .bp
+.if '\\*(F='' .sp 5v
+.ds F= \\$1
+.nr % 1
+.ev 1
+.ft 2
+.ps 12
+.tl 'File: \\*(F=''Modified: \\$2'
+.tl '''Printed: \\$3'
+.ev
+.sp .25i 
+..
+."
+."   .Ti <text>            -- declare text to be printed at the bottom of each page
+."
+.de Ti
+.ds T= \\$1
+..
+."
+."  .He   -- print out bottom of page information, and skip to next page
+."
+.de He
+.br
+.ev 1
+.ft 2
+.ps 12
+.sp .25i
+.tl '\\*(T=''Page \\n% of \\*(F='
+.bp
+.ft 3
+.ps 12
+.sp 4v
+.if !'\\*(Hd'' .tl '''...\\*(Hd'
+.if !'\\*(Hd'' .sp .25i
+.ev
+..
+." 
+." trap bottom of page -1.25 from bottom of paper
+."
+."
+."     .Lf <name> --- declare we are in lisp function <name>
+."
+.de Lf
+.ds Hd \\$1
+.br
+.ev 2          \" So it works with me macros, which use ev 1
+.ft 3
+.ps 12
+.tl '''\\*(Hd'
+.ev
+..
+."
+."
+."     .Ls <size> --- Begin block of embedded Lisp code
+."
+.de Ls
+." save the point size and vert spacing
+.nr Op \\n(.s
+.nr Ov \\n(.v
+.if \\n(.$=1 .ps \\$1
+.if \\n(.$=1 .vs \\$1+2v
+." save fill register flag in Xu and start fill mode
+.nr Xu \\n(.u
+.nf
+..
+."
+."
+."     .Le --- End block of embedded Lisp code
+."
+.de Le
+.vs \\n(Ovu
+.ps \\n(Op
+.if \\n(Xu .fi
+..
+.ds T= 
+.ds F=
diff --git a/usr/src/usr.bin/efl/Makefile b/usr/src/usr.bin/efl/Makefile
new file mode 100644 (file)
index 0000000..8046f4b
--- /dev/null
@@ -0,0 +1,75 @@
+CFLAGS = -O -w
+LIBES =
+FILES1 =  Makefile efl.1 defs tokens main.c init.c tailor.c\
+               gram.head gram.dcl gram.expr gram.exec\
+               lex.l fixuplex symtab.c\
+               dcl.c addr.c struct.c field.c misc.c alloc.c mk.c
+FILES2 =  exec.c blklab.c simple.c print.c temp.c io.c error.c\
+               pass2.c icfile.c free.c dclgen.c namgen.c
+FILES = $(FILES1) $(FILES2)
+P = detab 0 6 12 18 24 30 36 42 48 54 60 66 72 | und -3 | opr -r2
+
+OBJECTS = main.o init.o tailor.o gram.o lex.o symtab.o\
+       dcl.o addr.o struct.o field.o blklab.o\
+       mk.o misc.o alloc.o print.o simple.o exec.o temp.o io.o error.o\
+       pass2.o icfile.o free.o dclgen.o namgen.o
+
+a.out : $(OBJECTS)
+       @echo LOAD
+       @$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBES)
+       @size
+
+$(OBJECTS) :  defs
+lex.o init.o : tokdefs
+
+# gram.c can no longer be made on a pdp11 because of yacc limits
+gram.c:        gram.head gram.dcl gram.expr gram.exec tokdefs
+       ( sed <tokdefs "s/#define/%token/" ;\
+       cat gram.head gram.dcl gram.expr gram.exec) >gram.in
+       $(YACC) $(YFLAGS) gram.in
+       (echo "#define YYDEBUG"; cat y.tab.c) > gram.c
+       rm -f gram.in y.tab.c
+
+lex.c: fixuplex
+       lex lex.l
+       fixuplex
+       mv lex.yy.c lex.c
+
+tokdefs: tokens
+       grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs
+
+clean:
+       -rm -f a.out *.o gram.c lex.c tokdefs 
+       -du
+
+printall:
+       -pr $(FILES1) | $P
+       -pr $(FILES2) | $P
+       touch print
+
+print:  $(FILES)
+       -pr $? | $P
+       touch print
+
+lint: a.out
+       lint -p *.c -lS
+
+install: a.out
+       -@size a.out /usr/bin/efl
+       install -s a.out ${DESTDIR}/usr/bin/efl
+
+test:  a.out
+       a.out "system=gcos" efltest/Hard.e >z1 2>z2
+       cmp z1 efltest/Hard.out
+       a.out "system=gcos" efltest/Band.e >z1 2>z2
+       cmp z1 efltest/Band.out
+       a.out "system=gcos" efltest/Buram.e >z1 2>z2
+       cmp z1 efltest/Buram.out
+       a.out "system=gcos" efltest/Dgl.e >z1 2>z2
+       cmp z1 efltest/Dgl.out
+       rm -f z1 z2
+       @echo TEST OK
+
+tape: $(FILES) gram.c lex.c a.out
+       tar cb $(FILES) gram.c lex.c a.out
+
diff --git a/usr/src/usr.bin/f77/src/f77pass1/stab.c b/usr/src/usr.bin/f77/src/f77pass1/stab.c
new file mode 100644 (file)
index 0000000..f72e739
--- /dev/null
@@ -0,0 +1,290 @@
+/*
+ * Symbolic debugging info interface.
+ *
+ * Here we generate pseudo-ops that cause the assembler to put
+ * symbolic debugging information into the object file.
+ */
+
+#include "defs.h"
+
+#include <sys/types.h>
+#include <a.out.h>
+#include <stab.h>
+
+#define public
+#define private static
+#define and &&
+#define or ||
+#define not !
+#define div /
+#define mod %
+#define nil 0
+
+typedef enum { false, true } Boolean;
+
+static char asmline[128];
+int len;
+extern char *malloc();
+
+prstab(s, code, type, loc)
+char *s, *loc;
+int code, type;
+{
+    char *locout;
+
+    if (sdbflag) {
+       locout = (loc == nil) ? "0" : loc;
+       if (s == nil) {
+           sprintf(asmline, "\t.stabn\t0x%x,0,0x%x,%s\n", code, type, locout);
+       } else {
+           sprintf(asmline, "\t.stabs\t\"%s\",0x%x,0,0x%x,%s\n", s, code, type,
+               locout);
+       }
+        p2pass( asmline );
+    }
+}
+
+filenamestab(s)
+char *s;
+{
+   sprintf(asmline,"\t.stabs\t\"%s\",0x%x,0,0,0\n", s, N_SO);
+   p2pass( asmline );
+}
+
+linenostab(lineno)
+int lineno;
+{
+   sprintf(asmline,"\t.stabd\t0x%x,0,%d\n", N_SLINE, lineno);
+   p2pass( asmline );
+}
+
+/*
+ * Generate information for an entry point
+ */
+
+public entrystab(p,class)
+register struct Entrypoint *p;
+int class;
+{
+int et;
+Namep q;
+
+  switch(class) {
+    case CLMAIN: 
+        et=writestabtype(TYSUBR);
+       sprintf(asmline, "\t.stabs\t\"MAIN:F%2d\",0x%x,0,0,L%d\n",
+                               et,N_FUN,p->entrylabel);
+       p2pass(asmline);
+        if (p->entryname) {
+           sprintf(asmline, "\t.stabs\t\"%s:F%2d\",0x%x,0,0,L%d\n",
+               nounder(XL,p->entryname->extname), et,N_FNAME,p->entrylabel);
+       p2pass(asmline);
+        }
+       break;
+       
+     case CLBLOCK:     /* May need to something with block data LATER */
+       break;
+
+     default :
+       if( (q=p->enamep) == nil) fatal("entrystab has no nameblock");
+       sprintf(asmline, "\t.stabs\t\"%s:F", varstr(VL,q->varname));
+       len = strlen(asmline);
+       /* when insufficient information is around assume TYSUBR; enddcl
+          will fill this in*/
+       if(q->vtype == TYUNKNOWN || (q->vtype == TYCHAR && q->vleng == nil) ){
+           sprintf(asmline+len, "%2d", writestabtype(TYSUBR));
+       }
+        else addtypeinfo(q);
+       len += strlen(asmline+len);
+       sprintf(asmline+len, "\",0x%x,0,0,L%d\n",N_FUN,p->entrylabel);
+       p2pass(asmline);
+        break;
+   }
+}
+
+/*
+ * Generate information for a symbol table (name block ) entry.
+ */
+
+public namestab(sym)
+Namep sym;
+{
+    register Namep p;
+    char *varname, *classname;
+    Boolean ignore;
+    int vartype;
+
+       ignore = false;
+       p = sym;
+       if(!p->vdcldone) return;
+       vartype = p->vtype;
+       varname = varstr(VL, p->varname);
+       switch (p->vclass) {
+           case CLPARAM:       /* parameter (constant) */
+               classname = "c";
+               break;
+
+           case CLVAR:         /* variable */
+           case CLUNKNOWN:   
+               if(p->vstg == STGARG) classname = "v";
+               else classname = "V";
+               break;
+
+           case CLMAIN:        /* main program */
+           case CLENTRY:       /* secondary entry point */
+           case CLBLOCK:       /* block data name*/
+           case CLPROC:        /* external or function or subroutine */
+               ignore = true;  /* these are put out by entrystab */
+               break;
+
+
+       }
+       if (not ignore) {
+           sprintf(asmline, "\t.stabs\t\"%s:%s", varname, classname);
+           len = strlen(asmline);
+            addtypeinfo(p);
+           len += strlen(asmline+len);
+           switch(p->vstg) {
+
+             case STGUNKNOWN :
+             case STGCONST :
+             case STGEXT :
+             case STGINTR :
+             case STGSTFUNCT :
+             case STGLENG :
+             case STGNULL :
+             case STGREG :
+             case STGINIT :
+                 sprintf(asmline+len,
+                 "\",0x%x,0,0,0 /* don't know how to calc loc for stg %d*/ \n",
+                              N_LSYM,p->vstg);
+                 break;
+
+             case STGARG :
+                 sprintf(asmline+len,"\",0x%x,0,0,%d \n",
+                             N_PSYM,p->vardesc.varno + ARGOFFSET );
+                 break;
+
+             case STGCOMMON :
+                 sprintf(asmline+len, "\",0x%x,0,0,%d\n", 
+                      N_GSYM, p->voffset);
+                 break;
+
+             case STGBSS :
+                 sprintf(asmline+len, "\",0x%x,0,0,v.%d\n",
+                        (p->inlcomm ? N_LCSYM : N_STSYM), 
+                         p->vardesc.varno);
+                 break;
+
+             case STGEQUIV :
+                 sprintf(asmline+len, "\",0x%x,0,0,%s + %d \n",
+                        (p->inlcomm ? N_LCSYM : N_STSYM) , 
+                         memname(STGEQUIV,p->vardesc.varno),(p->voffset)) ;
+                 break;
+
+             case STGAUTO :
+                 sprintf(asmline+len, "\",0x%x,0,0,-%d \n",
+                       N_LSYM, p->voffset);
+
+           }
+           p2pass(asmline);       
+       }
+}
+
+static typenum[NTYPES]; /* has the given type already been defined ?*/
+
+private writestabtype(type)
+int type;
+{
+ char asmline[130];
+ static char *typename[NTYPES] =
+ { "unknown", "addr","integer*2", "integer", "real", "double precision",
+   "complex", "double complex", "logical", "char", "void", "error" };
+
+ static int typerange[NTYPES] = { 0, 3, 2, 3, 4, 5, 6, 7, 3, 9, 10, 11 };
+
+ /* compare with typesize[] in init.c */
+ static int typebounds[2] [NTYPES] ={
+ /* "unknown", "addr","integer*2", "integer",    "real", "double precision", */
+    { 0      ,   0   ,   -32768,    -2147483648,   4,       8,
+ /* "complex", "double complex", "logical", "char", "void", "error" }; */
+      8,         16,               0,        0,       0,          0 },
+ /* "unknown", "addr","integer*2", "integer",    "real", "double precision", */
+    { 0  ,       -1,      32767,    2147483647,   0,         0,
+ /* "complex", "double complex", "logical", "char", "void", "error" }; */
+      0,         0,               1,        127,       0,          0 }
+ };
+                    
+
+ if( type < 0 || type > NTYPES) badtype("writestabtype",type);
+
+    if (typenum[type]) return(typenum[type]);
+    typenum[type] = type;
+    sprintf(asmline, "\t.stabs\t\"%s:t%d=r%d;%ld;%ld;\",0x%x,0,0,0 \n", 
+       typename[type], type, typerange[type], typebounds[0][type], 
+        typebounds[1][type], N_GSYM) ;
+    p2pass(asmline);
+    return(typenum[type]);
+}
+
+
+private getbasenum(p)
+Namep p;
+{
+
+  int t;
+  t = p->vtype;
+  if( t < TYSHORT || t > TYSUBR)
+  dclerr("can't get dbx basetype information",p);
+
+  if (p->vtype == TYCHAR || p->vdim != nil ) writestabtype(TYINT);
+  return(writestabtype(t));
+}
+
+/*
+ * Generate debugging information for the given type of the given symbol.
+ */
+
+private addtypeinfo(sym)
+Namep sym;
+{
+    Namep p;
+    int i,tnum;
+    char lb[20],ub[20];
+
+    p = sym;
+    if (p->tag != TNAME) badtag("addtypeinfo",p->tag);
+
+    tnum = getbasenum(p);
+    if(p->vdim != (struct Dimblock *) ENULL) {
+    
+      for (i = p->vdim->ndim-1; i >=0 ; --i) { 
+         if(p->vdim->dims[i].lbaddr == ENULL) {
+             sprintf(lb,"%d", p->vdim->dims[i].lb->constblock.const.ci);
+        }
+        else  { 
+             sprintf(lb,"T%d", p->vdim->dims[i].lbaddr->addrblock.memoffset->constblock.const.ci);
+         }
+         if(p->vdim->dims[i].ubaddr == ENULL) {
+             sprintf(ub,"%d",p->vdim->dims[i].ub->constblock.const.ci);
+        }
+        else  {
+             sprintf(ub,"T%d",p->vdim->dims[i].ubaddr->addrblock.memoffset->constblock.const.ci);
+         }
+                sprintf(asmline+len, "ar%d;%s;%s;", TYINT, lb, ub);
+        len += strlen(asmline+len);
+     }
+   }
+    if (p->vtype == TYCHAR) {
+    /* character type always an array(1:?) */
+        if( ! (p->vleng ) )
+           fatalstr("missing length in addtypeinfo for character variable %s", varstr(p->varname));
+
+        if (ISCONST(p->vleng)) sprintf(ub,"%d",p->vleng->constblock.const.ci);
+         else sprintf(ub,"A%d",p->vleng->addrblock.memno + ARGOFFSET);
+
+       sprintf(asmline+len,"ar%d;1;%s;", TYINT, ub);
+       len += strlen(asmline+len);
+    }
+    sprintf(asmline+len, "%d",tnum);
+}
diff --git a/usr/src/usr.bin/lint/llib-lc b/usr/src/usr.bin/lint/llib-lc
new file mode 100644 (file)
index 0000000..de3e2c3
--- /dev/null
@@ -0,0 +1,287 @@
+/*     llib-lc 1.8     83/09/09        */
+/* LINTLIBRARY */
+#include <sys/types.h>
+#include <fstab.h>
+#include <grp.h>
+#include <sys/dir.h>
+#include <nlist.h>
+#include <pwd.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <sgtty.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/wait.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/uio.h>
+
+       /***    SECTION 2       ***/
+int    errno;
+
+int    accept(s, a, l) struct sockaddr *a; int *l; { return s; }
+int    access( p, m) char *p; { return 0; }
+int    acct(f) char *f; { return 0;}
+int    bind(s, n, l) struct sockaddr *n; { return 0; }
+char   *brk(a) char *a; { return(a); }
+int    chdir(s) char *s; { return(0); }
+int    chmod(s, m) char *s; { return(0); }
+int    chown(s, u, g) char *s; { return(0); }
+int    chroot( d ) char *d; { return 0; }
+int    close(f) { return(0); }
+int    connect( s, n, l) struct sockaddr *n; { return 0; }
+int    dup(f) { return(f); }
+int    dup2( o, n) { return o; }
+       execve(s, v, e) char *s, *v[], *e[]; {;}
+       _exit(s) {;}
+int    fcntl(f, c, a) { return (0); }
+int    flock( f, o ) { return 0; }
+int    fork() { return(0); }
+int    fsync( f ) { return 0; }
+int    fstat(f, b) struct stat *b; { return(0); }
+int    ftruncate( d, l) { return 0;}
+int    getdtablesize() { return 20 ; }
+int    getegid() { return(1); }
+int    geteuid() { return(1); }
+int    getgid() { return(1); }
+int    getgroups( n, g ) int *n, *g; { return 0; }
+int    gethostid() { return 1; }
+int    gethostname( n, l ) char *n; int *l; { return 0 ;}
+int    getitimer( w, v ) struct itimerval *v; { return 0; }
+int    getpagesize() { return 1; }
+int    getpgrp(p) { return 1; }
+int    getpid() { return(1); }
+int    getppid() { return(1); }
+int    getpriority( w, who) { return 1;}
+int    getrlimit( res, rip) struct rlimit *rip; { return 0;}
+int    getrusage( res, rip) struct rusage *rip; { return 0;}
+int    getsockname(s, name, namelen) char *name; int *namelen; { return(0); }
+int    getsockopt( s, level, opt, buf, len ) { return 0;}
+int    gettimeofday( t, z ) struct timeval *t; struct timezone *z; { return 0;}
+int    getuid() { return(1); }
+int    ioctl( d, r, p) char *p; { return 0;}
+int    kill(p, s) { return(0); }
+int    killpg( pg, s) { return 0;}
+int    link(a, b) char *a, *b; { return(0); }
+int    listen( s, b ){ return 0; }
+long   lseek(f, o, d) long o; { return(0); }
+int    lstat(s, b) char *s; struct stat *b; { return(0); }
+#ifdef notdef
+int    madvise( a, l, b ) char * a; int l, b; { return 0;}
+int    mmap( a, l, p, s, f, o ) char * a; off_t o; { return 0;}
+int    mincore( a, l, v ) char * a; int l; char *v; { return 0; }
+#endif
+int    mkdir( p, m ) char *p; { return 0; }
+int    mknod(n, m, a) char *n; { return(0); }
+int    mount(s, n, f) char *s, *n; { return(0); }
+#ifdef notdef
+int    mprotect( a, l, p) char * a; { return 0;}
+int    mremap( a, l, p, s, f) char * a, f; { return 0;}
+int    munmap( a, l) char * a; { return 0;}
+#endif
+       /* VARARGS2 */
+int    open(f, m, stuff) char *f; { return(0); }
+int    pipe(f) int f[2]; { return(0); }
+       profil(b, s, o, i) char *b; {;}
+int    ptrace(r, p, a, d) { return(0); }
+int    read(f, b, l) char *b; { return(l); }
+int    readv( d, v, l) struct iovec *v; { return l; }
+int    readlink( p, b, s ) char *p, *b; { return 1; }
+       reboot( h ) {;}
+int    recv( s, b, l, f ) char *b; { return l ; }
+int    recvfrom( s, b, l, f, fr, fl ) char *b; struct sockaddr *fr; int *fl;
+               { return l; }
+int    recvmsg( s, m, f ) struct msghdr m[]; { return 1; }
+int    rename( f, t ) char *f, *t; { return 0;}
+int    rmdir( p ) char *p; { return 0;}
+char   *sbrk(i) { return((char *)0); }
+int    select( n, r, w, e, t ) int *r, *w, *e; struct timeval *t; { return n; }
+int    send( s, m, l, f )  char *m; { return l; }
+int    sendto( s, m, l, f, t, tl ) char *m; struct sockaddr *t; { return l; }
+int    sendmsg( s, m, l) struct msghdr m[]; { return l; }
+int    setgroups( n, g) int *g; { return 0; }
+int    sethostid( h ) { return 0;}
+int    sethostname( n, l ) char *n; int l; { return 0 ;}
+int    setitimer( w, v, ov ) struct itimerval *v, *ov; { return 0; }
+int    setpgrp( g, pg) { return 0; }
+int    setpriority( w, who, pri ) { return 1;}
+int    setregid( r, e){ return 0; }
+int    setreuid( r, e){ return 0; }
+int    setrlimit( res, rip) struct rlimit *rip; { return 0;}
+       /* VARARGS */
+int    setsockopt( s, level, opt, buf, len ) { return 0;}
+int    settimeofday( t, z ) struct timeval *t; struct timezone *z; { return 0;}
+int    shutdown( s, h ){ return 0;}
+int    (*signal(c, f))() int (*f)(); { return(f); }
+int    (*sigvec(c, f, m))() int (*f)(); { return(f); }
+int    sigblock(m) { return (m); }
+int    sigsetmask(m) { return (m); }
+       sigpause(m) { ; }
+int    sigstack(a, on) char *a; int on; { ; }
+int    socket( a, t, p) {return 1;}
+int    socketpair( d, t, p, s ) int s[2]; { return 0; }
+int    stat(s, b) char *s; struct stat *b; { return(0); }
+#ifdef notdef
+char * stk( a ) char * a; { return a; }
+char * sstk( a ) int a; { return (char *)0; }
+#endif
+int    swapon( b, s ) char *b; { return 0;}
+int    symlink( t, f) char *t, *f; { return 0;}
+       sync(){;}
+int    truncate( p, l) char *p; { return 0;}
+int    umask( n ) { return n; }
+int    unlink(s) char *s; { return(0); }
+int    utimes( f, t ) char *f; struct timeval *t[2]; { return 0 ;}
+int    vfork() { return(0); }
+int    wait(s) union wait *s; { return(1); }
+int    wait3( s, o, r) union wait *s; struct rusage *r; { return 1;}
+int    write(f, b, l) char *b; { return(l); }
+int    writev( f, v, l) struct iovec *v; { return l; }
+
+
+       /***    SECTION 3       ***/
+
+       /* antique system calls and unclassified */
+       abort() {;}
+int    abs(i) int i; { return(i); }
+int    alarm(s) unsigned s; { return(s); }
+       alphasort( d1, d2) struct direct *d1, *d2; { return 0;}
+char * asctime(t) struct tm *t; { return(""); }
+double atof(s) char *s; { return(1.); }
+int    atoi(s) char *s; { return 1;   }
+long   atol(s) char *s; { return 1L;   }
+char * calloc(n,s) unsigned n, s; { static char c[1]; return(c); }
+void   closedir( p ) DIR *p; {}
+int    creat(s, m) char *s; { return(0); }
+char * crypt(k,s) char *k, *s; { return(""); }
+char * ctime(c) time_t *c;{ return(""); }
+char   _ctype_[];
+char * ecvt(v, n, d, s) double v; int *d, *s; { return(""); }
+       encrypt(s, i) char *s; {}
+int    endfsent() { return 0; }
+int    endgrent() { return 0; }
+int    endpwent() { return 0; }
+       /* VARARGS */
+       execl(f, a) char *f, *a; {;}
+       /* VARARGS */
+       execle(f, a) char *f, *a; {;}
+       execv(s, v) char *s, *v[]; {;}
+       exit(s) {;}
+char * fcvt(v, n, d, s) double v; int *d, *s; { return(""); }
+       free(p) char *p; {;}
+double frexp( v, e) double v; int *e; { return v; }
+char * gcvt(v, n, b) double v; char *b; { return(""); }
+char * getenv( n ) char *n; { return n; }
+struct fstab * getfsent() { return (struct fstab *)NULL; }
+struct fstab * getfsspec( n ) char *n; { return (struct fstab *)NULL; }
+struct fstab * getfsfile( n ) char *n; { return (struct fstab *)NULL; }
+struct fstab * getfstype( t ) char *t; { return (struct fstab *)NULL; }
+struct group * getgrent() { return (struct group *)NULL; }
+struct group * getgrgid( n ) { return (struct group *)NULL; }
+struct group * getgrnam( n ) char *n; { return (struct group *)NULL; }
+char * getlogin(){ return " "; }
+char * getpass( n ) char *n ; { return n; }
+int    getpw( u, b) char *b;  { return 0; }
+struct passwd *        getpwent() { return (struct passwd *)NULL; }
+struct passwd *        getpwuid( n ) { return (struct passwd *)NULL; }
+struct passwd *        getpwnam( n ) char *n; { return (struct passwd *)NULL; }
+struct tm *    gmtime(c) time_t *c; { return gmtime(c); }
+int    gtty(f, b) struct sgttyb *b; { return(0); }
+char * index(s, c) char *s, c; { return s; }
+long * initstate( s, st, n) unsigned s; long *st; { return st; }
+int    isatty(f) { return 1; }
+double ldexp( v, e) double v; { return v; }
+       longjmp( e, v) jmp_buf *e; {;}
+struct tm *localtime(c) time_t *c; { return localtime(c); }
+char * malloc(n) unsigned n; {static char c; return(&c);}
+double modf( v, p ) double v, *p; { return v; }
+char * mktemp(p) char *p; { return(p);}
+       monitor(l, h, b, s, n) int (*l)(), (*h)(); short *b; {}
+       monstartup( l, h) int (*l)(), (*h)(); {;}
+       nlist( f, n) char *f; struct nlist n[]; {;}
+DIR *  opendir( f ) char *f; { return (DIR *)NULL; }
+       pause() {;}
+       perror(s) char *s; {}
+struct direct *        readdir( p ) DIR *p; { return (struct direct *)NULL; }
+       qsort( b, n, w, c ) char *b; int (*c)(); {;}
+int    rand(){ return 1; }
+long   random() { return 1L; }
+char * re_comp(s) char *s ; { return s; }
+int    re_exec(s) char *s ; { return 1; }
+char * realloc(p, n) char *p; unsigned n; { static char c[1]; return(c);}
+char * rindex(s, c) char *s, c; { return s; }
+int    scandir(d, n, s, c) char *d; struct direct *(*n[]); int (*s)(),(*c)();
+               { return 1; }
+void   seekdir( p, l) DIR *p; long l; {}
+int    setfsent() { return 0; }
+int    setgrent() { return 0; }
+int    setgid(g) { return(0); }
+int    setjmp(e) jmp_buf e; { return(0); }
+       setkey(k) char *k; {}
+int    setpwent() { return 0; }
+long * setstate( st ) long *st; { return st; }
+int    setuid(u) { return(0); }
+       sleep(i) unsigned i; {}
+int    srand(s){ return s; }
+char * strcat(a, b) char *a, *b; { return a; }
+int    strcmp(a, b) char *a, *b; { return(1); }
+char * strcpy(a, b) char *a, *b; { return a; }
+int    strlen(s) char *s; { return(1); }
+char * strncat(a, b, n) char *a, *b; { return a;}
+int    strncmp(a, b, n) char *a, *b; { return(1); }
+char * strncpy(a, b, n) char *a, *b; { return a; }
+int    stty(f, b) struct sgttyb *b; { return(0); }
+       swab( f, t, n) char *f, *t; {;}
+char * sys_errlist[];
+int    sys_nerr;
+int    system(s) char *s; { return(0); }
+long   tell(f) { return((long)0); }
+long   telldir( p ) DIR *p; { return 1L; }
+time_t time(t) time_t *t; { return( 0 );}
+char * timezone( z, d ){}
+char * ttyname(f) { return " "; }
+int    ttyslot() { return 1; }
+char * valloc(s) unsigned s; { return malloc(s); }
+
+       /* standard I/O library */
+
+int    fclose(f) FILE *f; {return(0);}
+FILE * fdopen(fd, m) char *m; { return(stdin);}
+int    fflush(f) FILE *f; {return(0);}
+int    fgetc(f)  FILE *f; {return 0; }
+char * fgets( s, l, f ) char *s; FILE *f; { return(s); }
+int    _filbuf( f ) FILE *f; { return 0; }
+/* the unsigned is due to putc and putchar macro expansion */
+int    _flsbuf( c, f ) unsigned c; FILE *f; { return 0; }
+FILE * fopen(s,m) char *s, *m; { return(stdin); }
+       /* VARARGS */
+       fprintf( f, s ) FILE *f; char *s; {;}
+int    fputc(c, f) char c; FILE *f; {return 0; }
+       fputs(s,f) char *s; FILE *f; {;}
+int    fread( p, s, n, f ) char *p; FILE *f; {return(1);}
+FILE * freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); }
+       /* VARARGS */
+       fscanf( f, s ) FILE *f; char *s; {return(1);}
+       fseek(f, o, p) FILE *f; long o; { return(0); }
+long   ftell(f) FILE *f; { return(0L); }
+int    fwrite( p, s, n, f ) char *p; FILE *f; {return(0);}
+int    getw(f) FILE *f; { return 0;}
+char * gets( s ) char *s; { return(s); }
+struct _iobuf _iob[_NFILE];
+int    pclose( f ) FILE *f; { return 0; }
+FILE * popen( c, t ) char *c, *t; { return(stdin); }
+       /* VARARGS */
+       printf( s ) char *s; {;}
+       puts(s) char *s;{;}
+int    putw(w, f) FILE *f; { return 0;}
+       rewind(f) FILE *f; {;}
+       /* VARARGS */
+       scanf( f ) char *f; {return(1); }
+       setbuf( f, b ) FILE *f; char *b; {;}
+       setbuffer( f, b, s ) FILE *f; char *b; {;}
+       /* VARARGS */
+char * sprintf( s, f ) char *s, *f; { return(s);}
+       /* VARARGS */
+       sscanf( s, f ) char *s, *f; { return(1); }
+       ungetc( c, f ) FILE *f; {  return(c); }
diff --git a/usr/src/usr.lib/libplot/Makefile b/usr/src/usr.lib/libplot/Makefile
new file mode 100644 (file)
index 0000000..36d5088
--- /dev/null
@@ -0,0 +1,38 @@
+#      Makefile        4.6     83/09/21
+#
+ALL=   libplot lib4014 lib300 lib300s lib450 libvt0
+SUBDIRS=plot t4014 t300 t300s t450 vt0
+
+all:   ${ALL}
+
+libplot: FRC
+       cd plot; make ${MFLAGS}
+
+lib4014: FRC
+       cd t4014; make ${MFLAGS}
+
+lib300: FRC
+       cd t300; make ${MFLAGS}
+
+lib300s: FRC
+       cd t300s; make ${MFLAGS}
+
+lib450: FRC
+       cd t450; make ${MFLAGS}
+
+libvt0: FRC
+       cd vt0; make ${MFLAGS}
+
+FRC:
+
+install: all
+       for i in ${ALL}; do \
+               install -m 644 $$i ${DESTDIR}/usr/lib/$$i.a; \
+               ranlib ${DESTDIR}/usr/lib/$$i.a; \
+       done
+
+clean:
+       rm -f ${ALL} errs a.out core
+       for i in ${SUBDIRS}; do \
+               (cd $$i; make ${MFLAGS} clean); \
+       done
diff --git a/usr/src/usr.lib/libplot/t300/Makefile b/usr/src/usr.lib/libplot/t300/Makefile
new file mode 100644 (file)
index 0000000..340128f
--- /dev/null
@@ -0,0 +1,11 @@
+#      Makefile        4.3     83/09/21
+#
+CFLAGS=        -O
+OBJS=  arc.o box.o circle.o close.o dot.o erase.o label.o \
+       line.o linmod.o move.o open.o point.o space.o subr.o
+
+../lib300:     ${OBJS}
+       ar cu ../lib300 ${OBJS}
+
+clean:
+       rm -f ${OBJS} errs a.out core
diff --git a/usr/src/usr.lib/libplot/t300s/Makefile b/usr/src/usr.lib/libplot/t300s/Makefile
new file mode 100644 (file)
index 0000000..731df7d
--- /dev/null
@@ -0,0 +1,11 @@
+#      Makefile        4.3     83/09/21
+#
+CFLAGS=        -O
+OBJS=  arc.o box.o circle.o close.o dot.o erase.o label.o \
+       line.o linmod.o move.o open.o point.o space.o subr.o
+
+../lib300s:    ${OBJS}
+       ar cu ../lib300s ${OBJS}
+
+clean:
+       rm -f ${OBJS} errs a.out core
diff --git a/usr/src/usr.lib/libplot/t4014/Makefile b/usr/src/usr.lib/libplot/t4014/Makefile
new file mode 100644 (file)
index 0000000..8308928
--- /dev/null
@@ -0,0 +1,11 @@
+#      Makefile        4.4     83/09/21
+#
+CFLAGS=        -O
+OBJS=  arc.o box.o circle.o close.o dot.o erase.o label.o \
+       line.o linemod.o move.o open.o point.o space.o subr.o
+
+../lib4014:    ${OBJS}
+       ar cu ../lib4014 ${OBJS}
+
+clean:
+       rm -f ${OBJS} errs a.out core
diff --git a/usr/src/usr.lib/libplot/t450/Makefile b/usr/src/usr.lib/libplot/t450/Makefile
new file mode 100644 (file)
index 0000000..2a3f3da
--- /dev/null
@@ -0,0 +1,11 @@
+#      Makefile        4.3     83/09/21
+#
+CFLAGS=        -O
+OBJS=  arc.o box.o circle.o close.o dot.o erase.o label.o \
+       line.o linmod.o move.o open.o point.o space.o subr.o
+
+../lib450:     ${OBJS}
+       ar cu ../lib450 ${OBJS}
+
+clean:
+       rm -f ${OBJS} errs a.out core
diff --git a/usr/src/usr.lib/lpr/lp.local.h b/usr/src/usr.lib/lpr/lp.local.h
new file mode 100644 (file)
index 0000000..032b4da
--- /dev/null
@@ -0,0 +1,85 @@
+/*     lp.local.h      4.4     83/08/24        */
+/*
+ * Possibly, local parameters to the spooling system
+ */
+
+/*
+ * Magic number mapping for binary files, used by lpr to avoid
+ *   printing objects files.
+ */
+
+#include <a.out.h>
+#include <ar.h>
+
+#ifndef A_MAGIC1       /* must be a VM/UNIX system */
+#      define A_MAGIC1 OMAGIC
+#      define A_MAGIC2 NMAGIC
+#      define A_MAGIC3 ZMAGIC
+#      undef ARMAG
+#      define ARMAG    0177545
+#endif
+
+/*
+ * Defaults for line printer capabilities data base
+ */
+#define        DEFLP           "lp"
+#define DEFLOCK                "lock"
+#define DEFSTAT                "status"
+#define        DEFSPOOL        "/usr/spool/lpd"
+#define        DEFDAEMON       "/usr/lib/lpd"
+#define        DEFLOGF         "/dev/console"
+#define        DEFDEVLP        "/dev/lp"
+#define DEFRLPR                "/usr/lib/rlpr"
+#define DEFBINDIR      "/usr/ucb"
+#define        DEFMX           1000
+#define DEFMAXCOPIES   0
+#define DEFFF          "\f"
+#define DEFWIDTH       132
+#define DEFLENGTH      66
+#define DEFUID         1
+
+/*
+ * When files are created in the spooling area, they are normally
+ *   readable only by their owner and the spooling group.  If you
+ *   want otherwise, change this mode.
+ */
+#define FILMOD         0660
+
+/*
+ * We choose not to include this from <sys/param.h>
+ */
+#define NOFILE         20
+
+/*
+ * Printer is assumed to support LINELEN (for block chars)
+ *   and background character (blank) is a space
+ */
+#define LINELEN                132
+#define BACKGND                ' '
+
+#define HEIGHT 9               /* height of characters */
+#define WIDTH  8               /* width of characters */
+#define DROP   3               /* offset to drop characters with descenders */
+
+/*
+ * path name of files created by lpd.
+ */
+#define MASTERLOCK "/usr/spool/lpd.lock"
+#define SOCKETNAME "/dev/printer"
+
+/*
+ * Some utilities used by printjob.
+ */
+#define PR             "/bin/pr"
+#define MAIL           "/usr/lib/sendmail"
+
+/*
+ * Define TERMCAP if the terminal capabilites are to be used for lpq.
+ */
+#define TERMCAP
+
+/*
+ * Maximum number of user and job requests for lpq and lprm.
+ */
+#define MAXUSERS       50
+#define MAXREQUESTS    50