| 1 | /* systat.h 1.3 83/10/02 */ |
| 2 | |
| 3 | #include <sys/param.h> |
| 4 | #include <sys/dir.h> |
| 5 | #include <sys/user.h> |
| 6 | #include <sys/proc.h> |
| 7 | #include <sys/timeb.h> |
| 8 | #include <sys/vm.h> |
| 9 | #include <sys/file.h> |
| 10 | #include <sys/map.h> |
| 11 | #include <sys/conf.h> |
| 12 | #include <sys/text.h> |
| 13 | |
| 14 | #include <machine/pte.h> |
| 15 | |
| 16 | #include <nlist.h> |
| 17 | #include <pwd.h> |
| 18 | #include <math.h> |
| 19 | #include <curses.h> |
| 20 | #include <signal.h> |
| 21 | #include <ctype.h> |
| 22 | |
| 23 | struct p_times { |
| 24 | short pt_pid; |
| 25 | float pt_pctcpu; |
| 26 | int pt_uid; |
| 27 | int pt_paddr; |
| 28 | struct proc *pt_pp; |
| 29 | } *pt; |
| 30 | |
| 31 | struct procs { |
| 32 | int pid; |
| 33 | char cmd[16]; |
| 34 | } procs[200]; |
| 35 | int numprocs; |
| 36 | |
| 37 | struct users { |
| 38 | int k_uid; |
| 39 | char k_name[16]; |
| 40 | } known[30]; |
| 41 | |
| 42 | struct cmdtab { |
| 43 | char *c_name; /* command name */ |
| 44 | int (*c_refresh)(); /* display refresh */ |
| 45 | int (*c_fetch)(); /* sets up data structures */ |
| 46 | int (*c_label)(); /* label display */ |
| 47 | int (*c_init)(); /* initialize namelist, etc. */ |
| 48 | WINDOW *(*c_open)(); /* open display */ |
| 49 | int (*c_close)(); /* close display */ |
| 50 | char c_flags; /* been initialized (right now) */ |
| 51 | }; |
| 52 | |
| 53 | struct cmdtab *curcmd; |
| 54 | struct cmdtab cmdtab[]; |
| 55 | struct cmdtab *lookup(); |
| 56 | |
| 57 | char *kmemf; |
| 58 | char *memf; |
| 59 | char *swapf; |
| 60 | int kmem; |
| 61 | int mem; |
| 62 | int swap; |
| 63 | int col; |
| 64 | long nproc; |
| 65 | long procp; |
| 66 | struct proc *kprocp; |
| 67 | long ntext; |
| 68 | long textp; |
| 69 | struct text *xtext; |
| 70 | double ccpu; |
| 71 | double lccpu; |
| 72 | char *malloc(); |
| 73 | char *calloc(); |
| 74 | char *namp; |
| 75 | char *strncpy(); |
| 76 | char c; |
| 77 | char hostname[32]; |
| 78 | int numprocs; |
| 79 | int numknown; |
| 80 | int naptime; |
| 81 | int maxind; |
| 82 | long getw(); |
| 83 | float total; |
| 84 | int factor; |
| 85 | double lave; |
| 86 | int dellave; |
| 87 | struct passwd *getpwuid(); |
| 88 | char pidname[30]; |
| 89 | struct pte *usrpt; |
| 90 | struct pte *Usrptma; |
| 91 | |
| 92 | WINDOW *wnd; |