From: sources@anomaly.sbs.risc.net
Subject: v01i126 - u386mon v3.40, SCO UNIX Performance Monitor - Part 06/06
Reply-To: sources@anomaly.sbs.risc.net
Organization: The Rhode Island Internet Systems Cooperative Network
Date: Mon, 14 Sep 1992 14:19:26 GMT
Followup-To: biz.sco.general


#!/bin/sh
# this is part.06 (part 6 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file u386mon.c continued
#
if test ! -r shar3_seq_.tmp; then
	echo "Please unpack part 1 first!"
	exit 1
fi
(read Scheck
 if test "$Scheck" != 6; then
	echo "Please unpack part $Scheck next!"
	exit 1
 else
	exit 0
 fi
) < shar3_seq_.tmp || exit 1
echo "x - Continuing file u386mon.c"
sed 's/^X//' << 'SHAR_EOF' >> u386mon.c &&
X#endif
X#endif
X#endif
X#endif
X	
X#if defined(DELL)
X	wprintw(wscr," Rel %s Ver %s - Node %s ",
X		utsname.release,utsname.version,utsname.nodename);
X#else
X#if defined(m68k)
X	wprintw(wscr," %s %s - %s ",
X		utsname.release,utsname.version,utsname.nodename);
X#else
X	/* utsname.release and utsname.version are practcally redundant here */
X	wprintw(wscr," %s - %s ",utsname.release,utsname.nodename);
X#endif
X#endif
X	getyx(wscr,y,x);
X	banner_free_x = x+2;
X	while(x < getmaxx(wscr))
X		waddch(wscr,(chtype)' '),x++;
X	wmove(wscr,0,71);
X	waddstr(wscr,"wht@n4hgf");
X	if(plock_indicator)
X	{
X		wmove(wscr,0,banner_free_x);
X		use_cp(wscr,cpMED);
X		waddstr(wscr," PLOCK ");
X		use_cp(wscr,cpBANNER);
X	}
X	wmove(wscr,3,0);
X	use_cp(wscr,cpMED);
X	waddstr(wscr,"WAIT");
X	pflush();
X
X	wmove(wscr,CMD_TLY,0);
X	use_cp(wscr,cpBANNER);
X	if(LINES >= 43)
X		waddstr(wscr,"ESC=quit P,p=ps m=main ");
X	else
X		waddstr(wscr,"ESC=quit p=ps e=extra m=main ");
X#if defined(M_UNIX)
X	waddstr(wscr,"s=sio ");
X#endif
X#if defined(M_UNIX) || defined(SVR31)
X	waddstr(wscr,"n=net t=table ");
X#endif
X#if defined(SCO322)
X	waddstr(wscr,"w=disk ");
X#endif
X
X	if(getuid() == 0)	/* root can launch fireworks very predictably */
X		waddstr(wscr,"l/u=lock ");
X	waddstr(wscr,"+/-=rate");
X	getyx(wscr,y,x);
X	while(x < getmaxx(wscr))
X		waddch(wscr,(chtype)' '),x++;
X	use_cp(wscr,cpLIT);
X
X/*
X * make initial kmem readings
X */
X	hz = (cptr = getenv("HZ")) ? atoi(cptr) : HZ;
X	if(!hz)		/* avoid problem reported by Ian Reid <ir@crosfield.co.uk> */
X		hz = HZ;
X	kread((caddr_t)&maxmem,maxmemaddr,sizeof(maxmem));
X	kread((caddr_t)&tune,tuneaddr,sizeof(tune));
X	kread((caddr_t)&v,vaddr,sizeof(v));
X
X	kread((caddr_t)&nswap,nswapaddr,sizeof(nswap));
X	itmp = -1;
X#if defined(S3BSWPI)	/* 68000 handled here, not AT&T 3B */
X	itmp = _sysm68k (S3BSWPI,&swapint);	/* per nba@sysware.dk */
X#endif
X#if defined(SI86SWPI)
X	itmp = sysi86(SI86SWPI,&swapint);
X#endif
X#if defined(SMIPSSWPI)
X	itmp = sysmips(SMIPSSWPI,&swapint);
X#endif
X	if(!itmp)
X	{
X		nswap = 0;
X		for (itmp = 0; itmp < MSFILES; itmp++)
X			nswap += swaptab[itmp].st_npgs * NBPP / NBPSCTR;
X	}
X
X#if defined(HAS_BOOTINFO)
X	kread((caddr_t)&bootinfo,bootinfoaddr,sizeof(bootinfo));
X#endif
X
X	read_sysinfo_and_minfo();
X	sysinfo_last = sysinfo;
X	minfo_last = minfo;
X
X#if defined(HAS_TIMEB)
X	timeb_last_info_read = timeb_info_read;
X#else
X	(void)time (&now);
X#endif
X
X/*
X * initialize static display (literals)
X */
X	draw_cpuscale_literals(wscr,CPUSCALE_TLY,0);
X	draw_waitscale_literals(wscr,WAITSCALE_TLY,0);
X	draw_per_sec_literals(wscr,PER_SEC_TLY,0);
X
X	if(LINES >= 43)
X		extra_static_stuff();
X
X/*
X * while(user_not_bored) entertain_and_inform_user();
X */
X#ifdef HAS_NAP
X	nap(CYCLEmsec);
X#else
X	napms(CYCLEmsec);
X#endif
X	while(1)
X	{
X
X#if defined(HAS_TIMEB)
X		ftime(&timeb_cycle_start);
X		stat_period_msec = delta_msec(timeb_info_read,timeb_last_info_read);
X		(void)time(&now);
X#else
X		then = now;
X		(void)time(&now);
X		stat_period_msec = (now - then) * 1000L;
X#endif
X
X		lt = localtime(&now);
X		wmove(wscr,0,62);
X		use_cp(wscr,cpBANNER);
X		wprintw(wscr,"%02d:%02d:%02d",lt->tm_hour,lt->tm_min,lt->tm_sec);
X
X		kread((caddr_t)&freemem,freememaddr,sizeof(freemem));
X		read_sysinfo_and_minfo();
X
X		/* heuristic validity determination */
X		wmove(wscr,0,banner_free_x + 8);
X		if((itmp = stat_period_msec > (CYCLEmsec + 3000L)) ||
X			(invalidity > INVALID_STATE))
X		{
X			use_cp(wscr,cpHIGH);
X			waddstr(wscr," INVALID ");
X			if(itmp)
X			{	/* gack - a hack */
X				itmp = (stat_period_msec - CYCLEmsec) / 1000;
X				if(itmp > 4)
X					itmp = 4;
X				invalidity += INVALID_STATE + itmp;
X			}
X		}
X		else if((itmp = (stat_period_msec > (CYCLEmsec + 1500L))) ||
X				(invalidity > INEXACT_STATE))
X		{
X			use_cp(wscr,cpMED);
X			waddstr(wscr," INEXACT ");
X			if(itmp)
X				invalidity += INEXACT_STATE;
X		}
X		if(invalidity && !(--invalidity))
X		{
X			use_cp(wscr,cpBANNER);
X			waddstr(wscr,"         ");
X		}
X		if(stat_period_msec > (CYCLEmsec + 1000L))
X			use_cp(wscr,cpREVERSE);
X		else if(stat_period_msec > (CYCLEmsec + 500L))
X			use_cp(wscr,cpBANWARN);
X		else
X			use_cp(wscr,cpBANNER);
X		wmove(wscr,stat_period_msec_y,stat_period_msec_x);
X		wprintw(wscr,"%5ld",stat_period_msec);
X
X
X#if defined(FIRST_TRY)
X		/* going this way seems to get cpu+wait ticks > real time */
X		for (itmp = 0; itmp < 5; itmp++)
X			cpu_ticks[itmp] = sysidelta(cpu[itmp]);
X		for (itmp = 0; itmp < 3; itmp++)
X			wait_ticks[itmp] = sysidelta(wait[itmp]);
X#else
X		for (itmp = 0; itmp < 5; itmp++)
X		{
X			if(itmp != CPU_WAIT)
X				cpu_ticks[itmp] = sysidelta(cpu[itmp]);
X		}
X		cpu_ticks[CPU_WAIT] = 0;
X		for (itmp = 0; itmp < 3; itmp++)
X			cpu_ticks[CPU_WAIT] += (wait_ticks[itmp] = sysidelta(wait[itmp]));
X#endif
X
X		total_ticks = update_cpuscale(wscr,CPUSCALE_TLY + 1,CPUSCALE_SX,
X			CPUSCALE_WIDTH,cpu_ticks);
X
X		update_waitscale(wscr,WAITSCALE_TLY + 1,WAITSCALE_SX,
X			WAITSCALE_WIDTH,wait_ticks,total_ticks);
X
X		calc_cpu_avg(cpu_ticks);
X		calc_wait_avg(wait_ticks);
X
X		get_cpu_avg(cpu_ticks,5);
X		total_ticks = update_cpuscale(wscr,CPUSCALE_TLY + 2,CPUSCALE_SX,
X			CPUSCALE_WIDTH,cpu_ticks);
X
X		get_wait_avg(wait_ticks,5);
X		update_waitscale(wscr,WAITSCALE_TLY + 2,WAITSCALE_SX,
X			WAITSCALE_WIDTH,wait_ticks,total_ticks);
X
X		get_cpu_avg(cpu_ticks,10);
X		total_ticks = update_cpuscale(wscr,CPUSCALE_TLY + 3,CPUSCALE_SX,
X			CPUSCALE_WIDTH,cpu_ticks);
X
X		get_wait_avg(wait_ticks,10);
X		update_waitscale(wscr,WAITSCALE_TLY + 3,WAITSCALE_SX,
X			WAITSCALE_WIDTH,wait_ticks,total_ticks);
X
X		use_cp(wscr,cpINFO);
X		y = PER_SEC_TLY + 1;
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"bread    ","%7ld",sysidelta(bread));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"bwrite   ","%7ld",sysidelta(bwrite));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		if((ltmp = sysidelta(lread) - myreadcnt) < 0)
X			ltmp = 0;
X		disp_info_long(wscr,"lread    ","%7ld",ltmp);
X		myreadcnt = 0;	/* reset /dev/{mem,kmem,swap} read count */
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"lwrite   ","%7ld",sysidelta(lwrite));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"phread   ","%7ld",sysidelta(phread));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"phwrite  ","%7ld",sysidelta(phwrite));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"swapin   ","%7ld",sysidelta(swapin));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"swapout  ","%7ld",sysidelta(swapout));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"bswapin  ","%7ld",sysidelta(bswapin));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"bswapout ","%7ld",sysidelta(bswapout));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"iget     ","%7ld",sysidelta(iget));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"namei    ","%7ld",sysidelta(namei));
X		wmove(wscr,y++,PER_SEC1_TLX);
X		disp_info_long(wscr,"dirblk   ","%7ld",sysidelta(dirblk));
X
X		y = PER_SEC_TLY + 1;
X		wmove(wscr,y++,PER_SEC2_TLX);
X		if((ltmp = sysidelta(readch) - myreadlen) < 0)
X			ltmp = 0;
X		disp_info_long(wscr,"readch  ","%7ld",ltmp);
X		myreadlen = 0;	/* reset /dev/{mem,kmem,swap} read count */
X
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_info_long(wscr,"writch  ","%7ld",sysidelta(writech));
X
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_info_long(wscr,"rawch   ","%7ld",sysidelta(rawch));
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_info_long(wscr,"canch   ","%7ld",sysidelta(canch));
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_info_long(wscr,"outch   ","%7ld",sysidelta(outch));
X
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_info_long(wscr,"msg     ","%7ld",sysidelta(msg));
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_info_long(wscr,"sema    ","%7ld",sysidelta(sema));
X
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_static_long(wscr, "maxmem  ","%6ldk",(long)maxmem * NBPP / 1024);
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_info_long(wscr,   "frmem   ","%6ldk",(long)freemem * NBPP / 1024);
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_info_int (wscr,   "mem used","%6d%%",
X			100 - (int)((freemem * 100) / maxmem));
X
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_static_int(wscr, "nswap   ","%6ldk",nswap * NBPSCTR / 1024);
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_info_long(wscr,  "frswp   ","%6ldk",minfo.freeswap* NBPSCTR/1024);
X		wmove(wscr,y++,PER_SEC2_TLX);
X		disp_info_int(wscr,   "swp used","%6d%%",
X			100 - (int)((minfo.freeswap * 100) / nswap));
X
X		y = PER_SEC_TLY + 1;
X		wmove(wscr,y++,PER_SEC3_TLX);
X		disp_info_long(wscr,"pswitch ","%5ld",sysidelta(pswitch));
X		wmove(wscr,y++,PER_SEC3_TLX);
X		disp_info_long(wscr,"syscall ","%5ld",sysidelta(syscall));
X		wmove(wscr,y++,PER_SEC3_TLX);
X		disp_info_long(wscr,"sysread ","%5ld",sysidelta(sysread));
X		wmove(wscr,y++,PER_SEC3_TLX);
X		disp_info_long(wscr,"syswrit ","%5ld",sysidelta(syswrite));
X		wmove(wscr,y++,PER_SEC3_TLX);
X		disp_info_long(wscr,"sysfork ","%5ld",sysidelta(sysfork));
X		wmove(wscr,y++,PER_SEC3_TLX);
X		disp_info_long(wscr,"sysexec ","%5ld",sysidelta(sysexec));
X
X		y++;
X		wmove(wscr,y++,PER_SEC3_TLX);
X		disp_info_long(wscr,"runque  ","%5ld",sysidelta(runque));
X		wmove(wscr,y++,PER_SEC3_TLX);
X		disp_info_long(wscr,"runocc  ","%5ld",sysidelta(runocc));
X		wmove(wscr,y++,PER_SEC3_TLX);
X		disp_info_long(wscr,"swpque  ","%5ld",sysidelta(swpque));
X		wmove(wscr,y++,PER_SEC3_TLX);
X		disp_info_long(wscr,"swpocc  ","%5ld",sysidelta(swpocc));
X
X		y = PER_SEC_TLY + 1;
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"vfault  ","%4ld",midelta(vfault));
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"demand  ","%4ld",midelta(demand));
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"pfault  ","%4ld",midelta(pfault));
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"cw      ","%4ld",midelta(cw));
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"steal   ","%4ld",midelta(steal));
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"frdpgs  ","%4ld",midelta(freedpgs));
X#if defined(SVR32)
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"vfpg    ","%4ld",midelta(vfpg));
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"sfpg    ","%4ld",midelta(sfpg));
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"vspg    ","%4ld",midelta(vspg));
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"sspg    ","%4ld",midelta(sspg));
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"pnpfault","%4ld",sysidelta(pnpfault));
X		wmove(wscr,y++,PER_SEC4_TLX);
X		disp_info_long(wscr,"wrtfault","%4ld",sysidelta(wrtfault));
X#endif
X
X		y = PER_SEC_TLY + 1;
X		wmove(wscr,y++,PER_SEC5_TLX);
X		disp_info_long(wscr,"unmodsw ","%3ld",midelta(unmodsw));
X		wmove(wscr,y++,PER_SEC5_TLX);
X		disp_info_long(wscr,"unmodfl ","%3ld",midelta(unmodfl));
X#if defined(SVR32)
X		wmove(wscr,y++,PER_SEC5_TLX);
X		disp_info_long(wscr,"psoutok ","%3ld",midelta(psoutok));
X		wmove(wscr,y++,PER_SEC5_TLX);
X		disp_info_long(wscr,"psinfai ","%3ld",midelta(psinfail));
X		wmove(wscr,y++,PER_SEC5_TLX);
X		disp_info_long(wscr,"psinok  ","%3ld",midelta(psinok));
X		wmove(wscr,y++,PER_SEC5_TLX);
X		disp_info_long(wscr,"rsout   ","%3ld",midelta(rsout));
X		wmove(wscr,y++,PER_SEC5_TLX);
X		disp_info_long(wscr,"rsin    ","%3ld",midelta(rsin));
X#endif
X
X		y++;
X		wmove(wscr,y++,PER_SEC5_TLX);
X		use_cp(wscr,cpLIT);
X		waddstr(wscr,"pages on   ");
X		wmove(wscr,y++,PER_SEC5_TLX);
X		disp_info_long(wscr,"swap  ","%5ld",midelta(swap));
X		wmove(wscr,y++,PER_SEC5_TLX);
X		disp_info_long(wscr,"cache ","%5ld",midelta(cache));
X		wmove(wscr,y++,PER_SEC5_TLX);
X		disp_info_long(wscr,"file  ","%5ld",midelta(file));
X
X		if(LINES >= 43)
X			extra_info_stuff();
X
X		detail_panel_update();
X
X		if(initial_cmd)
X		{
X			detail_panel_cmd(initial_cmd);
X			initial_cmd = 0;
X		}
X
X		pflush();
X
X		cmd = 0;
X#if defined(HAS_RDCHK)
X		while(rdchk(0))
X#endif
X		{
X			switch(cmd = wgetch(wscr))
X			{
X				case 'L' & 0x1F:		/* ^L */
X				case 'R' & 0x1F:		/* ^R */
X					clearok (wscr, TRUE);
X					touchwin(wscr);
X					wrefresh(wscr);
X					if(wdet)
X					{
X						touchwin(wdet);
X						wrefresh(wscr);
X					}
X					break;
X
X				case 'q':
X				case A_ESC:
X					goto GOOD_BYE;
X#if defined(M_UNIX)
X				case 'b':
X					if(bootinfo.bootstrlen > 79)
X						itmp = 79;
X					else
X						itmp = bootinfo.bootstrlen;
X					kread(s80,bootinfoaddr +
X						(bootinfo.bootstr - (caddr_t)&bootinfo),itmp);
X					s80[itmp] = 0;
X					disp_msg(cpMED,s80);
X					break;
X#endif
X				case 'e':
X				case 'P':
X				case 'p':
X				case 'm':
X#if defined(M_UNIX) || defined(SVR31)
X				case 'n':
X				case 't':
X#endif
X#if defined(M_UNIX)
X				case 's':
X#if defined(SCO322)
X				case 'w':
X#endif
X#endif
X					detail_panel_cmd(cmd);
X					break;
X				case 'l':
X					if(!plock_indicator)
X					{
X						if(!plock(PROCLOCK))
X						{
X							plock_indicator = 1;
X							wmove(wscr,0,banner_free_x);
X							use_cp(wscr,cpMED);
X							waddstr(wscr," PLOCK ");
X							nice(-5);
X						}
X					}
X					break;
X				case 'u':
X					if(plock_indicator)
X					{
X						if(!plock(UNLOCK))
X						{
X							plock_indicator = 0;
X							wmove(wscr,0,banner_free_x);
X							use_cp(wscr,cpBANNER);
X							waddstr(wscr,"       ");
X							nice(5);
X						}
X					}
X					break;
X				case '+':
X					if(CYCLEmsec < CYCLEmsecMax)
X					{
X						invalidity += (INEXACT_STATE * (CYCLEmsec + 1000L)) /
X											CYCLEmsec;
X						CYCLEmsec += 1000L;
X						draw_cpuscale_literals(wscr,CPUSCALE_TLY,0);
X						draw_waitscale_literals(wscr,WAITSCALE_TLY,0);
X					}
X					else beep();
X					break;
X				case '-':
X					if(CYCLEmsec > 1000L)
X					{
X						CYCLEmsec -= 1000L;
X						draw_cpuscale_literals(wscr,CPUSCALE_TLY,0);
X						draw_waitscale_literals(wscr,WAITSCALE_TLY,0);
X					}
X					else beep();
X					break;
X				case 0:
X				case -1:
X					break;
X				default:
X					beep();
X					break;
X			}
X		}
X
X		/* remember previous statistics for next delta */
X		sysinfo_last = sysinfo;
X		minfo_last = minfo;
X
X		/* ex-lax: all in the name of regularity */
X#if defined(HAS_TIMEB)
X		ftime(&timeb_cycle_end);
X		nap_msec = CYCLEmsec - delta_msec(timeb_cycle_end,timeb_cycle_start);
X		if(nap_msec < (CYCLEmsec - 300L))
X			nap_msec = (CYCLEmsec - 300L);
X#else
X		nap_msec = (CYCLEmsec - 300L);
X#endif
X#ifdef HAS_NAP
X		(void)nap(nap_msec);
X#else
X		napms(nap_msec);	/* curses call: most round UP to nearest second */
X#endif
X	}
X
XGOOD_BYE:
X	leave_text("",0);
X	/*NOTREACHED*/
X}	/* end of main */
X
X/* vi: set tabstop=4 shiftwidth=4: */
X/* end of u386mon.c */
SHAR_EOF
echo "File u386mon.c is complete" &&
# ============= u386mon.h ==============
echo "x - extracting u386mon.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > u386mon.h &&
X/*+-------------------------------------------------------------------------
X	u386mon.h - UNIX 386 system monitor definitions
X	wht@n4hgf.Mt-Park.GA.US
X--------------------------------------------------------------------------*/
X/*+:EDITS:*/
X/*:08-01-1991-23:35-wht@n4hgf-release 3.40 source control point */
X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
X/*:07-10-1990-19:06-root@n4hgf-redesign attributes/color pairs */
X/*:07-10-1990-18:33-root@n4hgf-move pio wait to medium alert */
X/*:07-03-1990-03:21-root@n4hgf-add cpBANWARN and renumber */
X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
X/*:06-21-1990-14:27-r@n4hgf-version x0.12 seems bug free */
X/*:06-20-1990-03:03-root@n4hgf-trick use_cp into making bright fgnd colors */
X/*:06-19-1990-21:35-wht-get ready for release */
X
X#ifndef M_SYSV	/* for ISC */
X#define u_char unsigned char
X#define u_long unsigned long
X#endif
X
Xchar *getenv();
Xchar *strchr();
Xchar *strrchr();
X#ifdef __STDC__
Xvoid *malloc();
X#else
Xchar *malloc();
X#endif
X
X#define pW(pan) panel_window(pan)
X#define W WINDOW
X#define P PANEL
X
X/* color numbers for EGA/VGA */
X#ifdef COLOR_16_TERMINFO	/* wht 16-color fgnd/bgnd terminfo */
X#define cHIBIT	8
X#define cBLK	0
X#define cBLU	1
X#define cGRN	2
X#define cCYN	3
X#define cRED	4
X#define cMAG	5
X#define cBRN	6
X#define cWHT	7
X#define cGRY	(cBLK | cHIBIT)
X#define cLTB	(cBLU | cHIBIT)
X#define cLTG	(cGRN | cHIBIT)
X#define cLTC	(cCYN | cHIBIT)
X#define cLTR	(cRED | cHIBIT)
X#define cLTM	(cMAG | cHIBIT)
X#define cYEL	(cBRN | cHIBIT)
X#define cHIW	(cWHT | cHIBIT)
X#else
X#ifdef	COLOR_BLACK
X#define cBLK	COLOR_BLACK
X#define cBLU	COLOR_BLUE
X#define cGRN	COLOR_GREEN
X#define cCYN	COLOR_CYAN
X#define cRED	COLOR_RED
X#define cMAG	COLOR_MAGENTA
X#define cBRN	COLOR_YELLOW
X#define cWHT	COLOR_WHITE
X#define cGRY	COLOR_BLACK
X#define cLTB	COLOR_BLUE
X#define cLTG	COLOR_GREEN
X#define cLTC	COLOR_CYAN
X#define cLTR	COLOR_RED
X#define cLTM	COLOR_MAGENTA
X#define cYEL	COLOR_YELLOW
X#define cHIW	COLOR_WHITE
X#endif
X#endif
X
X#define sTL		0xDA
X#define sTR		0xBF
X#define sBL		0xC0
X#define sBR		0xD9
X#define sLT		0xC3	/* left hand T */
X#define sRT		0xB4	/* right hand T */
X#define sVR		0xB3	/* vertical rule */
X#define sHR		0xC4	/* horizontal rule */
X
X/* color pairs */
X#ifdef COLOR_16_TERMINFO	/* wht 16-color fgnd/bgnd terminfo */
X#define use_cp(win,cp) wattrset(win,COLOR_PAIR(cp))
X#else
X#ifdef COLOR_PAIR
X#define use_cp(win,cp) wattrset(win,\
X	(color_avail) ? color_attr[cp] : mono_attr[cp])
X#else
X#define use_cp(win,cp) wattrset(win,mono_attr[cp])
X#endif
X#endif
X
X/*
X * for SVR31
X */
X#ifndef getcury
X#define getcury(win)        ((win)->_cury)
X#endif
X#ifndef getcurx
X#define getcurx(win)        ((win)->_curx)
X#endif
X#ifndef getbegy
X#define getbegy(win)        ((win)->_begy)
X#endif
X#ifndef getbegx
X#define getbegx(win)        ((win)->_begx)
X#endif
X#ifndef getbegyx
X#define getbegyx(win,y,x)   ((y)=getbegy(win),(x)=getbegx(win))
X#endif
X#ifndef getmaxy
X#define getmaxy(win)        ((win)->_maxy)
X#endif
X#ifndef getmaxx
X#define getmaxx(win)        ((win)->_maxx)
X#endif
X#ifndef getmaxyx
X#define getmaxyx(win,y,x)   ((y)=getmaxy(win),(x)=getmaxx(win))
X#endif
X
X/* 
X * if color par numbers are changed, disputil.c
X * color_attr and mono_attr tables
X * must also be changed
X */
X
X#define cpINFO		1	/* information field */
X#define cpREVERSE	2	/* "reverse video" */
X#define cpBANWARN	3	/* banner warning */
X#define cpLOW		4	/* low/user/io */
X#define cpMED		5	/* medium/kernel/pio */
X#define cpHIGH		6	/* high/brk/swp */
X#define cpBANNER	7	/* banner */
X#define cpLIT		8	/* field literals */
Xextern int color_avail;
X#ifdef COLOR_PAIR
Xextern long color_attr[];
X#endif
Xextern long mono_attr[];
X
X#define MSG_TLY		(LINES - 2)
X#define CMD_TLY		(LINES - 1)
X#define LVMSG_Y		MSG_TLY
X#define LVMSG_X		0
X
X#define CPUSCALE_TLY		1
X#define CPUSCALE_SX			13
X#define CPUSCALE_WIDTH		50
X
X#define WAITSCALE_TLY		5
X#define WAITSCALE_SX		13
X#define WAITSCALE_WIDTH		50
X
X/* Sysinfo/Minfo per second area */
X#define PER_SEC_TLY			9
X#define PER_SEC1_TLX		0
X#define PER_SEC2_TLX		18
X#define PER_SEC3_TLX		35
X#define PER_SEC4_TLX		51
X#define PER_SEC5_TLX		66
X
X/* extra info area */
X#define EXTRA_TLY			26
X#define EXTRA1_TLX			0
X#define EXTRA2_TLX			18
X#define EXTRA3_TLX			43
X#define EXTRA4_TLX			62
X
X#include "lint_args.h"
X
X/* vi: set tabstop=4 shiftwidth=4: */
X/* end of u386mon.h */
SHAR_EOF
# ============= var.c ==============
echo "x - extracting var.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > var.c &&
X/*+-------------------------------------------------------------------------
X	var.c - u386mon var struct display
X
X  Defined functions:
X	display_var(win,y,x)
X
X--------------------------------------------------------------------------*/
X/*+:EDITS:*/
X/*:08-01-1991-23:35-wht@n4hgf-release 3.40 source control point */
X/*:08-10-1990-14:13-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
X/*:06-25-1990-17:33-wht@n4hgf-alpha sort identifiers */
X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
X/*:06-21-1990-14:27-r@n4hgf-version x0.12 seems bug free */
X/*:06-17-1990-14:59-wht-creation */
X
X#include "config.h"
X#define M_TERMINFO
X#include <curses.h>
X#undef reg     /* per nba@sysware.dk */
X#ifdef NATIVE_PANELS
X# include <panel.h>
X#else
X# include "libpanel.h"
X#endif
X#include <sys/types.h>
X#include <sys/var.h>
X#include "u386mon.h"
X
X/*+-------------------------------------------------------------------------
X	display_var(win,y,x)
X--------------------------------------------------------------------------*/
Xvoid
Xdisplay_var(win,y,x)
XWINDOW *win;
Xint y;
Xint x;
X{
X	use_cp(win,cpBANNER);
X	wmove(win,y++,x);
X	waddstr(win,"-- Var ---------");
X	wmove(win,y++,x);
X	disp_static_int(win,"v_autoup   ","%5d",v.v_autoup);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_buf      ","%5d",v.v_buf);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_clist    ","%5d",v.v_clist);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_file     ","%5d",v.v_file);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_hbuf     ","%5d",v.v_hbuf);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_inode    ","%5d",v.v_inode);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_maxpmem  ","%5d",v.v_maxpmem);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_maxup    ","%5d",v.v_maxup);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_mount    ","%5d",v.v_mount);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_pbuf     ","%5d",v.v_pbuf);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_proc     ","%5d",v.v_proc);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_region   ","%5d",v.v_region);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_vhndfrac ","%5d",v.v_vhndfrac);
X
X}	/* end of display_var */
X
X/* vi: set tabstop=4 shiftwidth=4: */
X/* end of var.c */
SHAR_EOF
rm -f shar3_seq_.tmp
echo "You have unpacked the last part"
exit 0
Newsgroups: biz.sco.sources,biz.sco.general