Newsgroups: alt.sources
Path: qiclab!psgrain!charnel!rat!usc!zaphod.mps.ohio-state.edu!darwin.sura.net!Sirius.dfn.de!dct.zrz.tu-berlin.de!news.netmbx.de!Germany.EU.net!isaak.isa.de!omega!av
From: av@omega.ssw.de (Andreas Vogel)
Subject: u386mon for SVR4
Message-ID: <1992Oct2.181320.4107@omega.ssw.de>
Date: Fri, 2 Oct 1992 18:13:20 GMT
Organization: Omega Softlab
Lines: 2986

Submitted-by: av@ssw.de
Archive-name: av386mon/part04

#!/bin/sh
# this is av386mon.shar.04 (part 4 of av386mon)
# do not concatenate these parts, unpack them in order with /bin/sh
# file det_table.c continued
#
if test ! -r _shar_seq_.tmp; then
	echo 'Please unpack part 1 first!'
	exit 1
fi
(read Scheck
 if test "$Scheck" != 4; then
	echo Please unpack part "$Scheck" next!
	exit 1
 else
	exit 0
 fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
	echo 'x - still skipping det_table.c'
else
echo 'x - continuing file det_table.c'
sed 's/^X//' << 'SHAR_EOF' >> 'det_table.c' &&
X	while (1) {
X		cnt++;
X		if (rg->r_forw==(struct region *)ractiveaddr) break;
X		ndx=rg->r_forw - (struct region *)regionaddr;
X		if ((ndx >= v.v_region) || (ndx < 0) || (cnt > v.v_region)) return(-1);
X		rg=rgbase + ndx;
X	}
X	return(cnt);
#endif
}
X
/*+-------------------------------------------------------------------------
X	callouts_in_use()
X
X	Returns the number of callouts used.
--------------------------------------------------------------------------*/
X
static int
callouts_in_use()
{
#ifdef SVR4
X	return (0);
#else
X	struct callo *call;
X	register int cnt=0;
X	register int ndx=0;
X
X	kread((caddr_t) callbase, calloutaddr, sizeof(struct callo)*v.v_call);
X	call=callbase;
X	while (ndx<v.v_call) {
X		ndx++; call++;
X				/* This is a guess - I'm checking it with SCO */
X		if (call->c_id>0) cnt++;
X	}
X	return(cnt);
#endif
}
X
X
X
/*+-------------------------------------------------------------------------
X	update_table_line(win)
00000000001111111111222222222233333333334444444444555555555566666666667777777777
01234567890123456789012345678901234567890123456789012345678901234567890123456789
tual total %used ------------------------------------------------
####  ####   ### xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
--------------------------------------------------------------------------*/
X
#define _TABLESCALE_AC	0
#define _TABLESCALE_TO	6
#define _TABLESCALE_PE	13
#define _TABLESCALE_SX	17
X
static void
update_table_line(win, y, x, width, num_item, max_item, conf_item, percent_item)
WINDOW *win;
int y;
int x;
int width;
int num_item;
int max_item;
int conf_item;
int percent_item;
X
{
X	int itmp, max;
X
X	if (num_item<0) {
X
X		wmove(win, y, x + _TABLESCALE_AC);
X		use_cp(win, cpHIGH);
X		waddstr(win, "OVER");
X
X	} else {
X
X		wmove(win,y, x + _TABLESCALE_AC);
X		use_cp(win,cpINFO);
X		wprintw(win,"%4ld",num_item);
X
X		wmove(win,y, x + _TABLESCALE_TO);
X		use_cp(win,cpINFO);
X		wprintw(win,"%4ld",conf_item);
X
X		wmove(win,y, x + _TABLESCALE_PE);
X		if(percent_item < 70)
X			use_cp(win,cpLOW);
X		else if(percent_item < 90)
X			use_cp(win,cpMED);
X		else
X			use_cp(win,cpHIGH);
X		wprintw(win,"%3ld", percent_item);
X
X		wmove(win,y, x + _TABLESCALE_SX);
X
X		itmp = (width * percent_item) / 100;
X		max = (width * max_item) / 100;
X		while(-1) {
X			itmp--; max--;
X			if (max<1) {
X				use_cp(win,cpHIGH);
X				waddch(win,(chtype)'M');
X				break;
X			}
X			if (itmp>-1)
X				waddch(win,(chtype)'-');
X			else
X				waddch(win,(chtype)' ');
X		}
X		wclrtoeol(win);
X	}
}
X			
X
X
/*+-------------------------------------------------------------------------
X	init_table()
X
--------------------------------------------------------------------------*/
X
void
init_table()
X
{
#ifdef SVR4
#else
X	if (!(fpbase = (struct file *) malloc(sizeof(struct file)*v.v_file)))
X		leave_text("cannot alloc memory for file table",1);
X	if (!(ipbase = (struct inode *) malloc(sizeof(struct inode)*v.v_inode)))
X		leave_text("cannot alloc memory for inode table",1);
X	if (!(rgbase = (struct region *) malloc(sizeof(struct region)*v.v_region)))
X		leave_text("cannot alloc memory for region table",1);
#endif
X	if (!(callbase = (struct callo *) malloc(sizeof(struct callo)*v.v_call)))
X		leave_text("cannot alloc memory for region table",1);
}
X
/*+-------------------------------------------------------------------------
X	update_table(win,y,x,width)
X
--------------------------------------------------------------------------*/
X
void
update_table(win,y,x,width)
WINDOW *win;
int y;
int x;
register width;
{
X	int num_files;
X	int num_inodes;
X	int num_regions;
X	int num_callouts;
X	int percent_files;
X	int percent_inodes;
X	int percent_locks;
X	int percent_regions;
X	int percent_callouts;
X
X	num_files=files_in_use();
X	num_inodes=inodes_in_use();
X	num_regions=regions_in_use();
X	num_callouts=callouts_in_use();
#ifdef SVR4
#else
X	kread((caddr_t)&flckinfo, flckinfoaddr, sizeof(struct flckinfo));
#endif
X	num_callouts=callouts_in_use();
X
#ifdef SVR4
X	percent_files   = 0;
X	percent_inodes  = 0;
X	percent_regions = 0;
X	percent_locks   = 0;
#else
X	percent_files=(num_files * 100 / v.v_file);
X	percent_inodes=(num_inodes * 100 / v.v_inode);
X	percent_regions=(num_regions * 100 / v.v_region);
X	percent_locks=flckinfo.recs ? (flckinfo.reccnt * 100 / flckinfo.recs) : 0;
#endif
X	percent_callouts=( num_callouts * 100 / v.v_call);
X	if(percent_files > max_files) max_files=percent_files;
X	if(percent_inodes > max_inodes) max_inodes=percent_inodes;
X	if(percent_locks > max_locks) max_locks=percent_locks;
X	if(percent_regions > max_regions) max_regions=percent_regions;
X	if(percent_callouts > max_callouts) max_callouts=percent_callouts;
X
#ifdef SVR4
#else
X	update_table_line(win, y, x, width,
X			num_files, max_files, v.v_file, percent_files);
X	update_table_line(win, y + 1, x, width,
X			num_inodes, max_inodes, v.v_inode, percent_inodes);
X	update_table_line(win, y + 2, x, width,
X			flckinfo.reccnt, max_locks, flckinfo.recs, percent_locks);
X	update_table_line(win, y + 3, x, width,
X			num_regions, max_regions, v.v_region, percent_regions);
X	update_table_line(win, y + 4, x, width,
X			num_callouts, max_callouts, v.v_call, percent_callouts);
#endif
X	return;
}	/* end of update_table */
X
X
/*+-------------------------------------------------------------------------
X	draw_table_literals(win)
00000000001111111111222222222233333333334444444444555555555566666666667777777777
01234567890123456789012345678901234567890123456789012345678901234567890123456789
Resource     actual total %used ------------------------------------------------
############   ####  ####   ### xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
--------------------------------------------------------------------------*/
void
draw_table_literals(win,y,x)
WINDOW *win;
int y;
int x;
{
int x2 = x;
X
X	wmove(win,y,x);
X	use_cp(win,cpBANNER);
X	waddstr(win,"Resource     actual total %used ");
X	getyx(win,y,x2);
X	while(x2 < COLS)
X		waddch(win,(chtype)'-'),x2++;
X	use_cp(win,cpLIT);
X	wmove(win,y + 1,x);
X  	waddstr(win,"File table ");
X	wmove(win,y + 2,x);
X  	waddstr(win,"Inode table");
X	wmove(win,y + 3,x);
X	waddstr(win,"Lock table ");
X	wmove(win,y + 4,x);
X	waddstr(win,"Region table ");
X	wmove(win,y + 5,x);
X	waddstr(win,"Callout table ");
X
}	/* end of draw_table_literals */
SHAR_EOF
echo 'File det_table.c is complete' &&
chmod 0644 det_table.c ||
echo 'restore of det_table.c failed'
Wc_c="`wc -c < 'det_table.c'`"
test 10325 -eq "$Wc_c" ||
	echo 'det_table.c: original size 10325, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= det_wd.c ==============
if test -f 'det_wd.c' -a X"$1" != X"-c"; then
	echo 'x - skipping det_wd.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting det_wd.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'det_wd.c' &&
#ifdef SCO322
/*+-------------------------------------------------------------------------
X	det_wd.c - UNIX V/386 system monitor WD disk controller usage detail
X	martin@hppcmart.grenoble.hp.com
X
00000000001111111111222222222233333333334444444444555555555566666666667777777777
01234567890123456789012345678901234567890123456789012345678901234567890123456789
Device  Av Q  r+w/s Blks/s -- (% Utilization) ----------------------------------
######  ##### ##### #####  ##################################################### 
X  Defined functions:
X
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:02-07-1991-13:30-martin@hppcmart-creation */
X
#define M_TERMINFO
X
#include <curses.h>
#include <panel.h>
#include <string.h>
#include <nlist.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ascii.h>
#include <sys/var.h>
#undef NGROUPS_MAX
#undef NULL
#include <sys/param.h>
#include <sys/elog.h>
X
#include "nlsym.h"
#include "libkmem.h"
#include "libmem.h"
#include "libswap.h"
#include "libnlsym.h"
#include "u386mon.h"
X
extern struct var v;
X
/* WD Driver */
#define NCTLR		2
#define NWD			2
#define NWDTOTAL	NCTLR*NWD
/* Floppy drives */
#define NDRIVES		4
X	
static int max_util[NWDTOTAL+NDRIVES];
static struct 	iotime	ia[NWDTOTAL+NDRIVES],ialast[NWDTOTAL+NDRIVES];
static time_t 	timelast,now;
/*+----------------------------------------------------------------------------
X	init_wd();
X	Get initial drive stats.
-----------------------------------------------------------------------------*/
void
init_wd()
{
#ifdef SVR4
#else
X	register i;
X
X	(void)time(&timelast);
X	for(i=0;i<(NWDTOTAL+NDRIVES);i++)
X		max_util[i]=0;
X	kread((caddr_t) ialast,wd1010statsaddr,sizeof(struct iotime) * NCTLR * NWD);
X	kread((caddr_t) &ialast[NWDTOTAL],flstatsaddr,sizeof(struct iotime) * NDRIVES);
#endif
}
X
/*+----------------------------------------------------------------------------
X	draw_wd_literals(win, y, x);
X
00000000001111111111222222222233333333334444444444555555555566666666667777777777
01234567890123456789012345678901234567890123456789012345678901234567890123456789
Device  Jobs/s r+w/s Blks/s -- (% Utilization) ---------------------------------
######   ##### ##### #####  ####################################################
%wd##
%fd##
-----------------------------------------------------------------------------*/
X
void
draw_wd_literals(win,y,x)
WINDOW *win;
int y,x;
X
{
#ifdef SVR4
#else
X	static char *header = 
"Device  Jobs/s r+w/s Blks/s -- (% Utilization) ";
X	int x2,ctlr,drive;
X
X	wmove(win,y,x);
X	use_cp(win,cpBANNER);
X	waddstr(win,header);
X	getyx(win,y,x2);
X	while(x2++ <= COLS)
X		waddch(win,(chtype)'-');
X	use_cp(win,cpLIT);
X	clear_area(win,getmaxy(win)-1,0,getmaxx(win));
X	for(ctlr=0; ctlr<NCTLR; ctlr++) {
X		for(drive=0; drive<NWD; drive++) {
X			mvwprintw(win,(y+(ctlr*NWD)+drive+1),x,"wd%1d%1d",ctlr,drive);
X		}
X	}
X	getyx(win,y,x2);
X	for(drive=0; drive<NDRIVES; drive++)
X		mvwprintw(win,(y+drive+1),x,"fd%1d",drive);
#endif
} 
X
/*+----------------------------------------------------------------------------
X	update_wd(win, y, x, width);
X
00000000001111111111222222222233333333334444444444555555555566666666667777777777
01234567890123456789012345678901234567890123456789012345678901234567890123456789
obs/s r+w/s Blks/s -- (% Utilization) ---------------------------------
##### ##### #####  ####################################################
-----------------------------------------------------------------------------*/
#define _WD_AQ	0
#define _WD_RW	6
#define _WD_BK	12
#define _WD_UT	19
X
void
update_wd(win,y,x,width)
WINDOW *win;
int y,x;
int width;
X
{
#ifdef SVR4
#else
X	register i;
X	time_t elapsed_secs;
X	int itmp;
X	int percent_used;
/*
X	int max;
*/
X
X	(void)time(&now);
X	elapsed_secs=now-timelast;
X	kread((caddr_t) ia,wd1010statsaddr,sizeof(struct iotime) * NCTLR * NWD);
X	kread((caddr_t) &ia[NWDTOTAL],flstatsaddr,
X			sizeof(struct iotime) * NDRIVES);
X	for(i=0; i<(NWDTOTAL+NDRIVES);i++) {
X		use_cp(win,cpINFO);
X		mvwprintw(win,y+i,_WD_AQ+x,"%5i",
X			(ia[i].io_qc-ialast[i].io_qc));
X		mvwprintw(win,y+i,_WD_RW+x,"%5i",
X			(ia[i].io_cnt-ialast[i].io_cnt));
X		itmp = ia[i].io_bcnt-ialast[i].io_bcnt;
X		mvwprintw(win,y+i,_WD_BK+x,"%5i",
X			(itmp > 99999) ? 99999 : itmp);	/* protect transient overflow */
X		wmove(win,y+i,_WD_UT+x);
X		percent_used=(ia[i].io_act-ialast[i].io_act);
X		wprintw(win,"%5i",(percent_used > 99999) ? 99999 : percent_used);
/*
X		max_util[i]=max_util[i]<percent_used ? percent_used : max_util[i];
X		if(percent_used < 70)
X			use_cp(win, cpLOW);
X		else if (percent_used < 90)
X			use_cp(win, cpMED);
X		else
X			use_cp(win, cpHIGH);
X
X		itmp = (width * percent_used) / 100;
X		max = (width * max_util[i]) / 100;
X		while(-1) {
X			itmp--;max--;
X			if (max<1) {
X				use_cp(win, cpHIGH);
X				waddch(win, (chtype)'M');
X				break;
X			}
X			if (itmp>-1)
X				waddch(win, (chtype)'-');
X			else
X				waddch(win, (chtype)' ');
X		}
X
X		wclrtoeol(win);
*/
X	}
X	memcpy((char *)ialast,(char *)ia,
X		sizeof(struct iotime) * (NWDTOTAL + NDRIVES));
X	timelast=now;
#endif
}
#endif
SHAR_EOF
chmod 0644 det_wd.c ||
echo 'restore of det_wd.c failed'
Wc_c="`wc -c < 'det_wd.c'`"
test 5112 -eq "$Wc_c" ||
	echo 'det_wd.c: original size 5112, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= disputil.c ==============
if test -f 'disputil.c' -a X"$1" != X"-c"; then
	echo 'x - skipping disputil.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting disputil.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'disputil.c' &&
/*+-------------------------------------------------------------------------
X	disputil.c - u386mon display utilities
X
X  Defined functions:
X	clear_area(win,y,x,len)
X	clear_area_char(win,y,x,len,fillchar)
X	disp_info_int(win,label,fmt,value)
X	disp_info_long(win,label,fmt,value)
X	disp_msg(cp,msg)
X	disp_static_int(win,label,fmt,value)
X	disp_static_long(win,label,fmt,value)
X	mkpanel(rows,cols,tly,tlx,userp)
X	pflush()
X	wperror(win,desc)
X
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:07-10-1990-19:06-root@n4hgf-redesign attributes/color pairs */
/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
/*:06-17-1990-15:15-wht-creation */
X
#include "config.h"
#define M_TERMINFO
#include <curses.h>
#undef timeout
#undef reg     /* per nba@sysware.dk */
#ifdef NATIVE_PANELS
# include <panel.h>
#else
# include "libpanel.h"
#endif
#include <sys/types.h>
#include "u386mon.h"
X
#ifdef COLOR_PAIR
long color_attr[] =
{
X	COLOR_PAIR(0),
X	COLOR_PAIR(cpINFO),
X	COLOR_PAIR(cpREVERSE),
X	COLOR_PAIR(cpBANWARN),
X	COLOR_PAIR(cpLOW) | A_BOLD,
X	COLOR_PAIR(cpMED) | A_BOLD,
X	COLOR_PAIR(cpHIGH),
X	COLOR_PAIR(cpBANNER),
X	COLOR_PAIR(cpLIT),
X	0
};
#endif
X
long mono_attr[] =
{
X	0,						/* 0 */
X	0,						/* cpINFO */
X	A_REVERSE,				/* cpREVERSE */
X	A_BOLD,			 		/* cpBANWARN */
X	0,						/* cpLOW */
X	A_UNDERLINE,			/* cpMED */
X	A_BLINK,				/* cpHIGH */
X	A_REVERSE,				/* cpBANNER */
X	A_DIM,					/* cpLIT */
};
X
extern WINDOW *wdet, *wscr;
X
/*+-------------------------------------------------------------------------
X	clear_area_char(win,y,x,len,fillchar)
--------------------------------------------------------------------------*/
void
clear_area_char(win,y,x,len,fillchar)
WINDOW *win;
int y;
int x;
int len;
u_char fillchar;
{
X	wmove(win,y,x);
X	while(len-- > 0)
X		waddch(win,(chtype)fillchar);
X	wmove(win,y,x);
X
}	/* end of clear_area_char */
X
/*+-------------------------------------------------------------------------
X	clear_area(win,y,x,len)
--------------------------------------------------------------------------*/
void
clear_area(win,y,x,len)
WINDOW *win;
int y;
int x;
int len;
{
X	clear_area_char(win,y,x,len,' ');
}	/* end of clear_area_char */
X
/*+-------------------------------------------------------------------------
X	pflush() - do update_panels() and doupdate()
--------------------------------------------------------------------------*/
void
pflush()
{
X	update_panels();
X	curs_set(0);
X	doupdate();
X	curs_set(1);
}	/* end of pflush */
X
/*+-------------------------------------------------------------------------
X	wperror(win,desc)
--------------------------------------------------------------------------*/
void
wperror(win,desc)
WINDOW *win;
char *desc;
{
extern int errno;
extern int sys_nerr;
extern char *sys_errlist[];
X
X	waddstr(win,desc);
X	waddstr(win,": ");
X	if(errno < sys_nerr)
X		waddstr(win,sys_errlist[errno]);
X	else
X		wprintw(win,"error %u",errno);
X
}	/* end of wperror */
X
/*+-------------------------------------------------------------------------
X	mkpanel(rows,cols,tly,tlx,userp) - alloc win and pan and associate them
--------------------------------------------------------------------------*/
PANEL *
mkpanel(rows,cols,tly,tlx,userp)
int rows;
int cols;
int tly;
int tlx;
char *userp;
{
WINDOW *win = newwin(rows,cols,tly,tlx);
PANEL *pan;
X
X	if(!win)
X		return((PANEL *)0);
X	if(pan = new_panel(win))
X	{
X		set_panel_userptr(pan,userp);
X		return(pan);
X	}
X	delwin(win);
X	return((PANEL *)0);
}	/* end of mkpanel */
X
/*+-------------------------------------------------------------------------
X	disp_info_long(win,label,fmt,value)
--------------------------------------------------------------------------*/
void
disp_info_long(win,label,fmt,value)
WINDOW *win;
char *label;
char *fmt;
long value;
{
X	use_cp(win,cpLIT);
X	waddstr(win,label);
X	use_cp(win,cpINFO);
X	wprintw(win,fmt,value);
}	/* end of disp_info_long */
X
/*+-------------------------------------------------------------------------
X	disp_info_int(win,label,fmt,value)
--------------------------------------------------------------------------*/
void
disp_info_int(win,label,fmt,value)
WINDOW *win;
char *label;
char *fmt;
int value;
{
X	use_cp(win,cpLIT);
X	waddstr(win,label);
X	use_cp(win,cpINFO);
X	wprintw(win,fmt,value);
}	/* end of disp_info_int */
X
/*+-------------------------------------------------------------------------
X	disp_static_long(win,label,fmt,value)
--------------------------------------------------------------------------*/
void
disp_static_long(win,label,fmt,value)
WINDOW *win;
char *label;
char *fmt;
long value;
{
X	use_cp(win,cpLIT);
X	waddstr(win,label);
X	wprintw(win,fmt,value);
}	/* end of disp_static_long */
X
/*+-------------------------------------------------------------------------
X	disp_static_int(win,label,fmt,value)
--------------------------------------------------------------------------*/
void
disp_static_int(win,label,fmt,value)
WINDOW *win;
char *label;
char *fmt;
int value;
{
X	use_cp(win,cpLIT);
X	waddstr(win,label);
X	wprintw(win,fmt,value);
}	/* end of disp_static_int */
X
/*+-------------------------------------------------------------------------
X	disp_msg(cp,msg)
--------------------------------------------------------------------------*/
void
disp_msg(cp,msg)
chtype cp;
char *msg;
{
extern WINDOW *wscr;
int y;
register int x;
X
X	wmove(wscr,MSG_TLY,0);
X	use_cp(wscr,cp);
X	waddstr(wscr,msg);
X	getyx(wscr,y,x);
X	while(x < getmaxx(wscr))
X		waddch(wscr,(chtype)' '),x++;
}	/* end of disp_msg */
X
/* vi: set tabstop=4 shiftwidth=4: */
/* end of disputil.c */
SHAR_EOF
chmod 0644 disputil.c ||
echo 'restore of disputil.c failed'
Wc_c="`wc -c < 'disputil.c'`"
test 6085 -eq "$Wc_c" ||
	echo 'disputil.c: original size 6085, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= kludge.c ==============
if test -f 'kludge.c' -a X"$1" != X"-c"; then
	echo 'x - skipping kludge.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting kludge.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'kludge.c' &&
X
/*+-------------------------------------------------------------------------
X	kludge.c - u386mon KLUDGE
X
We want S5R3 curses #define PERFORMANCE because it has several macro
replacements for functions, but one of the macros has a bug in it.  The
macro has_colors() refers to an undefined 'max_pairs' ...  in the interest
of speed, we do the has_colors() call here and get the function
has_colors() without the bogus extern reference.
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-03-1990-05:04-wht-creation */
X
#define M_TERMINFO
#include <curses.h>
X
/*+-------------------------------------------------------------------------
X	has_colors_kludge() - don't ask
--------------------------------------------------------------------------*/
#if defined(COLOR_PAIR)
void
has_colors_kludge()
{
extern int color_avail;
X	color_avail = has_colors();
}	/* end of has_colors_kludge */
#endif
X
/* vi: set tabstop=4 shiftwidth=4: */
/* end of kludge.c */
SHAR_EOF
chmod 0644 kludge.c ||
echo 'restore of kludge.c failed'
Wc_c="`wc -c < 'kludge.c'`"
test 1194 -eq "$Wc_c" ||
	echo 'kludge.c: original size 1194, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= libkmem.c ==============
if test -f 'libkmem.c' -a X"$1" != X"-c"; then
	echo 'x - skipping libkmem.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting libkmem.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'libkmem.c' &&
/*LINTLIBRARY*/
/*+-------------------------------------------------------------------------
X	libkmem.c -- /dev/kmem routines for SCO UNIX/386 (maybe other *NIX)
X	...!{gatech,emory}!n4hgf!wht
X
X  Defined functions:
X	kinit(write_needed)
X	kread(caddr,kaddr,len)
X	kwrite(kaddr,caddr,len)
X
X routines were originally written by Mike "Ford" Ditto: kudos!!!
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:08-01-1990-19:33-jdc@dell.com-add more error text */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
/*:12-07-1988-22:06-wht-put in test for initialized fdkmem */
/*:10-27-1988-22:44-wht-creation of file */
X
#include <sys/types.h>
#include <sys/errno.h>
#include <fcntl.h>
#include "libkmem.h"
X
void leave_text();
X
extern int errno;
X
static int fdkmem = -2;
daddr_t lseek();
X
/*+-------------------------------------------------------------------------
X	kinit(write_needed)
--------------------------------------------------------------------------*/
void
kinit(write_needed)
int write_needed;
{
X	if(fdkmem >= 0)
X		return;
X	if((fdkmem=open("/dev/kmem",(write_needed) ? O_RDWR : O_RDONLY,0)) < 0)
X	{
X		if (write_needed)
X		{
X			leave_text("can't open /dev/kmem for read/write access",255);
X		}
X		else
X		{
X			leave_text("can't open /dev/kmem for read access",255);
X		}
X	}
X
}	/* end of kinit */
X
/*+-------------------------------------------------------------------------
X	kread(caddr,kaddr,len)
--------------------------------------------------------------------------*/
void
kread(caddr,kaddr,len)
caddr_t caddr;
daddr_t kaddr;
int len;
{
char s80[80];
extern daddr_t myreadlen;
extern int myreadcnt;
X
#if defined(M_I286)
X	kaddr &= 0xFFFFL;
#endif
#if defined(mips)
X	kaddr &= 0x7FFFFFFFL;
#endif
X
X	if(fdkmem == -2)
X		leave_text("kinit() not called",1);
X
X	if(lseek(fdkmem,kaddr,0) == -1L)
X	{
X		(void)sprintf(s80,"kmem read seek error addr %08lx",kaddr);
X		leave_text(s80,255);
X	}
X
X	if(read(fdkmem,caddr,len) != len)
X	{
X		(void)sprintf(s80,"kmem read error len %d addr %08lx",len,kaddr);
X		leave_text(s80,255);
X	}
X	myreadlen += len;
X	myreadcnt++;
}	/* end of kread */
X
/*+-------------------------------------------------------------------------
X	kwrite(kaddr,caddr,len)
--------------------------------------------------------------------------*/
#ifdef KWRITE_NEEDED
void
kwrite(kaddr,caddr,len)
daddr_t kaddr;
caddr_t caddr;
int len;
{
char s80[80];
X
#if defined(M_I286)
X	kaddr &= 0xFFFFL;
#endif
X
X	if(fdkmem == -2)
X		leave_text("kinit() not called",1);
X
X	if(lseek(fdkmem,kaddr,0) == -1L)
X	{
X		(void)sprintf(s80,
X			"/dev/kmem write seek error addr %08lx",kaddr);
X		leave_text(s80,255);
X	}
X	if(write(fdkmem,caddr,len) != len)
X	{
X		(void)sprintf(s80,
X			"/dev/kmem write error addr %08lx len %08lx",kaddr,len);
X		leave_text(s80,255);
X	}
}	/* end of kwrite */
#endif
X
/* vi: set tabstop=4 shiftwidth=4: */
SHAR_EOF
chmod 0644 libkmem.c ||
echo 'restore of libkmem.c failed'
Wc_c="`wc -c < 'libkmem.c'`"
test 3407 -eq "$Wc_c" ||
	echo 'libkmem.c: original size 3407, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= libmem.c ==============
if test -f 'libmem.c' -a X"$1" != X"-c"; then
	echo 'x - skipping libmem.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting libmem.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'libmem.c' &&
/*LINTLIBRARY*/
/*+-------------------------------------------------------------------------
X	libmem.c -- /dev/mem routines for SCO UNIX/386 (maybe other *NIX)
X	...!{gatech,emory}!n4hgf!wht
X
X  Defined functions:
X	minit(write_needed)
X	mread(caddr,maddr,len)
X	mwrite(maddr,caddr,len)
X
X routines were originally written by Mike "Ford" Ditto: kudos!!!
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
/*:12-07-1988-22:06-wht-put in test for initialized fdmem */
/*:10-27-1988-22:44-wht-creation of file */
X
#include <sys/types.h>
#include <fcntl.h>
#include "libmem.h"
X
void leave_text();
X
extern int errno;
X
static int fdmem = -2;
daddr_t lseek();
X
/*+-------------------------------------------------------------------------
X	minit(write_needed)
--------------------------------------------------------------------------*/
void
minit(write_needed)
int write_needed;
{
X	if(fdmem >= 0)
X		return;
X	if((fdmem=open("/dev/mem",(write_needed) ? O_RDWR : O_RDONLY,0)) < 0)
X		leave_text("can't open /dev/mem",255);
X
}	/* end of minit */
X
/*+-------------------------------------------------------------------------
X	mread(caddr,maddr,len)
--------------------------------------------------------------------------*/
void
mread(caddr,maddr,len)
caddr_t caddr;
daddr_t maddr;
int len;
{
char s80[80];
extern daddr_t myreadlen;
extern int myreadcnt;
X
#if defined(M_I286)
X	maddr &= 0xFFFFL;
#endif
X
X	if(fdmem == -2)
X		leave_text("minit() not called",1);
X
X	if(lseek(fdmem,maddr,0) == -1L)
X	{
X		(void)sprintf(s80,"mem seek err (%08lx)",maddr);
X		leave_text(s80,1);
X	}
X
X	if(read(fdmem,caddr,len) != len)
X	{
X		(void)sprintf(s80,
X			"mem read errno %d len %d addr %08lx",errno,len,maddr);
X		leave_text(s80,1);
X	}
X	myreadlen += len;
X	myreadcnt++;
}	/* end of mread */
X
/*+-------------------------------------------------------------------------
X	mwrite(maddr,caddr,len)
--------------------------------------------------------------------------*/
#ifdef MWRITE_NEEDED
void
mwrite(maddr,caddr,len)
daddr_t maddr;
caddr_t caddr;
int len;
{
char s80[80];
X
#if defined(M_I286)
X	maddr &= 0xFFFFL;
#endif
X
X	if(fdmem == -2)
X		leave_text("minit() not called",1);
X
X	if(lseek(fdkmem,kaddr,0) == -1L)
X	{
X		(void)sprintf(s80,
X			"/dev/kmem seek error addr %08lx",kaddr);
X		leave_text(s80,255);
X	}
X	if(write(fdkmem,caddr,len) != len)
X	{
X		(void)sprintf(s80,
X			"/dev/kmem write error addr %08lx len %08lx",kaddr,len);
X		leave_text(s80,255);
X	}
}	/* end of mwrite */
#endif /* MWRITE_NEEDED */
X
/* vi: set tabstop=4 shiftwidth=4: */
SHAR_EOF
chmod 0644 libmem.c ||
echo 'restore of libmem.c failed'
Wc_c="`wc -c < 'libmem.c'`"
test 3147 -eq "$Wc_c" ||
	echo 'libmem.c: original size 3147, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= libpanel.c ==============
if test -f 'libpanel.c' -a X"$1" != X"-c"; then
	echo 'x - skipping libpanel.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting libpanel.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'libpanel.c' &&
/*LINTLIBRARY*/
/*+-------------------------------------------------------------------------
X	libpanel.c - panel support for u386mon
X	wht@n4hgf.Mt-Park.GA.US
X
X  This module is not an efficient replacement for the SVR3.2 panel
X  facility.  It is, however, fully featured and serves the needs of
X  u386mon, assisting a port to SVR3.1.  It seems efficient enough to
X  use in lieu of native (vendor-supplied) panels.
X
X  To use a native panels library, use -DNATIVE_PANELS, omit libpanel.o
X  from OBJ, and compile the whole of u386mon, linking with -lpanel.
X
X  Some auld curses do not have is_linetouched() and is_wintouched().
X  Defining NO_ISTOUCH will turn on some brain-damaged attempts at
X  supplying these routines.
X
X  Defined functions:
X	Touchline(pan,start,count)
X	Touchpan(pan)
X	Wnoutrefresh(pan)
X	__calculate_obscure()
X	__free_obscure(pan)
X	__override(pan,show)
X	__panel_is_linked(pan)
X	__panel_link_bottom(pan)
X	__panel_link_top(pan)
X	__panel_unlink(pan)
X	__panels_overlapped(pan1,pan2)
X	bottom_panel(pan)
X	dPanel(text,pan)
X	dStack(fmt,num,pan)
X	del_panel(pan)
X	hide_panel(pan)
X	is_linetouched(win,line)
X	is_wintouched(win)
X	move_panel(pan,starty,startx)
X	new_panel(win)
X	open_dfp()
X	panel_above(pan)
X	panel_below(pan)
X	panel_hidden(pan)
X	panel_userptr(pan)
X	panel_window(pan)
X	replace_panel(pan,win)
X	set_panel_userptr(pan,uptr)
X	show_panel(pan)
X	top_panel(pan)
X	update_panels()
X
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:08-02-1990-14:55-wht@n4hgf-add is_linetouched/is_wintouched hacks */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:07-23-1990-05:25-wht@n4hgf-needed __override call in update_panels */
/*:07-23-1990-00:56-wht@n4hgf-full library working */
/*:07-21-1990-22:37-wht@n4hgf-flush out rest of routines */
/*:07-20-1990-18:58-wht-creation */
X
#include "config.h"
X
#if !defined(NATIVE_PANELS)
#define M_TERMINFO
#include <curses.h>
# include "libpanel.h"
#ifdef U386MON
#include "u386mon.h"
#endif
X
#ifdef __STDC__
#ifdef LINT_ARGS	/* use Microsoft "ANSI" prototypes
X					 * (the "best" divination of the "standard")
X					 */
void *malloc(int);
void free(void *);
#else	/* LINT_ARGS */
void *malloc();
void free();
#endif	/* LINT_ARGS */
#else	/* __STDC__ */
char *malloc();
void free();
#endif	/* __STDC__ */
X
PANEL *__bottom_panel = (PANEL *)0;
PANEL *__top_panel = (PANEL *)0;
PANEL __stdscr_pseudo_panel = { (WINDOW *)0 };
X
#ifndef lint
/*
X * I don't like lint, but some do, so we try to calm the
X * nervous bastard (lint, that is); I only get the notorious
X * "warning: possible pointer alignment problem" on two
X * usages of malloc.
X */
static char pident[] = "@(#) wht@n4hgf libpanel.c 1.2 07/23/90";
#endif
X
#define STATIC static
X
#ifdef PANEL_DEBUG
FILE *dfp = (FILE *)0;
FILE *open_dfp()
{
X	if(!dfp)
X	{
X		dfp = fopen("p.log","w");
X		fputs("-------\n",dfp);
X	}
X	return(dfp);
}
#define dBug(fmt,p1,p2) fprintf(open_dfp(),(fmt),(p1),(p2))
#else
#define dBug(fmt,p1,p2)
#endif
X
/*+-------------------------------------------------------------------------
X	dPanel(text,pan)
--------------------------------------------------------------------------*/
#ifdef PANEL_DEBUG
dPanel(text,pan)
char *text;
PANEL *pan;
{
X	open_dfp();
X	fprintf(dfp,"%s id=%s b=%s a=%s y=%d x=%d\n",
X		text,pan->user,
X		(pan->below) ? pan->below->user : "--",
X		(pan->above) ? pan->above->user : "--",
X		pan->wstarty, pan->wstartx);
X	fflush(dfp);
}	/* end of dPanel */
#else
#define dPanel(text,pan)
#endif
X
/*+-------------------------------------------------------------------------
X	dStack(fmt,num,pan)
--------------------------------------------------------------------------*/
#ifdef PANEL_DEBUG
void
dStack(fmt,num,pan)
char *fmt;
int num;
PANEL *pan;
{
char s80[80];
X
X	open_dfp();
X	sprintf(s80,fmt,num,pan);
X	fprintf(dfp,"%s b=%s t=%s\n",s80,
X		(__bottom_panel) ? __bottom_panel->user : "--",
X		(__top_panel)    ? __top_panel->user    : "--");
X	if(pan)
X		fprintf(dfp,"pan id=%s\n",pan->user);
X	pan = __bottom_panel;
X	while(pan)
X	{
X		dPanel("stk",pan);
X		pan = pan->above;
X	}
X	if(num == 9)
X		fprintf(dfp,"\n");
X
X	fflush(dfp);
}	/* end of dStack */
#else
#define dStack(fmt,num,pan)
#endif
X
/*+-------------------------------------------------------------------------
X	Wnoutrefresh(pan) - debugging hook for wnoutrefresh
--------------------------------------------------------------------------*/
#ifdef PANEL_DEBUG
STATIC int
Wnoutrefresh(pan)
PANEL *pan;
{
X	dPanel("wnoutrefresh",pan);
X	wnoutrefresh(pan->win);
}	/* end of Wnoutrefresh */
#else
#define Wnoutrefresh(pan) wnoutrefresh((pan)->win)
#endif
X
/*+-------------------------------------------------------------------------
X	Touchpan(pan)
--------------------------------------------------------------------------*/
#ifdef PANEL_DEBUG
STATIC int
Touchpan(pan)
PANEL *pan;
{
X	dPanel("Touchpan",pan);
X	touchwin(pan->win);
}	/* end of Touchpan */
#else
#define Touchpan(pan) touchwin((pan)->win)
#endif
X
/*+-------------------------------------------------------------------------
X	Touchline(pan,start,count)
--------------------------------------------------------------------------*/
#ifdef PANEL_DEBUG
STATIC int
Touchline(pan,start,count)
PANEL *pan;
int start;
int count;
{
char s80[80];
X	sprintf(s80,"Touchline s=%d c=%d",start,count);
X	dPanel(s80,pan);
X	touchline(pan->win,start,count);
}	/* end of Touchline */
#else
#define Touchline(pan,start,count) touchline((pan)->win,start,count)
#endif
X
/*+-------------------------------------------------------------------------
X	is_linetouched(win,line) - check to see if line has been touched
I don't know much about this - no guarantees - comments appreciated
--------------------------------------------------------------------------*/
#ifdef NO_ISTOUCH
int
is_linetouched(win,line)
WINDOW *win;
int line;
{
X	if(!win || (getmaxy(win) <= line) || (line < 0))
X		return(ERR);
#ifdef _INFINITY
X    return((win->_firstch[line] == _INFINITY) ? FALSE : TRUE);
#else /* _INFINITY */
#ifdef _NOCHANGE
X    return(((win->_lastch[line] == _NOCHANGE) ||
X    		(win->_firstch[line] == _NOCHANGE))
X			? FALSE : TRUE);
#else /* _NOCHANGE */
X    return((win->_firstch[line] >= getmaxx(win)) ? FALSE : TRUE);
#endif /* _NOCHANGE */
#endif	/* _INFINITY */
}	/* end of is_linetouched */
#endif /* NO_ISTOUCH */
X
/*+-------------------------------------------------------------------------
X	is_wintouched(win) - check to see if window has been touched
I don't know much about this - no guarantees - comments appreciated
--------------------------------------------------------------------------*/
#ifdef NO_ISTOUCH
int
is_wintouched(win)
WINDOW *win;
{
#ifdef _WINCHANGED
X	if(!win)
X		return(ERR);
X	return((win->_flags & _WINCHANGED) ? TRUE : FALSE);
#else /* _WINCHANGED */
register int line;
X
X	if(!win)
X		return(ERR);
X	/*
X	 * could not discover a _WINCHANGED analog in old curses
X	 */
X	for(line = 0; line < getmaxy(win); line++)
X	{
X		if(is_linetouched(win,line))
X			return(TRUE);
X	}
X	return(FALSE);
#endif /* _WINCHANGED */
X
}	/* end of is_wintouched */
#endif /* NO_ISTOUCH */
X
/*+-------------------------------------------------------------------------
X	__panels_overlapped(pan1,pan2) - check panel overlapped
--------------------------------------------------------------------------*/
STATIC int
__panels_overlapped(pan1,pan2)
register PANEL *pan1;
register PANEL *pan2;
{
X	if(!pan1 || !pan2)
X		return(0);
X	dBug("__panels_overlapped %s %s\n",pan1->user,pan2->user);
X	if((pan1->wstarty >= pan2->wstarty) && (pan1->wstarty < pan2->wendy) &&
X		(pan1->wstartx >= pan2->wstartx) && (pan1->wstartx < pan2->wendx))
X		return(1);
X	if((pan1->wstarty >= pan1->wstarty) && (pan2->wstarty < pan1->wendy) &&
X		(pan1->wstartx >= pan1->wstartx) && (pan2->wstartx < pan1->wendx))
X		return(1);
X	dBug("  no\n",0,0);
X	return(0);
}	/* end of __panels_overlapped */
X
/*+-------------------------------------------------------------------------
X	__free_obscure(pan)
--------------------------------------------------------------------------*/
STATIC void
__free_obscure(pan)
PANEL *pan;
{
PANELOBS *tobs = pan->obscure;				/* "this" one */
PANELOBS *nobs;								/* "next" one */
X
X	while(tobs)
X	{
X		nobs = tobs->above;
X		free((char *)tobs);
X		tobs = nobs;
X	}
X	pan->obscure = (PANELOBS *)0;
}	/* end of __free_obscure */
X
/*+-------------------------------------------------------------------------
X	__override(pan,show)
--------------------------------------------------------------------------*/
STATIC void
__override(pan,show)
PANEL *pan;
int show;
{
register y;
register PANEL *pan2;
PANELOBS *tobs = pan->obscure;				/* "this" one */
X
X	dBug("__override %s,%d\n",pan->user,show);
X
X	if(show == 1)
X		Touchpan(pan);
X	else if(!show)
X	{
X		Touchpan(pan);
/*
X		Touchline(&__stdscr_pseudo_panel,pan->wendy,getmaxy(pan->win));
*/
X		Touchpan(&__stdscr_pseudo_panel);
X	}
X	else if(show == -1)
X	{
X		while(tobs && (tobs->pan != pan))
X			tobs = tobs->above;
X	}
X
X	while(tobs)
X	{
X		if((pan2 = tobs->pan) != pan)
X		{
X			dBug("test obs pan=%s pan2=%s\n",pan->user,pan2->user);
X			for(y = pan->wstarty; y < pan->wendy; y++)
X			{
X				if( (y >= pan2->wstarty) && (y < pan2->wendy) &&
X					((is_linetouched(pan->win,y - pan->wstarty) == 1) ||
X					(is_linetouched(stdscr,y) == 1)))
X				{
X					Touchline(pan2,y - pan2->wstarty,1);
X				}
X			}
X		}
X		tobs = tobs->above;
X	}
}	/* end of __override */
X
/*+-------------------------------------------------------------------------
X	__calculate_obscure()
--------------------------------------------------------------------------*/
STATIC void
__calculate_obscure()
{
PANEL *pan;
register PANEL *pan2;
register PANELOBS *tobs;			/* "this" one */
PANELOBS *lobs = (PANELOBS *)0;		/* last one */
X
X	pan = __bottom_panel;
X	while(pan)
X	{
X		if(pan->obscure)
X			__free_obscure(pan);
X		dBug("--> __calculate_obscure %s\n",pan->user,0);
X		lobs = (PANELOBS *)0;		/* last one */
X		pan2 = __bottom_panel;
X		while(pan2)
X		{
X			if(__panels_overlapped(pan,pan2))
X			{
X				if(!(tobs = (PANELOBS *)malloc(sizeof(PANELOBS))))
X					return;
X				tobs->pan = pan2;
X				dPanel("obscured",pan2);
X				tobs->above = (PANELOBS *)0;
X				if(lobs)
X					lobs->above = tobs;
X				else
X					pan->obscure = tobs;
X				lobs  = tobs;
X			}
X			pan2 = pan2->above;
X		}
X		__override(pan,1);
X		pan = pan->above;
X	}
X
}	/* end of __calculate_obscure */
X
/*+-------------------------------------------------------------------------
X	__panel_is_linked(pan) - check to see if panel is in the stack
--------------------------------------------------------------------------*/
STATIC int
__panel_is_linked(pan)
PANEL *pan;
{
register PANEL *pan2 = __bottom_panel;
X
X	while(pan2)
X	{
X		if(pan2 == pan)
X			return(1);
X		pan2 = pan2->above;
X	}
X	return(OK);
}	/* end of __panel_is_linked */
X
/*+-------------------------------------------------------------------------
X	__panel_link_top(pan) - link panel into stack at top
--------------------------------------------------------------------------*/
STATIC void
__panel_link_top(pan)
PANEL *pan;
{
X
#ifdef PANEL_DEBUG
X	dStack("<lt%d>",1,pan);
X	if(__panel_is_linked(pan))
X		return;
#endif
X
X	pan->above = (PANEL *)0;
X	pan->below = (PANEL *)0;
X	if(__top_panel)
X	{
X		__top_panel->above = pan;
X		pan->below = __top_panel;
X	}
X	__top_panel = pan;
X	if(!__bottom_panel)
X		__bottom_panel = pan;
X	__calculate_obscure();
X	dStack("<lt%d>",9,pan);
X
}	/* end of __panel_link_top */
X
/*+-------------------------------------------------------------------------
X	__panel_link_bottom(pan) - link panel into stack at bottom
--------------------------------------------------------------------------*/
STATIC void
__panel_link_bottom(pan)
PANEL *pan;
{
X
#ifdef PANEL_DEBUG
X	dStack("<lb%d>",1,pan);
X	if(__panel_is_linked(pan))
X		return;
#endif
X
X	pan->above = (PANEL *)0;
X	pan->below = (PANEL *)0;
X	if(__bottom_panel)
X	{
X		__bottom_panel->below = pan;
X		pan->above = __bottom_panel;
X	}
X	__bottom_panel = pan;
X	if(!__top_panel)
X		__top_panel = pan;
X	__calculate_obscure();
X	dStack("<lb%d>",9,pan);
X
}	/* end of __panel_link_bottom */
X
/*+-------------------------------------------------------------------------
X	__panel_unlink(pan) - unlink panel from stack
--------------------------------------------------------------------------*/
STATIC void
__panel_unlink(pan)
PANEL *pan;
{
register PANEL *prev;
register PANEL *next;
X
#ifdef PANEL_DEBUG
X	dStack("<u%d>",1,pan);
X	if(!__panel_is_linked(pan))
X		return;
#endif
X
X	__override(pan,0);
X	__free_obscure(pan);
X
X	prev = pan->below;
X	next = pan->above;
X
X	if(prev)		/* if non-zero, we will not update the list head */
X	{
X		prev->above = next;
X		if(next)
X			next->below = prev;
X	}
X	else if(next)
X		next->below = prev;
X	if(pan == __bottom_panel)
X		__bottom_panel = next;
X	if(pan == __top_panel)
X		__top_panel = prev;
X
X	__calculate_obscure();
X
X	pan->above = (PANEL *)0;
X	pan->below = (PANEL *)0;
X	dStack("<u%d>",9,pan);
X
}	/* end of __panel_unlink */
X
/*+-------------------------------------------------------------------------
X	panel_window(pan) - get window associated with panel
--------------------------------------------------------------------------*/
WINDOW *
panel_window(pan)
PANEL *pan;
{
X	return(pan->win);
}	/* end of panel_window */
X
/*+-------------------------------------------------------------------------
X	update_panels() - wnoutrefresh windows in an orderly fashion
--------------------------------------------------------------------------*/
void
update_panels()
{
PANEL *pan;
X
X	dBug("--> update_panels\n",0,0);
X	pan = __bottom_panel;
X	while(pan)
X	{
X		__override(pan,-1);
X		pan = pan->above;
X	}
X
X	if(is_wintouched(stdscr))
X		Wnoutrefresh(&__stdscr_pseudo_panel);
X	
X	if(pan = __bottom_panel)
X	{
X		while(pan)
X		{
X			if(is_wintouched(pan->win))
X				Wnoutrefresh(pan);
X			pan = pan->above;
X		}
X	}
}	/* end of update_panels */
X
/*+-------------------------------------------------------------------------
X	hide_panel(pan) - remove a panel from stack
--------------------------------------------------------------------------*/
int
hide_panel(pan)
register PANEL *pan;
{
X
X	if(!pan)
X		return(ERR);
X
X	dBug("--> hide_panel %s\n",pan->user,0);
X
X	if(!__panel_is_linked(pan))
X	{
X		pan->above = (PANEL *)0;
X		pan->below = (PANEL *)0;
X		return(ERR);
X	}
X
X	__panel_unlink(pan);
X
X	return(OK);
}	/* end of hide_panel */
X
/*+-------------------------------------------------------------------------
X	show_panel(pan) - place a panel on top of stack
may already be in stack
--------------------------------------------------------------------------*/
int
show_panel(pan)
register PANEL *pan;
{
X
X	if(!pan)
X		return(ERR);
X	if(pan == __top_panel)
X		return(OK);
X	dBug("--> show_panel %s\n",pan->user,0);
X	if(__panel_is_linked(pan))
X		(void)hide_panel(pan);
X	__panel_link_top(pan);
X	return(OK);
}	/* end of show_panel */
X
/*+-------------------------------------------------------------------------
X	top_panel(pan) - place a panel on top of stack
--------------------------------------------------------------------------*/
int
top_panel(pan)
register PANEL *pan;
{
X	return(show_panel(pan));
}	/* end of top_panel */
X
/*+-------------------------------------------------------------------------
X	del_panel(pan) - remove a panel from stack, if in it, and free struct
--------------------------------------------------------------------------*/
int
del_panel(pan)
register PANEL *pan;
{
X	if(pan)
X	{
X		dBug("--> del_panel %s\n",pan->user,0);
X		if(__panel_is_linked(pan))
X			(void)hide_panel(pan);
X		free((char *)pan);
X		return(OK);
X	}
X	return(ERR);
}	/* end of del_panel */
X
/*+-------------------------------------------------------------------------
X	bottom_panel(pan) - place a panel on bottom of stack
may already be in stack
--------------------------------------------------------------------------*/
int
bottom_panel(pan)
register PANEL *pan;
{
X	if(!pan)
X		return(ERR);
X	if(pan == __bottom_panel)
X		return(OK);
X	dBug("--> bottom_panel %s\n",pan->user,0);
X	if(__panel_is_linked(pan))
X		(void)hide_panel(pan);
X	__panel_link_bottom(pan);
X	return(OK);
}	/* end of bottom_panel */
X
/*+-------------------------------------------------------------------------
X	new_panel(win) - create a panel and place on top of stack
--------------------------------------------------------------------------*/
PANEL *
new_panel(win)
WINDOW *win;
{
PANEL *pan = (PANEL *)malloc(sizeof(PANEL));
X
X	if(!__stdscr_pseudo_panel.win)
X	{
X		__stdscr_pseudo_panel.win = stdscr;
X		__stdscr_pseudo_panel.wstarty = 0;
X		__stdscr_pseudo_panel.wstartx = 0;
X		__stdscr_pseudo_panel.wendy = LINES;
X		__stdscr_pseudo_panel.wendx = COLS;
X		__stdscr_pseudo_panel.user = "stdscr";
X		__stdscr_pseudo_panel.obscure = (PANELOBS *)0;
X	}
X
X	if(pan)
X	{
X		pan->win = win;
X		pan->above = (PANEL *)0;
X		pan->below = (PANEL *)0;
X		pan->wstarty = getbegy(win);
X		pan->wstartx = getbegx(win);
X		pan->wendy = pan->wstarty + getmaxy(win);
X		pan->wendx = pan->wstartx + getmaxx(win);
#ifdef PANEL_DEBUG
X		pan->user = "new";
#else
X		pan->user = (char *)0;
#endif
X		pan->obscure = (PANELOBS *)0;
X		(void)show_panel(pan);
X	}
X
X	return(pan);
}	/* end of new_panel */
X
/*+-------------------------------------------------------------------------
X	panel_above(pan)
--------------------------------------------------------------------------*/
PANEL *
panel_above(pan)
PANEL *pan;
{
X	if(!pan)
X		return(__bottom_panel);
X	else
X		return(pan->above);
}	/* end of panel_above */
X
/*+-------------------------------------------------------------------------
X	panel_below(pan)
--------------------------------------------------------------------------*/
PANEL *
panel_below(pan)
PANEL *pan;
{
X	if(!pan)
X		return(__top_panel);
X	else
X		return(pan->below);
}	/* end of panel_below */
X
/*+-------------------------------------------------------------------------
X	set_panel_userptr(pan,uptr)
--------------------------------------------------------------------------*/
int
set_panel_userptr(pan,uptr)
PANEL *pan;
char *uptr;
{
X	if(!pan)
X		return(ERR);
X	pan->user = uptr;
X	return(OK);
}	/* end of set_panel_userptr */
X
/*+-------------------------------------------------------------------------
X	panel_userptr(pan)
--------------------------------------------------------------------------*/
char *
panel_userptr(pan)
PANEL *pan;
{
X	if(!pan)
X		return((char *)0);
X	return(pan->user);
}	/* end of panel_userptr */
X
/*+-------------------------------------------------------------------------
X	move_panel(pan,starty,startx)
--------------------------------------------------------------------------*/
int
move_panel(pan,starty,startx)
PANEL *pan;
int starty;
int startx;
{
WINDOW *win;
X
X	if(!pan)
X		return(ERR);
X	if(__panel_is_linked(pan))
X		__override(pan,0);
X	win = pan->win;
X	if(mvwin(win,starty,startx))
X		return(ERR);
X	pan->wstarty = getbegy(win);
X	pan->wstartx = getbegx(win);
X	pan->wendy = pan->wstarty + getmaxy(win);
X	pan->wendx = pan->wstartx + getmaxx(win);
X	if(__panel_is_linked(pan))
X		__calculate_obscure();
X	return(OK);
}	/* end of move_panel */
X
/*+-------------------------------------------------------------------------
X	replace_panel(pan,win)
--------------------------------------------------------------------------*/
int
replace_panel(pan,win)
PANEL *pan;
WINDOW *win;
{
X	if(!pan)
X		return(ERR);
X	if(__panel_is_linked(pan))
X		__override(pan,0);
X	pan->win = win;
X	if(__panel_is_linked(pan))
X		__calculate_obscure();
X	return(OK);
}	/* end of replace_panel */
X
/*+-------------------------------------------------------------------------
X	panel_hidden(pan)
--------------------------------------------------------------------------*/
int
panel_hidden(pan)
PANEL *pan;
{
X	if(!pan)
X		return(ERR);
X	return(__panel_is_linked(pan) ? ERR : OK);
}	/* end of panel_hidden */
X
#endif /* !defined(NATIVE_PANELS) */
/* vi: set tabstop=4 shiftwidth=4: */
/* end of libpanel.c */
SHAR_EOF
chmod 0644 libpanel.c ||
echo 'restore of libpanel.c failed'
Wc_c="`wc -c < 'libpanel.c'`"
test 19955 -eq "$Wc_c" ||
	echo 'libpanel.c: original size 19955, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= libswap.c ==============
if test -f 'libswap.c' -a X"$1" != X"-c"; then
	echo 'x - skipping libswap.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting libswap.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'libswap.c' &&
/*LINTLIBRARY*/
/*+-------------------------------------------------------------------------
X	libswap.c -- /dev/swap routines for SCO UNIX/386 (maybe other *NIX)
X	...!{gatech,emory}!n4hgf!wht
X
X  Defined functions:
X	sinit()
X	sread(caddr,maddr,len)
X
X routines were originally written by Mike "Ford" Ditto: kudos!!!
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
/*:06-22-1990-02:00-root@n4hgf-creation from libmem */
X
#include <sys/types.h>
#include <fcntl.h>
#include "libswap.h"
X
void leave_text();
X
extern int errno;
X
static int fdswap = -2;
daddr_t lseek();
X
/*+-------------------------------------------------------------------------
X	sinit()
--------------------------------------------------------------------------*/
void
sinit()
{
X	if(fdswap >= 0)
X		return;
X	if((fdswap=open("/dev/swap",O_RDONLY)) < 0)
#ifdef M_SYS5
X		leave_text("can't open /dev/swap (chgrp mem /dev/swap)",1);
#else
X		leave_text("can't open /dev/swap (chgrp sys /dev/swap)",1);
#endif
X
}	/* end of sinit */
X
/*+-------------------------------------------------------------------------
X	sread(caddr,maddr,len)
--------------------------------------------------------------------------*/
void
sread(caddr,maddr,len)
caddr_t caddr;
daddr_t maddr;
int len;
{
char s80[80];
extern daddr_t myreadlen;
extern int myreadcnt;
X
#if defined(M_I286)
X	maddr &= 0xFFFFL;
#endif
X
X	if(fdswap == -2)
X		leave_text("sinit() not called",1);
X
X	if(lseek(fdswap,maddr,0) == -1L)
X	{
X		(void)sprintf(s80,"swap seek error addr %08lx",maddr);
X		leave_text(s80,1);
X	}
X
X	if(read(fdswap,caddr,len) != len)
X	{
X		(void)sprintf(s80,"swap read error len %d addr %08lx",len,maddr);
X		leave_text(s80,255);
X	}
X	myreadlen += len;
X	myreadcnt++;
}	/* end of sread */
X
/* vi: set tabstop=4 shiftwidth=4: */
SHAR_EOF
chmod 0644 libswap.c ||
echo 'restore of libswap.c failed'
Wc_c="`wc -c < 'libswap.c'`"
test 2333 -eq "$Wc_c" ||
	echo 'libswap.c: original size 2333, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= libnlsym.c ==============
if test -f 'libnlsym.c' -a X"$1" != X"-c"; then
	echo 'x - skipping libnlsym.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting libnlsym.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'libnlsym.c' &&
/*LINTLIBRARY*/
/*+-------------------------------------------------------------------------
X	libnlsym.c -- common runtime for nlsym users
X	...!{gatech,emory}!n4hgf!wht
X
X  Defined functions:
X	nlsym_error(text)
X	nlsym_read()
X
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:07-15-1990-01:41-wht@n4hgf-keep indicator nlsym has been read */
/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
/*:06-27-1990-01:55-wht@n4hgf-use 64 bits of unique check */
/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
/*:10-27-1988-11:44-wht-creation */
X
#include "config.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <nlist.h>
#if defined(mips)
#define n_sclass n_type
#endif
X
void leave_text();
X
#define DEFINE_NLSYM
#include "nlsym.h"
#include "libnlsym.h"
X
extern int errno;
extern char *sys_errlist[];
X
int nlsym_has_been_read = 0;
X
/*+-------------------------------------------------------------------------
X	nlsym_error(text)
--------------------------------------------------------------------------*/
void
nlsym_error(text)
char *text;
{
char s128[128];
X
X	(void)strcpy(s128,text);
X	(void)strcat(s128,": run nlsym");
X	leave_text(s128,(errno) ? 255 : 1);
}	/* end of nlsym_error */
X
/*+-------------------------------------------------------------------------
X	nlsym_read()
--------------------------------------------------------------------------*/
void
nlsym_read()
{
char s80[80];
int fdnlsym;
struct stat curstat;	/* current /unix status */
struct stat unixstat;		/* /unix status at nlsym run (void)time */
long unique1 = 0;
long unique2 = 0;
X
X	if(nlsym_has_been_read)
X		return;
X
X	if(stat(UNIX_KERNEL,&curstat) < 0)
X	{
X		(void)sprintf(s80,"cannot stat %s",UNIX_KERNEL);
X		nlsym_error(s80);
X	}
X
X	errno = 0;
X	if((fdnlsym = open(UNIX_NLSYM,O_RDONLY,0)) < 0)
X	{
X		(void)sprintf(s80,"%s open error\n",UNIX_NLSYM);
X		nlsym_error(s80);
X	}
X
X	if(read(fdnlsym,(char *)&unixstat,sizeof(unixstat)) != sizeof(unixstat))
X		nlsym_error("nlsym_read: /unix stat read error");
X
X	if(read(fdnlsym,(char *)nlsym,sizeof(nlsym)) != sizeof(nlsym))
X		nlsym_error("nlsym_read: nlsym read error");
X
X	if(read(fdnlsym,(char *)&unique1,sizeof(unique1)) != sizeof(unique1))
X		nlsym_error("nlsym_read: `unique' read error");
X
X	if(read(fdnlsym,(char *)&unique2,sizeof(unique2)) != sizeof(unique2))
X		nlsym_error("nlsym_read: `unique' read error");
X
X	(void)close(fdnlsym);
X
X	if( (unique1 != NLSYM_UNIQUE1) ||
X		(unique2 != NLSYM_UNIQUE2) ||
X		(unixstat.st_ino != curstat.st_ino) ||
X		(unixstat.st_mtime != curstat.st_mtime) ||
X		(unixstat.st_size != curstat.st_size))
X	{
X		(void)sprintf(s80,"%s out of date",UNIX_NLSYM);
X		nlsym_error(s80);
X	}
X	nlsym_has_been_read = 1;
X
}	/* end of nlsym_read */
SHAR_EOF
chmod 0644 libnlsym.c ||
echo 'restore of libnlsym.c failed'
Wc_c="`wc -c < 'libnlsym.c'`"
test 3258 -eq "$Wc_c" ||
	echo 'libnlsym.c: original size 3258, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= nlsym.c ==============
if test -f 'nlsym.c' -a X"$1" != X"-c"; then
	echo 'x - skipping nlsym.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting nlsym.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'nlsym.c' &&
/*+-------------------------------------------------------------------------
X	nlsym.c -- utility nlist - fast access to kernel /dev/kmem offsets
X	...!{gatech,emory}!n4hgf!wht
X
X  Defined functions:
X	main(argc,argv,envp)
X	nlsym_write_error(code)
X
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
/*:06-27-1990-01:55-wht@n4hgf-use 64 bits of unique check */
/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
/*:05-12-1989-18:27-wht-fix endless loop error on cannot nlist */
/*:10-27-1988-10:58-wht-creation */
X
#include "config.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <nlist.h>
#if defined(mips)
#define n_sclass n_type
#endif
X
#define DEFINE_NLSYM
#include "nlsym.h"
X
/*+-------------------------------------------------------------------------
X	nlsym_write_error(code)
--------------------------------------------------------------------------*/
void
nlsym_write_error(code)
int code;
{
X	(void)fprintf(stderr,"code %d: ",code);
X	perror(UNIX_NLSYM);
X	exit(1);
}	/* end of nlsym_write_error */
X
/*+-------------------------------------------------------------------------
X	main(argc,argv,envp)
--------------------------------------------------------------------------*/
/*ARGSUSED*/
main(argc,argv,envp)
int argc;
char **argv;
char **envp;
{
register int itmp;
register struct nlist *nn;
struct stat unixstat;		/* /unix status at nlsym run (void)time */
int fdnlsym;
int nlist_error = 0;
long unique;
FILE *kludge;
X
X	(void)nlist(UNIX_KERNEL,nlsym);
X
X	nn = nlsym;
X	while(nn->n_name)
X	{
X		if(nn->n_type == 0 && strcmp ("spl", nn->n_name))
X		{
#if !defined(mips)
X			(void)printf("%s: can't nlist\n", nn->n_name);
X			nlist_error = 1;
#endif
X			nn++;
X			continue;
X		}
X		(void)printf("%-12.12s  storage class: %04x value: %08lx\n",
X			nn->n_name,
X			nn->n_sclass,
X			nn->n_value);
X		nn++;
X	}
X
X	if(nlist_error > 1)
X	{
X		(void)fprintf(stderr,"%s NOT produced\n",UNIX_NLSYM);
X		exit(1);
X	}
X
X	if((kludge = fopen(UNIX_NLSYM,"w")) == NULL)	/* scratch/create */
X		nlsym_write_error(-1);
X	(void)fclose(kludge);
X
X	if((fdnlsym = open(UNIX_NLSYM,O_WRONLY,0)) < 0)
X		nlsym_write_error(fdnlsym);
X
X	if(stat(UNIX_KERNEL,&unixstat) < 0)
X	{
X		(void)fputs("cannot stat ",stderr);
X		perror(UNIX_KERNEL);
X		exit(1);
X	}
X
X	if((itmp = write(fdnlsym,&unixstat,sizeof(unixstat))) != sizeof(unixstat))
X		nlsym_write_error(itmp);
X
X	if((itmp = write(fdnlsym,nlsym,sizeof(nlsym))) != sizeof(nlsym))
X		nlsym_write_error(itmp);
X
X	unique = NLSYM_UNIQUE1;
X	if((itmp = write(fdnlsym,&unique,sizeof(unique))) != sizeof(unique))
X		nlsym_write_error(itmp);
X
X	unique = NLSYM_UNIQUE2;
X	if((itmp = write(fdnlsym,&unique,sizeof(unique))) != sizeof(unique))
X		nlsym_write_error(itmp);
X
X	(void)close(fdnlsym);
X	exit(0);
X	/*NOTREACHED*/
}	/* end of main */
X
/* vi: set tabstop=4 shiftwidth=4: */
SHAR_EOF
chmod 0644 nlsym.c ||
echo 'restore of nlsym.c failed'
Wc_c="`wc -c < 'nlsym.c'`"
test 3397 -eq "$Wc_c" ||
	echo 'nlsym.c: original size 3397, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= proc.c ==============
if test -f 'proc.c' -a X"$1" != X"-c"; then
	echo 'x - skipping proc.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting proc.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'proc.c' &&
/*+-------------------------------------------------------------------------
X	proc.c - u386mon proc table functions
X
X  Defined functions:
X	display_proc(win,y,x)
X	grok_proc()
X	pstat_text(pstat)
X
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:35-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:07-11-1990-03:45-root@n4hgf-faster proc table manipulation */
/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
/*:06-17-1990-16:46-wht-creation */
X
#include "config.h"
#define M_TERMINFO
#include <curses.h>
#undef reg     /* per nba@sysware.dk */
#ifdef NATIVE_PANELS
# include <panel.h>
#else
# include "libpanel.h"
#endif
#include <sys/types.h>
#undef NGROUPS_MAX
#undef NULL
#include <sys/param.h>
#include <sys/immu.h>
#include <sys/region.h>
#if defined(mips)
#include <sys/sbd.h>
#endif
#include <sys/proc.h>
#include <sys/var.h>
#include <nlist.h>
#include "nlsym.h"
#include "libkmem.h"
#include "libnlsym.h"
#include "u386mon.h"
X
#ifdef SVR4
#   include <sys/cred.h>
#   include <sys/vnode.h>
#   include <sys/session.h>
#endif
X
extern struct var v;
X
struct proc *procs = (struct proc *)0;
struct proc *oldprocs = (struct proc *)0;
struct proc **pprocs = (struct proc **)0;
struct proc **poldprocs = (struct proc **)0;
X
int procs_per_pstat[SXBRK + 1];
int procs_in_core;
int procs_alive;
X
/*+-------------------------------------------------------------------------
X	pstat_text(pstat)
--------------------------------------------------------------------------*/
char *
pstat_text(pstat)
char pstat;
{
static char errant[10];
X
X	switch(pstat)
X	{
X		case SSLEEP:   return("sleep ");
X		case SRUN:     return("run   ");
X		case SZOMB:    return("zombie");
X		case SSTOP:    return("stop  ");
X		case SIDL:     return("idle  ");
X		case SONPROC:  return("onproc");
X		case SXBRK:    return("xbrk  ");
X	}
X	(void)sprintf(errant,"%06u?",(unsigned char)pstat);
X	return(errant);
X
}	/* end of pstat_text */
X
/*+-------------------------------------------------------------------------
X	grok_proc() - read and examine kernel process table
--------------------------------------------------------------------------*/
void
grok_proc()
{
register iproc;
register struct proc *tproc;
static char *memfail = "cannot alloc memory for proc table";
X
X	if(!procs)
X	{
X		if(!(procs = (struct proc *)malloc(sizeof(struct proc) * v.v_proc)))
X			leave_text(memfail,1);
X		if(!(oldprocs = (struct proc *)malloc(sizeof(struct proc) * v.v_proc)))
X			leave_text(memfail,1);
X		if(!(pprocs = (struct proc **)malloc(sizeof(struct proc *) * v.v_proc)))
X			leave_text(memfail,1);
X		if(!(poldprocs=(struct proc **)malloc(sizeof(struct proc *)*v.v_proc)))
X			leave_text(memfail,1);
X	}
#ifdef SVR4
X	{
X	    static struct pid *spidp    = (struct pid *) 0;
X	    static struct pid *p_pidp   = (struct pid *) 0;
X	    static struct pid *p_pgidp  = (struct pid *) 0;
X	    static struct sess *p_sessp = (struct sess *) 0;
X	    static struct cred *p_cred  = (struct cred *) 0;
X	    struct proc *ptr;
X
X	    if (!p_pidp)
X		if (!(p_pidp = (struct pid *) malloc (sizeof (struct pid) * v.v_proc)))
X		    leave_text (memfail, 1);
X
X	    if (!p_pgidp)
X		if (!(p_pgidp = (struct pid *) malloc (sizeof (struct pid) * v.v_proc)))
X		    leave_text (memfail, 1);
X
X	    if (!spidp)
X		if (!(spidp = (struct pid *) malloc (sizeof (struct pid) * v.v_proc)))
X		    leave_text (memfail, 1);
X
X	    if (!p_sessp)
X		if (!(p_sessp = (struct sess *) malloc (sizeof (struct sess) * v.v_proc)))
X		    leave_text (memfail, 1);
X
X	    if (!p_cred)
X		if (!(p_cred = (struct cred *) malloc (sizeof (struct cred) * v.v_proc)))
X		    leave_text (memfail, 1);
X
X	    kread ((caddr_t) &ptr, procaddr, sizeof (struct proc *));
X
X	    iproc = 0;
X	    while (ptr != (struct proc *) 0 && iproc < v.v_proc)
X	    {
X		kread ((caddr_t) &procs[iproc], ptr, sizeof (struct proc));
X		kread ((caddr_t) &p_pidp[iproc], procs[iproc].p_pidp, sizeof (struct pid));
X		kread ((caddr_t) &p_pgidp[iproc], procs[iproc].p_pgidp, sizeof (struct pid));
X		kread ((caddr_t) &p_cred[iproc], procs[iproc].p_cred, sizeof (struct cred));
X		kread ((caddr_t) &p_sessp[iproc], procs[iproc].p_sessp, sizeof (struct sess));
X		kread ((caddr_t) &spidp[iproc], p_sessp[iproc].s_sidp, sizeof (struct pid));
X
X		procs[iproc].p_pidp  = &p_pidp[iproc];
X		procs[iproc].p_pgidp = &p_pgidp[iproc];
X		procs[iproc].p_cred  = &p_cred[iproc];
X		procs[iproc].p_sessp = &p_sessp[iproc];
X		procs[iproc].p_sessp->s_sidp = &spidp[iproc];
X
X		ptr = procs[iproc].p_next;
X		iproc++;
X	    }
X	    if (iproc < v.v_proc)
X	    {
X		memset (
X		    &procs[iproc], 0, sizeof (struct proc) * (v.v_proc - iproc)
X		);
X		memset (
X		    &p_pidp[iproc], 0, sizeof (struct pid) * (v.v_proc - iproc)
X		);
X		memset (
X		    &p_pgidp[iproc], 0, sizeof (struct pid) * (v.v_proc - iproc)
X		);
X		memset (
X		    &p_cred[iproc], 0, sizeof (struct cred) * (v.v_proc - iproc)
X		);
X		memset (
X		    &p_sessp[iproc], 0, sizeof (struct sess) * (v.v_proc - iproc)
X		);
X		memset (
X		    &spidp[iproc], 0, sizeof (struct pid) * (v.v_proc - iproc)
X		);
X		while (iproc < v.v_proc)
X		{
X		    procs[iproc].p_pidp  = &p_pidp[iproc];
X		    procs[iproc].p_pgidp = &p_pgidp[iproc];
X		    procs[iproc].p_cred  = &p_cred[iproc];
X		    procs[iproc].p_sessp = &p_sessp[iproc];
X		    procs[iproc].p_sessp->s_sidp = &spidp[iproc];
X		    iproc++;
X		}
X	    }
X	}
#else
X	kread((caddr_t)procs,procaddr,sizeof(struct proc) * v.v_proc);
#endif
X	for(iproc = 0; iproc < SXBRK + 1; iproc++)
X		procs_per_pstat[iproc] = 0;
X	procs_in_core = 0;
X	procs_alive = 0;
X
X	for(iproc = 0; iproc < v.v_proc; iproc++)
X	{
X		tproc = pprocs[iproc] = (procs + iproc);
X
X		if(tproc->p_stat)
X			procs_alive++;
X
X		procs_per_pstat[tproc->p_stat]++;	/* count # procs in each state */
X
X		if(tproc->p_flag & SLOAD)			/* count # procs in memory */
X			procs_in_core++;
X	}
X
}	/* end of grok_proc */
X
/*+-------------------------------------------------------------------------
X	display_proc(win,y,x)
--------------------------------------------------------------------------*/
void
display_proc(win,y,x)
WINDOW *win;
int y;
int x;
{
register istat;
X
X	grok_proc();
X
X	use_cp(win,cpBANNER);
X	wmove(win,y++,x);
X	waddstr(win,"-- Proc ---");
X	for(istat = SSLEEP; istat <= SXBRK; istat++)
X	{
X		wmove(win,y++,x);
X		disp_info_int(win,pstat_text(istat),"  %3d",procs_per_pstat[istat]);
X	}
X	wmove(win,y++,x);
X	disp_info_int(win,"total ","  %3d",procs_alive);
X	wmove(win,y++,x);
X	disp_info_int(win,"in mem","  %3d",procs_in_core);
}	/* end of display_proc */
X
/* vi: set tabstop=4 shiftwidth=4: */
/* end of proc.c */
SHAR_EOF
chmod 0644 proc.c ||
echo 'restore of proc.c failed'
Wc_c="`wc -c < 'proc.c'`"
test 7021 -eq "$Wc_c" ||
	echo 'proc.c: original size 7021, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= tune.c ==============
if test -f 'tune.c' -a X"$1" != X"-c"; then
	echo 'x - skipping tune.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting tune.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'tune.c' &&
/*+-------------------------------------------------------------------------
X	tune.c - u386mon tune struct display
X
X  Defined functions:
X	display_tune(win,y,x)
X
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:35-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
/*:06-25-1990-17:33-wht@n4hgf-alpha sort identifiers */
/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
/*:06-17-1990-14:59-wht-creation */
X
#include "config.h"
#define M_TERMINFO
#include <curses.h>
#undef reg     /* per nba@sysware.dk */
#ifdef NATIVE_PANELS
# include <panel.h>
#else
# include "libpanel.h"
#endif
#include <sys/types.h>
#include <sys/tuneable.h>
#if defined(mips)
#define t_gpgsmsk  t_gpgslmsk
#endif
#include "u386mon.h"
X
/*+-------------------------------------------------------------------------
X	display_tune(win,y,x)
--------------------------------------------------------------------------*/
void
display_tune(win,y,x)
WINDOW *win;
int y;
int x;
{
X	use_cp(win,cpBANNER);
X	wmove(win,y++,x);
X	waddstr(win,"-- Tune ---------");
#ifdef SVR4
X	wmove(win,y++,x);
X	disp_static_int(win,"t_ageintvl  ","%5d",tune.t_ageinterval);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_fsflushr  ","%5d",tune.t_fsflushr);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_gpgshi    ","%5d",tune.t_gpgshi);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_gpgslo    ","%5d",tune.t_gpgslo);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_minarmem  ","%5d",tune.t_minarmem);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_minasmem  ","%5d",tune.t_minasmem);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_dmalimit  ","%5d",tune.t_dmalimit);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_flckrec   ","%5d",tune.t_flckrec);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_minakmem  ","%5d",tune.t_minakmem);
#else
#ifdef	SVR32
X	wmove(win,y++,x);
X	disp_static_int(win,"t_ageintvl  ","%5d",tune.t_ageinterval);
#endif
X	wmove(win,y++,x);
X	disp_static_int(win,"t_bdflushr  ","%5d",tune.t_bdflushr);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_gpgshi    ","%5d",tune.t_gpgshi);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_gpgslo    ","%5d",tune.t_gpgslo);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_gpgsmsk   ","0x%03lx",tune.t_gpgsmsk);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_maxfc     ","%5d",tune.t_maxfc);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_maxsc     ","%5d",tune.t_maxsc);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_maxumem   ","%5d",tune.t_maxumem);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_minarmem  ","%5d",tune.t_minarmem);
X	wmove(win,y++,x);
X	disp_static_int(win,"t_minasmem  ","%5d",tune.t_minasmem);
#endif
X
}	/* end of display_tune */
X
/* vi: set tabstop=4 shiftwidth=4: */
/* end of tune.c */
SHAR_EOF
chmod 0644 tune.c ||
echo 'restore of tune.c failed'
Wc_c="`wc -c < 'tune.c'`"
test 3190 -eq "$Wc_c" ||
	echo 'tune.c: original size 3190, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= var.c ==============
if test -f 'var.c' -a X"$1" != X"-c"; then
	echo 'x - skipping var.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting var.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'var.c' &&
/*+-------------------------------------------------------------------------
X	var.c - u386mon var struct display
X
X  Defined functions:
X	display_var(win,y,x)
X
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:35-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:13-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
/*:06-25-1990-17:33-wht@n4hgf-alpha sort identifiers */
/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
/*:06-21-1990-14:27-r@n4hgf-version x0.12 seems bug free */
/*:06-17-1990-14:59-wht-creation */
X
#include "config.h"
#define M_TERMINFO
#include <curses.h>
#undef reg     /* per nba@sysware.dk */
#ifdef NATIVE_PANELS
# include <panel.h>
#else
# include "libpanel.h"
#endif
#include <sys/types.h>
#include <sys/var.h>
#include "u386mon.h"
X
/*+-------------------------------------------------------------------------
X	display_var(win,y,x)
--------------------------------------------------------------------------*/
void
display_var(win,y,x)
WINDOW *win;
int y;
int x;
{
X	use_cp(win,cpBANNER);
X	wmove(win,y++,x);
X	waddstr(win,"-- Var ---------");
#ifdef SVR4
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_hbuf     ","%5d",v.v_hbuf);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_hmask    ","%5d",v.v_hmask);
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_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_call     ","%5d",v.v_call);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_nglobpris","%5d",v.v_nglobpris);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_maxsyspri","%5d",v.v_maxsyspri);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_sptmap   ","%5d",v.v_sptmap);
X	wmove(win,y++,x);
X	disp_static_int(win,"v_bufhwm   ","%5d",v.v_bufhwm);
#else
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);
#endif
X
}	/* end of display_var */
X
/* vi: set tabstop=4 shiftwidth=4: */
/* end of var.c */
SHAR_EOF
chmod 0644 var.c ||
echo 'restore of var.c failed'
Wc_c="`wc -c < 'var.c'`"
test 3560 -eq "$Wc_c" ||
	echo 'var.c: original size 3560, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= config.h ==============
if test -f 'config.h' -a X"$1" != X"-c"; then
	echo 'x - skipping config.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting config.h (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'config.h' &&
/*+-------------------------------------------------------------------------
X	config.h - u386mon system monitor configuration
X
Hopefully, we will hide most of the Machiavellian version-hackery
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:35-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:08-01-1990-19:24-jdc@dell.com-add DELL config */
/*:08-01-1990-12:24-wht@n4hgf-2.11-try to support ISC 1.x.x */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:07-26-1990-17:51-wht-creation */
X
#define U386MON
X
#if !defined (SVR4) && defined (__svr4__)
#   define SVR4
#endif
X
#ifdef SVR4
X
#define MSFILES         16
#define SYSI86_RDUBLK_WANTED 1
#define HAS_RDCHK
#define NATIVE_PANELS
X
#undef HAS_BOOTINFO
X
#ifndef i386
#   define i386
#endif
X
#ifndef i486
#   define i486
#endif
X
#define PERFORMANCE /* see u386mon.c, kludge.c, /usr/include/tinfo.h */
#define CURSES_MACROS
X
#else
X
X
#if defined(M_UNIX)
#define HAS_RDCHK
#define HAS_NAP
#if !defined(SVR32)
#define SVR32
#endif
#if !defined(SCO320) && !defined(USIZE_FIXED)	/* you want USIZE_FIXED */
#define USIZE_FIXED					/* unless you are using SCO 3.2.0 */
#endif
/* The next two lines may speed up other True S5R3 versions, but I can't say */
#define PERFORMANCE /* see u386mon.c, kludge.c, /usr/include/tinfo.h */
#define CURSES_MACROS
#endif
X
#if defined(DELL)
#define ISC
#if !defined(SVR32)
#define SVR32
#endif
#endif
X
#ifdef ISC_1
#define ISC
#if !defined(SVR31)
#define SVR31
#endif
#ifndef NO_ISTOUCH
#define NO_ISTOUCH
#endif
#else /* !ISC 1.x.x */
#if defined(ISC)
#define HAS_RDCHK
#define HAS_NAP
#if !defined(SVR32)
#define SVR32
#endif
#endif
#endif
X
#if defined(SVR32)
#define NATIVE_PANELS
#define HAS_BOOTINFO
#define HAS_TIMEB
#endif
X
/*
X * some old curses do not have is_wintouched() or is_linetouched()
X * ... sigh ... This makes our homebrew panel object severely
X * disappointed, maybe useless ... but define NO_ISTOUCH to try
X * it if you get undefined externs for these two work saver functions.
X */
#ifdef SVR31
#ifndef NO_ISTOUCH
/* #define NO_ISTOUCH */
#endif
#endif
X
#if defined(mips)
#if !defined(SVR31)
#define SVR31
#endif
#if !defined(NO_ISTOUCH)
#define NO_ISTOUCH
#endif
#endif
X
#endif
X
/* vi: set tabstop=4 shiftwidth=4: */
/* end of config.h */
SHAR_EOF
chmod 0644 config.h ||
echo 'restore of config.h failed'
Wc_c="`wc -c < 'config.h'`"
test 2509 -eq "$Wc_c" ||
	echo 'config.h: original size 2509, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= libkmem.h ==============
if test -f 'libkmem.h' -a X"$1" != X"-c"; then
	echo 'x - skipping libkmem.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting libkmem.h (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'libkmem.h' &&
/*+-----------------------------------------------------------------------
X	libkmem.h
X	...!{gatech,emory}!n4hgf!wht
------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
/*:10-28-1988-14:46-afterlint-creation */
X
#ifndef BUILDING_LINT_ARGS
#ifdef LINT_ARGS
X
/* libkmem.c */
void kinit(int );
void kread(char  *,long ,int );
void kwrite(long ,char  *,int );
X
#else		/* compiler doesn't know about prototyping */
X
/* libkmem.c */
void kinit();
void kread();
void kwrite();
X
#endif /* LINT_ARGS */
#endif /* BUILDING_LINT_ARGS */
X
/* end of libkmem.h */
SHAR_EOF
chmod 0644 libkmem.h ||
echo 'restore of libkmem.h failed'
Wc_c="`wc -c < 'libkmem.h'`"
test 1192 -eq "$Wc_c" ||
	echo 'libkmem.h: original size 1192, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= libmem.h ==============
if test -f 'libmem.h' -a X"$1" != X"-c"; then
	echo 'x - skipping libmem.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting libmem.h (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'libmem.h' &&
/*+-----------------------------------------------------------------------
X	libmem.h
X	...!{gatech,emory}!n4hgf!wht
------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
SHAR_EOF
true || echo 'restore of libmem.h failed'
fi
echo 'End of av386mon part 4'
echo 'File libmem.h is continued in part 5'
echo 5 > _shar_seq_.tmp
exit 0
-- 
Andreas Vogel                   Bahnhofstr. 13 / D-7300 Esslingen / Germany
				Voice:  +49-711/357613
				E-Mail: av@ssw.de
