./share/src/                                                                                           775       0      12            0  4425701264   5777                                                                                                                                                                                                                                                                                                                                                                      ./share/src/sun/                                                                                       775       0      12            0  4425701265   6605                                                                                                                                                                                                                                                                                                                                                                      ./share/src/sun/suntool/                                                                               775       0      12            0  4427735247  10321                                                                                                                                                                                                                                                                                                                                                                      ./share/src/sun/suntool/perfmeter.c                                                                    644       0      12        41572  4424737226  12566                                                                                                                                                                                                                                                                                                                                                                      #ifndef lint
static  char sccsid[] = "@(#)perfmeter.c 10.30 89/02/24";
#endif

/*
 *	Copyright (c) 1985, 1986, 1987, 1988 by Sun Microsystems Inc.
 */

/* 
 *	perfmeter [-v name] [-s sample] [-m minute] [-h hour]
 *		[ -M value minmax maxmax ] [ host ]
 *
 *		displays meter for value 'name' sampling
 *		every 'sample' seconds.  The minute hand is an
 *		average over 'minute' seconds, the hour hand over
 *		'hour' seconds
 */

#include <stdio.h>
#include <sys/time.h>
#include <sys/param.h>
#include <rpc/rpc.h>
#include <rpcsvc/rstat.h>
#include <sys/socket.h>
#include <netdb.h>
#include <sys/dk.h>
#include <sys/vmmeter.h>
#include <sys/wait.h>
#include <suntool/sunview.h>
#include <sunwindow/rect.h>
#include <sunwindow/pixwin.h>
#include <suntool/wmgr.h>
#include "meter.h"

#define	MAXINT		0x7fffffff
#define	TRIES		8	/* number of bad rstat's before giving up */
#define TOP_KEY         KEY_LEFT(5)
#define OPEN_KEY        KEY_LEFT(7)
#define max_of(x,y)	MAX((x),(y))
#define min_of(x,y)	MIN((x),(y))

struct timeval TIMEOUT = {20,0};

struct	meter meters_init[] = {
	/* name		maxmax	minmax	curmax	scale	lastval */
	{ "cpu",	100,	100,	100,	1,	-1 },
#define	CPU	0
	{ "pkts",	MAXINT,	32,	32,	1,	-1 },
#define	PKTS	1
	{ "page",	MAXINT,	16,	16,	1,	-1 },
#define	PAGE	2
	{ "swap",	MAXINT,	4,	4,	1,	-1 },
#define	SWAP	3
	{ "intr",	MAXINT,	100,	100,	1,	-1 },
#define	INTR	4
	{ "disk",	MAXINT,	40,	40,	1,	-1 },
#define	DISK	5
	{ "cntxt",	MAXINT,	64,	64,	1,	-1 },
#define	CNTXT	6
	{ "load",	MAXINT,	4,	4,	FSCALE,	-1 },
#define	LOAD	7
	{ "colls",	MAXINT,	4,	4,	FSCALE,	-1 },
#define	COLL	8
	{ "errs",	MAXINT,	4,	4,	FSCALE,	-1 },
#define	ERR	9
};
#define	MAXMETERS	sizeof (meters_init) / sizeof (meters_init[0])

struct	meter *meters;	/* [MAXMETERS] */

int	*getdata();
int	killkids();
int	meter_selected();
char 	*calloc();
static caddr_t	do_menu();
void	wmgr_changerect();
static	Notify_value	meter_event();
static	Notify_value	meter_itimer_expired();

caddr_t window_get();
Frame	frame;
struct	pixfont *pfont;
struct	pixrect *ic_mpr;
Icon 	metericon;		/* Defaults to all zeros */
Pixwin	*pw;
static	Menu	menu;	/* walking menus */
static	Rect	ic_gfxrect;
struct pixrect	*ic_mpr;

int	(*old_selected)();
int	wantredisplay;		/* flag set by interrupt handler */
int	*save;			/* saved values for redisplay; dynamically
				 * allocated to be [MAXMETERS][MAXSAVE] */
int	saveptr;		/* where I am in save+(visible*MAXMETERS) */
int	dead;			/* is remote machine dead? */
int	visible;		/* which quantity is visible*/
int	length = sizeof (meters_init) / sizeof (meters_init[0]);
int	remote;			/* is meter remote? */
int	rootfd;			/* file descriptor for the root window */
int	width;			/* current width of graph area */
int	height;			/* current height of graph area */
char	*hostname;		/* name of host being metered */
int	sampletime;		/* sample seconds */
int	minutehandintv;		/* average this second interval */
int	hourhandintv;		/* long average over this seconds */
int	shortexp, longexp;
int	designee;
int	meter_client;

static int oldsocket;

#ifdef STANDALONE
main(argc, argv)
#else
perfmeter_main(argc, argv)
#endif STANDALONE
	int argc;
	char **argv;
{
	static char 	buf[256];
	register int	i, j;
	register struct meter *mp;
	char 		*cmdname;
	char 		**av;
	int		perfered_dims = 0;
	int		perfered_x,  perfered_y;

	/* Dynamically allocate save */
	save = (int *)(calloc(1, sizeof (int)*MAXMETERS*MAXSAVE));
	/* Dynamically allocate and initialize meters */
	meters = (struct meter *)(calloc(1, sizeof (meters_init)));
	for (i = 0; i < MAXMETERS; i++) meters[i] = meters_init[i];
	sampletime = 2;
	minutehandintv = 2;
	hourhandintv = 20;
	oldsocket = -1;
	
	/*
	 * Create tool window and customize
	 */
	cmdname = argv[0];
	argc--;   argv++;		/*	skip over program name	*/
	frame = window_create(0, FRAME,
	    FRAME_SHOW_LABEL,		FALSE,
	    WIN_WIDTH,			ICONWIDTH,
	    WIN_HEIGHT,			6, /* not really, check later */
	    FRAME_ARGC_PTR_ARGV,	&argc, argv,
	    WIN_CONSUME_KBD_EVENT,	WIN_ASCII_EVENTS,
	    0);
	    
	if (frame == (Frame)NULL) {
	    exit(1);
	}
	
        (void) notify_interpose_event_func((Notify_client)frame,
                        meter_event, NOTIFY_SAFE);

	while (argc > 0) {
		if (argv[0][0] == '-') {
			if (argv[0][2] != '\0')
				goto toolarg;
			switch (argv[0][1]) {
			case 's':
				if (argc < 2)
					usage(cmdname);
				sampletime = atoi(argv[1]);
				break;
			case 'h':
				if (argc < 2)
					usage(cmdname);
				hourhandintv = atoi(argv[1]);
				break;
			case 'm':
				if (argc < 2)
					usage(cmdname);
				minutehandintv = atoi(argv[1]);
				break;
					
			case 'v':
				if (argc < 2)
					usage(cmdname);
				for (i = 0, mp = meters; i < length; i++, mp++)
					if (strcmp(argv[1], mp->m_name) == 0)
						break;
				if (i >= length)
					usage(cmdname);
				visible = i;
				break;
			case 'M':
				if (argc < 4)
					usage(cmdname);
				for (i = 0, mp = meters; i < length; i++, mp++)
					if (strcmp(argv[1], mp->m_name) == 0)
						break;
				if (i >= length)
					usage(cmdname);
				mp->m_curmax = mp->m_minmax = atoi(argv[2]);
				mp->m_maxmax = atoi(argv[3]);
				argc -= 2;
				argv += 2;
				break;
			default:
			toolarg:
				/*
				 * Pick up generic tool arguments.
				 */
/*				if ((i = 
					tool_parse_one(cmdname, argc, argv))
						 == -1) {
					(void)tool_usage(cmdname);
					exit(1);
				} else if (i == 0)
					usage(cmdname);
*/
				argc -= i;
				argv += i;
				continue;
			}
			argc--;
			argv++;
		} else {
			if (hostname != NULL)
				usage(cmdname);
			hostname = argv[0];
			remote = 1;
		}
		argc--;
		argv++;
	}

	if (sampletime <= 0 || hourhandintv < 0 || minutehandintv < 0)
		usage(cmdname);
	shortexp = (1 - ((double)sampletime/max_of(hourhandintv, sampletime))) *
	    FSCALE;
	longexp = (1 - ((double)sampletime/max_of(minutehandintv, sampletime))) *
	    FSCALE;

	/*
	 * Set up meter icon.
	 */
	ic_gfxrect.r_width = ICONWIDTH;
	ic_gfxrect.r_height = remote ? RICONHEIGHT : ICONHEIGHT;
	ic_mpr = mem_create(ICONWIDTH, remote ? RICONHEIGHT : ICONHEIGHT, 1);
	metericon = icon_create(
			ICON_WIDTH, 	ICONWIDTH,
			ICON_HEIGHT,	remote ? RICONHEIGHT : ICONHEIGHT,
			ICON_IMAGE_RECT,&ic_gfxrect,
			0);	
        if ((int)window_get(frame, WIN_HEIGHT) == 6) { 
            window_set(frame, 
        	FRAME_ICON,	metericon,
        	WIN_HEIGHT,	remote ? RICONHEIGHT : ICONHEIGHT,
        	0);
        } else 
            window_set(frame, 
        	FRAME_ICON,	metericon,
        	0);
        icon_destroy(metericon);
        metericon = window_get(frame, FRAME_ICON);
        (void)icon_set(metericon, ICON_IMAGE, ic_mpr, 0);
	/*
	 * Open font for icon label.
	 */
	pfont = pf_open("/usr/lib/fonts/fixedwidthfonts/screen.r.7");
	if (pfont == NULL) {
		(void)fprintf(stderr, "%s: can't find screen.r.7\n", cmdname);
		exit(1);
	}

	pw = (Pixwin *) window_get(frame, WIN_PIXWIN);

	/*
	 * Setup timer.
	 */
	if (setup() < 0) {
		dead = 1;
		keeptrying();
	}

	/* 
	 * Get first set of data, then initialize arrays.
	 */
	updatedata();
	for (i = 0; i < length; i++)
		for (j = 1; j < MAXSAVE; j++)
			save_access(i, j) = -1;

	/*
	 * Initialize menu.
	 */
	av = (char **)(
		malloc((unsigned)(3*length*sizeof(char*) + sizeof(char *))));
	for (i = 0; i < 3*length; i+=3) {
		av[i] = (char *)MENU_STRING_ITEM;
		av[i+1] = meters[i/3].m_name;
		av[i+2] = (char *)(i/3);
	}
	av[i] = 0;
	menu = menu_create(ATTR_LIST, av,
				MENU_ACTION_PROC, do_menu,
			    	0);
	(void)menu_set(menu, MENU_INSERT, 0,
		menu_create_item(MENU_PULLRIGHT_ITEM, "frame", 
			window_get(frame, WIN_MENU),  0), 
		0);
	window_set(frame, WIN_MENU, menu, 0);

	(void)signal(SIGTERM, killkids);
	(void)signal(SIGINT, killkids);

	/* Set itimer event handler */
	(void) meter_itimer_expired((Notify_client) &meter_client,
		ITIMER_REAL);

	window_main_loop(frame);
	while (wantredisplay) {
		wantredisplay = 0;
		meter_paint();
		notify_start();
	}
	/*
	 * Cleanup
	 */
	(void)pf_close(pfont);
	(void)pr_destroy(ic_mpr);
	killkids();
	exit(0);
}

usage(name)
	char *name;
{
	register int i;
	
	(void)fprintf(stderr, "Usage: %s [-m minutehandintv] [-h hourhandintv] \
[-s sampletime] [-v value] [-M value minmax maxmax] [hostname]\n", name);
	(void)fprintf(stderr, "value is one of: ");
	for (i = 0; i < length; i++)
		(void)fprintf(stderr, " %s", meters[i].m_name);
	(void)fprintf(stderr,"\n");
	exit(1);
}

/*
 * New selection handler for perfmeter tool window.
 */
/*ARGSUSED*/
static
Notify_value
meter_event(object, event, arg, type)
	Window		object;
	Event			*event;
	Notify_arg		arg;
	Notify_event_type	type;
{
	int		n;
	Notify_value	value;

	value = notify_next_event_func((Notify_client) (object),
			(Notify_event)(event), arg, type);

	switch (event->ie_code) {

	case WIN_RESIZE: {
		Rect	rect;
		
		(void)win_getsize(window_get(object, WIN_FD), &rect);
		width = rect.r_width - 2*BORDER;
		height = rect.r_height - 2*BORDER - NAMEHEIGHT - 1;
		if (remote)
			height -= NAMEHEIGHT;
		break;
	}

/*
	case MENU_BUT: {
		int		n;

		n = (int)menu_show(window_get(object, WIN_MENU),
					object, event, 0);
		if (menu_get(window_get(object, WIN_MENU), 
					MENU_VALID_RESULT)) {
			visible = n;
			meter_paint();
		}
		event->ie_code = 0;
		break;
	}
*/

	case WIN_REPAINT:
		meter_paint();
		break;
	case '1': 
		sampletime = 1;
		break;
	case '2': 
		sampletime = 2;
		break;
	case '3': 
		sampletime = 3;
		break;
	case '4': 
		sampletime = 4;
		break;
	case '5': 
		sampletime = 5;
		break;
	case '6': 
		sampletime = 6;
		break;
	case '7': 
		sampletime = 7;
		break;
	case '8': 
		sampletime = 8;
		break;
	case '9': 
		sampletime = 9;
		break;
	case 'h':	/* hour hand */
		if (hourhandintv > 0)
			hourhandintv--;
		break;
	case 'H':	/* hour hand */
		hourhandintv++;
		break;
	case 'm':	/* minute hand */
		if (minutehandintv > 0)
			minutehandintv--;
		break;
	case 'M':	/* minute hand */
		minutehandintv++;
		break;
	}
	shortexp = (1 - ((double)sampletime/
	    max_of(hourhandintv, sampletime))) * FSCALE;
	longexp = (1 - ((double)sampletime/
	    max_of(minutehandintv, sampletime))) * FSCALE;
	return(value);
}

/*
 * SIGCHLD signal catcher.
 * Harvest any child (from keeptrying).
 * If can now contact host, request redisplay.
 */
ondeath()
{
	union wait status;

	while (wait3(&status, WNOHANG, (struct rusage *)0) > 0)
		;
	if (setup() < 0)
		keeptrying();
	else {
		dead = 0;
		/*
		 * Can't do redisplay from interrupt level
		 * so set flag and do a tool_done.
		 */
		wantredisplay = 1;
		notify_stop();
	}
}

/*
 * Convert raw data into properly scaled and averaged data
 * and save it for later redisplay.
 */
updatedata()
{
	register int i, *dp, old, tmp;
	register struct meter *mp;
	
	if (dead)
		return;
	dp = getdata();
	if (dp == NULL) {
		dead = 1;
		meter_paint();
		keeptrying();
		return;
	}

	/* 
	 * Don't have to worry about save[old] being -1 the
         * very first time thru, because we are called
	 * before save is initialized to -1.
	 */
	old = saveptr;
	if (++saveptr == MAXSAVE)
		saveptr = 0;
	for (i = 0, mp = meters; i < length; i++, mp++, dp++) {
		if (*dp < 0)	/* should print out warning if this happens */
			*dp = 0;
		tmp = (longexp * save_access(i, old) +
		    (*dp * FSCALE)/mp->m_scale * (FSCALE - longexp)) >> FSHIFT;
		if (tmp < 0)	/* check for wraparound */
			tmp = mp->m_curmax * FSCALE;
		save_access(i, saveptr) = tmp;
		tmp = (shortexp * mp->m_longave +
		    (*dp * FSCALE/mp->m_scale) * (FSCALE - shortexp)) >> FSHIFT;
		if (tmp < 0)	/* check for wraparound */
			tmp = mp->m_curmax * FSCALE;
		mp->m_longave = tmp;
	}
}

getminutedata()
{
	
	return (save_access(visible, saveptr));
}

gethourdata()
{
	
	return (meters[visible].m_longave);
}

/*
 * Initialize the connection to the metered host.
 */

static	CLIENT *client, *oldclient;

setup()
{
	struct hostent *hp;
	struct timeval timeout;
	struct sockaddr_in serveradr;
	int snum;

	snum = RPC_ANYSOCK;
	bzero((char *)&serveradr, sizeof (serveradr));
	if (hostname) {
		if ((hp = gethostbyname(hostname)) == NULL) {
			(void)fprintf(stderr,
			    "Sorry, host %s not in hosts database\n",
			     hostname);
			exit(1);
		}
		bcopy(hp->h_addr, (char *)&serveradr.sin_addr, hp->h_length);
	}
	else {
		if (hp = gethostbyname("localhost"))
			bcopy(hp->h_addr, (char *)&serveradr.sin_addr,
			    hp->h_length);
		else
			serveradr.sin_addr.s_addr = inet_addr("127.0.0.1");
	}
	serveradr.sin_family = AF_INET;
	serveradr.sin_port = 0;
	timeout.tv_sec = 5;
	timeout.tv_usec = 0;
	if ((client = clntudp_bufcreate(&serveradr, RSTATPROG,
	    RSTATVERS_SWTCH, timeout, &snum, sizeof(struct rpc_msg),
	    sizeof(struct rpc_msg) + sizeof(struct statsswtch))) == NULL)
		return (-1);
	if (oldsocket >= 0)
		(void)close(oldsocket);
	oldsocket = snum;
	if (oldclient)
		clnt_destroy(oldclient);
	oldclient = client;
	return (0);
}

/*
 * Fork a separate process to keep trying to contact the host
 * so that the main process can continue to service window
 * requests (repaint, move, stretch, etc.).
 */
keeptrying()
{	
	int pid;
	
	if ((int)signal(SIGCHLD, ondeath) == -1)
		perror("signal");
	pid = fork();
	if (pid < 0) {
		perror("fork");
		exit(1);
	}
	if (pid == 0) {
		for (;;) {
			sleep(1);
			if (setup() < 0)
				continue;
			if (clnt_call(client, NULLPROC, xdr_void, 0,
			    xdr_void, 0, TIMEOUT) != RPC_SUCCESS)
				continue;
			exit(0);
		}
	}
}

/*
 * Kill any background processes we may've started.
 */
killkids()
{

	(void)signal(SIGINT, SIG_IGN);
	(void)signal(SIGCHLD, SIG_IGN);
	(void)killpg(getpgrp(0), SIGINT);	/* get rid of forked processes */
	exit(0);
}

/*
 * Get the metered data from the host via RPC
 * and process it to compute the actual values
 * (rates) that perfmeter wants to see.
 */

/* static data used only by getdata() */
static	struct statsswtch statsswtch;
static	int oldtime[CPUSTATES];
static	int total;			/* Default to zero */
static	int toterr;			/* Default to zero */
static	int totcoll;			/* Default to zero */
static	struct timeval tm, oldtm;
static	int xfer1[DK_NDRIVE];
static	int badcnt;			/* Default to zero */
static	int ans[MAXMETERS];
static	int oldi, olds, oldp, oldsp;
static	int getdata_init_done;		/* Default to zero */

int *
getdata()
{
	register int i, t;
	register int msecs;
	int maxtfer;
	enum clnt_stat clnt_stat;
	int intrs, swtchs, pag, spag;
	int sum, ppersec;

	clnt_stat = clnt_call(client, RSTATPROC_STATS, xdr_void, 0,
		xdr_statsswtch,  &statsswtch, TIMEOUT);
	if (clnt_stat == RPC_TIMEDOUT)
		return (NULL);		
	if (clnt_stat != RPC_SUCCESS) {
		clnt_perror(client, "cpugetdata");
		exit(1);
	}

	for (i = 0; i < CPUSTATES; i++) {
		t = statsswtch.cp_time[i];
		statsswtch.cp_time[i] -= oldtime[i];
		oldtime[i] = t;
	}
	t = 0;
	for (i = 0; i < CP_IDLE; i++)	/* assume IDLE is last */
		t += statsswtch.cp_time[i];
	if (statsswtch.cp_time[CP_IDLE] + t <= 0) {
		t++;
		badcnt++;
		if (badcnt >= TRIES) {
			(void)fprintf(stderr, 
					"perfmeter: rstatd on %s returned bad data\n",
					hostname);
			exit(1);
		}
	} else {
		badcnt = 0;
	}
	ans[CPU] = (100*t) / (statsswtch.cp_time[CP_IDLE] + t);

	(void)gettimeofday(&tm, (struct timezone *)0);
	msecs = (1000*(tm.tv_sec - oldtm.tv_sec) +
	    (tm.tv_usec - oldtm.tv_usec)/1000);

	msecs++;	/* round up 1ms to avoid msecs == 0 */

	sum = statsswtch.if_ipackets + statsswtch.if_opackets;
	ppersec = 1000*(sum - total) / msecs;
	total = sum;
	ans[PKTS] = ppersec;

	ans[COLL] = FSCALE*(statsswtch.if_collisions - totcoll)*1000 / msecs;
	totcoll = statsswtch.if_collisions;
	ans[ERR] = FSCALE*(statsswtch.if_ierrors - toterr)*1000 / msecs;
	toterr = statsswtch.if_ierrors;

	if (!getdata_init_done) {
		pag = 0;
		spag = 0;
		intrs = 0;
		swtchs = 0;
		getdata_init_done = 1;
	} else {
		pag = statsswtch.v_pgpgout + statsswtch.v_pgpgin - oldp;
		pag = 1000*pag / msecs;
		spag = statsswtch.v_pswpout + statsswtch.v_pswpin - oldsp;
		spag = 1000*spag / msecs;
		intrs = statsswtch.v_intr - oldi;
		intrs = 1000*intrs / msecs;
		swtchs = statsswtch.v_swtch - olds;
		swtchs = 1000*swtchs / msecs;
	}
	oldp = statsswtch.v_pgpgin + statsswtch.v_pgpgout;
	oldsp = statsswtch.v_pswpin + statsswtch.v_pswpout;
	oldi = statsswtch.v_intr;
	olds = statsswtch.v_swtch;
	ans[PAGE] = pag;
	ans[SWAP] = spag;
	ans[INTR] = intrs;
	ans[CNTXT] = swtchs;
	ans[LOAD] = statsswtch.avenrun[0];
	for (i = 0; i < DK_NDRIVE; i++) {
		t = statsswtch.dk_xfer[i];
		statsswtch.dk_xfer[i] -= xfer1[i];
		xfer1[i] = t;
	}
	maxtfer = statsswtch.dk_xfer[0];
	for (i = 1; i < DK_NDRIVE; i++)
		if (statsswtch.dk_xfer[i] > maxtfer)
			maxtfer = statsswtch.dk_xfer[i];
	maxtfer = (1000*maxtfer) / msecs;
	ans[DISK] = maxtfer;
	oldtm = tm;
	return (ans);
}


static caddr_t
do_menu(menu, mi)
	Menu		menu;
	Menu_item	mi;
{
	int	n;

	n = (int)menu_get(mi, MENU_VALUE);

	/*  BUG: WOrkaround ; There should be another way of doing this */
	if (strcmp("frame", (char *)menu_get(mi, MENU_STRING)))
		visible = n;
	meter_paint();
	return(mi);
}

static
Notify_value
meter_itimer_expired(meter, which)
	Notify_client   meter;
	int          which;
{
	struct itimerval	itimer;

	updatedata();
	itimer = NOTIFY_NO_ITIMER;
	itimer.it_value.tv_sec = sampletime;
	meter_update();
        (void) notify_set_itimer_func((Notify_client)(&meter_client),
		meter_itimer_expired, ITIMER_REAL, &itimer,
		(struct itimerval *)0);

}
                                                                                                                                      ./share/src/sun/suntool/suntools.c                                                                     644       0      12       115771  4424737221  12501                                                                                                                                                                                                                                                                                                                                                                      #ifndef lint
#ifdef sccs
static  char sccsid[] = "@(#)suntools.c 10.47 88/09/09 SMI";
#endif
#endif

/*
 * Sun Microsystems, Inc.
 */

/*
 * Root window: Provides the background window for a screen.
 *	Put up environment manager menu.
 */

#include <suntool/tool_hs.h>
#include <sys/ioctl.h>
#include <sys/dir.h>
#include <sys/file.h>
#include <sys/wait.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
#include <pwd.h>
#include <ctype.h>
#include <vfork.h>
#include <sunwindow/defaults.h>
#include <suntool/alert.h>
#include <suntool/frame.h>
#include <suntool/menu.h>
#include <suntool/wmgr.h>
#include <suntool/selection.h>
#include <suntool/selection_svc.h>
#include <suntool/walkmenu.h>
#include <suntool/icon.h>
#include <suntool/icon_load.h>
#include <sunwindow/win_keymap.h>
#ifdef ecd.help
#include <suntool/help.h>
#endif

#define Pkg_private

/* performance: global cache of getdtablesize() */
extern int dtablesize_cache;
#define GETDTABLESIZE() \
	(dtablesize_cache?dtablesize_cache:(dtablesize_cache=getdtablesize()))

Pkg_private int walk_getrootmenu(), walk_handlerootmenuitem();
static int wmgr_getrootmenu(), wmgr_handlerootmenuitem();
void	expand_path();
int	wmgr_forktool();

#define GET_MENU (walk ? walk_getrootmenu : wmgr_getrootmenu)
#define MENU_ITEM (walk ? walk_handlerootmenuitem : wmgr_handlerootmenuitem)

#define KEY_STOP	ACTION_STOP
#define KEY_PUT		ACTION_COPY
#define KEY_CLOSE	ACTION_CLOSE
#define KEY_GET		ACTION_PASTE
#define KEY_FIND	ACTION_FIND_FORWARD
#define KEY_DELETE	ACTION_CUT
#ifdef ecd.help
#define KEY_HELP	ACTION_HELP
#endif

#define MAXPATHLEN	1024

extern int            errno;

extern char          *malloc(),
		     *calloc(),
		     *getenv(),
		     *strcpy(),
		     *strncat(),
		     *strncpy(), 
		     *index();

extern struct pixrect *pr_load();
extern struct pixfont *pf_default(), *pf_open();

static void	      root_winmgr(),
		      root_sigchldhandler(),
		      root_sigwinchhandler(),
		      root_sigchldcatcher(),
		      root_sigwinchcatcher(),
#ifdef ecd.suntools
		      root_sigtermhandler(),
#endif
		      root_initialsetup(),
		      root_set_background(),
		      root_set_pattern(),
		      root_start_service();

Pkg_private char *wmgr_savestr();

static int            dummy_proc();
static struct selection empty_selection = {
	SELTYPE_NULL, 0, 0, 0, 0
};

static Seln_client    root_seln_handle;
static char	     *seln_svc_file;

static int            rootfd,
		      rootnumber,
		      root_SIGCHLD,
#ifdef ecd.suntools
		      root_SIGTERM = FALSE,
#endif
		      root_SIGWINCH;

static int walk;

static struct screen  screen;

static struct pixwin *pixwin;

#define	ROOTMENUITEMS	20
#define	ROOTMENUFILE	"/usr/lib/rootmenu"
#define ROOTMENUNAME	"SunView"
#define ARG_CHARS       1024

/* These files will be deleted when sunview exits */
static char *tmp_file[] = {
	"/tmp/textsw_shelf",
	"/tmp/ttyselection",
	"/tmp/winselection"
};

static struct menuitem       root_items[ROOTMENUITEMS];

struct menuitemstrings {
	char         *mis_prog;    /* program to call */
	char         *mis_args;    /* args to program */
} root_itemstrings[ROOTMENUITEMS];

char                 *rootmenufile;

struct menu           wmgr_rootmenubody;
Pkg_private Menu      wmgr_rootmenu;

struct stat_rec {
    char             *name;	   /* Dynamically allocated menu file name */
    time_t            mftime;      /* Modified file time */
};

#define	MAX_FILES	40
Pkg_private struct stat_rec wmgr_stat_array[MAX_FILES];
Pkg_private int            wmgr_nextfile;

static	enum root_image_type {
	ROOT_IMAGE_PATTERN,
	ROOT_IMAGE_SOLID,
} root_image_type;
static struct pixrect *root_image_pixrect;
static root_color;

#ifdef STANDALONE
main(argc, argv)
#else
suntools_main(argc, argv)
#endif
	int argc;
	char **argv;
{
	char	name[WIN_NAMESIZE], setupfile[MAXNAMLEN];
	int	placeholderfd;
	int	donosetup = 0, printname = 0;
	char   *root_background_file = 0;
	unsigned char red[256], green[256], blue[256];
	unsigned char red_o [2], green_o [2], blue_o [2];
	unsigned char red_oe [2], green_oe [2], blue_oe [2];
	register struct	pixrect *fb_pixrect;
#define DONT_CARE_SHIFT         -1
        Firm_event fe_focus;
        int fe_focus_shift;
        Firm_event fe_restore_focus;
        int fe_restore_focus_shift;
        int set_focus = 0, set_restore_focus = 0, set_sync_tv = 0;
        struct timeval sync_tv;
	char *font_name;
	char    **args;
	struct singlecolor single_color;
	register int i;
	struct sigvec vec;
	struct stat tmpb;
	register int j;
	int	file_exists;
	int	original_pg;
	char	plane_groups [PIX_MAX_PLANE_GROUPS];

	seln_svc_file = "selection_svc";
	root_image_type = ROOT_IMAGE_PATTERN;
	root_image_pixrect = tool_bkgrd;
	root_color = -1;
	root_set_pattern(defaults_get_string("/SunView/Root_Pattern",
	    "on", (int *)NULL), &single_color);
	if (defaults_get_boolean("/SunView/Click_to_Type", (Bool)FALSE, (int *)NULL)) {
		/* 's'plit focus (See -S below if change) */
		fe_focus.id = MS_LEFT;
		fe_focus.value = 1;
		fe_focus_shift = DONT_CARE_SHIFT;
		set_focus = 1;
		fe_restore_focus.id = MS_MIDDLE;
		fe_restore_focus.value = 1;
		fe_restore_focus_shift = DONT_CARE_SHIFT;
		set_restore_focus = 1;
	}
	/*
	 * Parse cmd line.
	 */
	setupfile[0] = NULL;
	(void)win_initscreenfromargv(&screen, argv);
	if (argv) {
                for (args = ++argv;*args;args++) {
                        if ((strcmp(*args, "-s") == 0) && *(args+1)) {
				(void) strcpy(setupfile, *(args+1));
                                args++;
                        } else if (strcmp(*args, "-F") == 0) {
                                root_color = -1;
                                root_image_type = ROOT_IMAGE_SOLID;
                        } else if (strcmp(*args, "-B") == 0) {
                                root_color = 0;
                                root_image_type = ROOT_IMAGE_SOLID;
                        } else if (strcmp(*args, "-P") == 0)
				root_set_pattern("on", &single_color);
                        else if (strcmp(*args, "-n") == 0)
                                donosetup = 1;
                        else if (strcmp(*args, "-p") == 0)
                                printname = 1;
                        else if (strcmp(*args, "-color") == 0) {
				if (args_remaining(args) < 4)
					goto Arg_Count_Error;
				++args;
                                if (win_getsinglecolor(&args, &single_color))
                                	continue;
                                root_color = 1;
                        } else if (strcmp(*args, "-background") == 0) {
				if (args_remaining(args) < 2)
					goto Arg_Count_Error;
                                root_background_file = *++args;
                        } else if (strcmp(*args, "-pattern") == 0) {
				if (args_remaining(args) < 2)
					goto Arg_Count_Error;
				++args;
				root_set_pattern(*args, &single_color);
                        } else if (strcmp(*args, "-svc") == 0) {
				if (args_remaining(args) < 2)
					goto Arg_Count_Error;
                                seln_svc_file = *++args;
                                (void)fprintf(stderr,
                                	"Starting selection service \"%s\"\n",
                                	seln_svc_file);
			} else if (strcmp(*args, "-S") == 0) {
				/*
				 * 's'plit focus (See Click_to_type above
				 * if change)
				 */
				fe_focus.id = MS_LEFT;
				fe_focus.value = 1;
				fe_focus_shift = DONT_CARE_SHIFT;
				set_focus = 1;
				fe_restore_focus.id = MS_MIDDLE;
				fe_restore_focus.value = 1;
				fe_restore_focus_shift = DONT_CARE_SHIFT;
				set_restore_focus = 1;
			} else if (strcmp(*args, "-c") == 0) {
				/* set 'c'aret */
				get_focus_from_args(&args, (short *)&fe_focus.id,
				    &fe_focus.value, &fe_focus_shift);
				set_focus = 1;
			} else if (strcmp(*args, "-r") == 0) {
				/* 'r'estore caret */
				get_focus_from_args(&args, (short *)&fe_restore_focus.id,
				    &fe_restore_focus.value,
				    &fe_restore_focus_shift);
				set_restore_focus = 1;
			} else if (strcmp(*args, "-t") == 0) {
				/* set 't'imeout */
				if (args_remaining(args) < 2)
					goto Arg_Count_Error;
				args++;
				sync_tv.tv_usec = 0;
				sync_tv.tv_sec = atoi(*args);
				set_sync_tv = 1;
			} else if (argc == 2 && *args[0] != '-')
				/*
				 * If only arg and not a flag then treat as
				 * setupfile (backward compatibility with 1.0).
				 */
				(void) strcpy(setupfile, *args);
                }
        }

	/*
	 * Set up signal catchers.
	 */
	/* (void) signal(SIGCHLD, (void (*)())(LINT_CAST(root_sigchldcatcher))); */

	vec.sv_handler = (void (*)())(LINT_CAST(root_sigchldcatcher));
	vec.sv_mask = vec.sv_onstack = 0;
	sigvec(SIGCHLD, &vec, 0);

	/* (void) signal(SIGWINCH, (void (*)())(LINT_CAST(root_sigwinchcatcher))); */

	vec.sv_handler = (void (*)())(LINT_CAST(root_sigwinchcatcher));
	sigvec(SIGWINCH, &vec, 0);

#ifdef ecd.suntools
	vec.sv_handler = (void (*)())(LINT_CAST(root_sigtermhandler)) ;
	sigvec(SIGTERM, &vec, 0) ;

#endif
	/*
	 * Find out what colormap is so can restore later.
	 * Do now before call win_screennew which changes colormap.
	 */
	if (screen.scr_fbname[0] == NULL)
		(void)strcpy(screen.scr_fbname, "/dev/fb");
	if ((fb_pixrect = pr_open(screen.scr_fbname)) == (struct pixrect *)0) {
		(void)fprintf(stderr, "SunView: invalid frame buffer %s\n",
		    screen.scr_fbname);
		exit(1);
	}
	original_pg = pr_get_plane_group (fb_pixrect);
	(void) pr_available_plane_groups (fb_pixrect, 6, plane_groups);
	for (i = 1; i < PIX_MAX_PLANE_GROUPS; i++) {
		if (plane_groups [i]) {
			pr_set_plane_group (fb_pixrect, i);
			switch (i) {
			case PIXPG_MONO:
			case PIXPG_OVERLAY:
				(void)pr_getcolormap(fb_pixrect, 0, 2, red_o,
				    green_o, blue_o);
				break;
			case PIXPG_OVERLAY_ENABLE:
				(void)pr_getcolormap(fb_pixrect, 0, 2, red_oe,
				    green_oe, blue_oe);
				break;
			case PIXPG_8BIT_COLOR:
			case PIXPG_24BIT_COLOR:
				(void)pr_getcolormap(fb_pixrect, 0, 256, red,
				    green, blue);
				break;
			}
		}
	}
	pr_set_plane_group (fb_pixrect, original_pg);
	/*
	 * Create root window
	 */
	if ((rootfd = win_screennew(&screen)) == -1) {
		perror("SunView");
		exit(1);
	}
       	/*
	 * Set up root's name in environment (must be before call to
	 * pf_use_vm(), which must be before fonts are loaded, directly
	 * or indirectly).
	 */
	(void)win_fdtoname(rootfd, name);
	rootnumber = win_nametonumber(name);
	(void)we_setparentwindow(name);
	if (printname)
		(void)fprintf(stderr, "SunView window name is %s\n", name);
	/*
	 * Set DEFAULT_FONT environment variable from Defaults database.
	 */
	font_name = defaults_get_string("/SunView/Font", "", (int *)NULL);
	if (*font_name != '\0') (void)setenv("DEFAULT_FONT", font_name);
	/*
	 *	If loaded with shared libraries, turn on vm allocator for
	 * fonts then load all of the fonts listed in defaults database.
	 *	This must happen AFTER the framebuffer is opened to increase
	 * the probability that the vm address chosen for the fonts will
	 * also be free in the individual tools.
	 */
	if (pf_linked_dynamic()) {
		pf_use_vm(1);
		pf_default();
		font_name = defaults_get_string("/Menu/Font", "", (int *)NULL);
		if (*font_name != '\0') {
			(void)pf_open(font_name);
		} else {
#define	ALERTS_DEFAULT_MENU_FONT "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
			(void)pf_open(ALERTS_DEFAULT_MENU_FONT);
		}
#define	MENU_IMAGE_FONT "/usr/lib/fonts/fixedwidthfonts/screen.b.12"
		(void)pf_open(MENU_IMAGE_FONT);
		font_name = defaults_get_string("/Text/Font", "", (int *)NULL);
		if (*font_name != '\0') (void)pf_open(font_name);
		pf_use_vm(0);
	}
	/*
	 * Initialize root menu from menu file (loads menu font, so it
	 * must come after pf_use_vm() stuff).
	 */
	rootmenufile = defaults_get_string("/SunView/Rootmenu_filename", "",
					   (int *)NULL);
	if (*rootmenufile == '\0'
	    && (rootmenufile = getenv("ROOTMENU")) == NULL)
	    rootmenufile = ROOTMENUFILE;
	if (defaults_get_boolean("/SunView/Walking_Menus", (Bool)TRUE, (int *)NULL))
	    walk = 1;
	wmgr_rootmenu = walk ? NULL : (Menu)&wmgr_rootmenubody;
	if (GET_MENU(ROOTMENUNAME, wmgr_rootmenu, rootmenufile,
		     root_items, root_itemstrings, ROOTMENUITEMS) <= 0) {
	    (void)fprintf(stderr, "SunView: invalid root menu\n");
	    exit(1);
	}
	/*
	 * Finish initializing the root.
	 */
        if (root_background_file != (char *) NULL)
        	root_set_background(root_background_file);
	if (root_color != 1 && root_image_type == ROOT_IMAGE_SOLID) {
		Cursor	cursor = cursor_create((char *)0);

		(void)win_getcursor(rootfd, cursor);
		(void)cursor_set(cursor, CURSOR_OP, PIX_SRC^PIX_DST, 0);
		(void)win_setcursor(rootfd, cursor);
		cursor_destroy(cursor);
	}
	/* Set input parameters */
	if (set_focus)
		if (win_set_focus_event(rootfd, &fe_focus, fe_focus_shift)) {
			perror("win_set_focus_event");
			exit(1);
		}
	if (set_restore_focus)
		if (win_set_swallow_event(rootfd,
		    &fe_restore_focus, fe_restore_focus_shift)){
			perror("win_set_swallow_event");
			exit(1);
		}
	if (set_sync_tv)
		if (win_set_event_timeout(rootfd, &sync_tv)) {
			perror("win_set_event_timeout");
			exit(1);
		}
	(void)win_screenget(rootfd, &screen);
	/*
	 * Open pixwin.
	 */
	if ((pixwin = pw_open_monochrome(rootfd)) == 0) {
                (void)fprintf(stderr, "%s not available for window system usage\n",
		    screen.scr_fbname);
                perror("SunView");
                exit(1);
        }
        /* Set up own color map if have own color */
        if (root_color == 1) {
        	char cmsname[CMS_NAMESIZE];
        	int color;
#define	ROOT_CMS_SIZE 4
        	u_char root_red[ROOT_CMS_SIZE], root_green[ROOT_CMS_SIZE],
        	    root_blue[ROOT_CMS_SIZE];
        	
        	root_red[0] = screen.scr_background.red;
        	root_green[0] = screen.scr_background.green;
        	root_blue[0] = screen.scr_background.blue;
		for (color = 1; color < ROOT_CMS_SIZE-1; color++) {
        		root_red[color] = single_color.red;
        		root_green[color] = single_color.green;
        		root_blue[color] = single_color.blue;
		}
        	root_red[ROOT_CMS_SIZE-1] = screen.scr_foreground.red;
        	root_green[ROOT_CMS_SIZE-1] = screen.scr_foreground.green;
        	root_blue[ROOT_CMS_SIZE-1] = screen.scr_foreground.blue;
        	(void)sprintf(cmsname, "rootcolor%ld", getpid());
        	(void)pw_setcmsname(pixwin, cmsname);
		(void)pw_putcolormap(pixwin, 0, ROOT_CMS_SIZE,
		    root_red, root_green, root_blue);
        }
	/*
	 * Steal a window for the tool slot allocator
	 * & stash its name in the environment
	 */
	if ((placeholderfd = win_getnewwindow()) == -1)  {
		(void)fprintf(stderr,
			"No window available for placing open windows\n");
		perror("SunView");
	} else {
		(void)win_fdtoname(placeholderfd, name);
		(void)setenv("WMGR_ENV_PLACEHOLDER", name);
	}
	/*
	 * Set up tool slot allocator
	 */
	(void)wmgr_init_icon_position(rootfd);
	(void)wmgr_init_tool_position(rootfd);
	/*
	 * Setup tty parameters for all terminal emulators that will start.
	 */
	{int tty_fd;
	tty_fd = open("/dev/tty", O_RDWR, 0);
	if (tty_fd < 0)
		(void)ttysw_saveparms(2);	/* Try stderr */
	else {
		(void)ttysw_saveparms(tty_fd);
		(void) close(tty_fd);
	}
	}
	/*	try to make sure there is a selection service
	 */
#define	SEL_SVC_SEC_WAIT	5
#define	SEL_CLIENT_NULL		(Seln_client) NULL
	if ((root_seln_handle = seln_create((void (*)())(LINT_CAST(dummy_proc)), 
		(Seln_result (*)())(LINT_CAST(dummy_proc)), 
	    (char *)(LINT_CAST(&root_seln_handle)))) == SEL_CLIENT_NULL) {
		root_start_service();
		for (i = 0;
		   i < SEL_SVC_SEC_WAIT && root_seln_handle == SEL_CLIENT_NULL;
		   i++) {
			usleep(1 << 20);
			root_seln_handle = seln_create(
				(void (*)())(LINT_CAST(dummy_proc)),
				(Seln_result (*)())(LINT_CAST(dummy_proc)),
				(char *)(LINT_CAST(&root_seln_handle))
			);
		}
		if (root_seln_handle == SEL_CLIENT_NULL)
			(void)fprintf(stderr,
		        "Can't find old, or start new, selection service\n");
	}
	/*
	 * Draw background.
	 */
	root_sigwinchhandler();
	/*
	 * Do initial window setup.
	 */
	if (!donosetup)
		root_initialsetup(setupfile);
	/*
	 * Do window management loop.
	 */
	root_winmgr();
	/*
	 * Delete temporary files from /tmp for added security
	 */
	for (j=0; j<3; j++) {
		if ((file_exists = stat(tmp_file[j], &tmpb)) == 0)
			unlink(tmp_file[j]);
	}
	/*
	 * Destroy screen sends SIGTERMs to all existing windows and
	 * wouldn''t let any windows install themselves in the window tree.
	 * Calling process of win_screedestroy is spared SIGTERM.
	 */
	(void)win_screendestroy(rootfd);
	(void)close(placeholderfd);
	/*
	 * Lock screen before clear so don''t clobber frame buffer while
	 * cursor moving.
	 */
	(void)pw_lock(pixwin, &screen.scr_rect);
	/*
	 * Clear available plane groups
	 */
	for (i = 1; i < PIX_MAX_PLANE_GROUPS; i++) {
		if (plane_groups [i]) {
			int op;

			/* Write to all plane groups */
			pr_set_planes(pixwin->pw_pixrect, i, PIX_ALL_PLANES);
			op = PIX_CLR;
			switch (i) {
			case PIXPG_MONO:
			case PIXPG_OVERLAY:
				if (! red_o [0])
				    red_o [0] = ~red_o [0];
				(void) pr_putcolormap (pixwin->pw_pixrect, 0,
				    2, red_o, green_o, blue_o);
				break;
			case PIXPG_OVERLAY_ENABLE:
				if (! red_oe [0])
				    red_oe [0] = ~red_oe [0];
				(void) pr_putcolormap (pixwin->pw_pixrect, 0,
				    2, red_oe, green_oe, blue_oe);
				if (plane_groups [PIXPG_24BIT_COLOR])
					op = PIX_SET;
				break;
			case PIXPG_24BIT_COLOR:
				/* Fall through to 8 bit case. */
			case PIXPG_8BIT_COLOR:
				(void) pr_putcolormap (pixwin->pw_pixrect, 0,
				    256, red, green, blue);
				break;
			}
			/* Clear screen */
			(void)pr_rop(pixwin->pw_pixrect,
			    screen.scr_rect.r_left, screen.scr_rect.r_top,
			    screen.scr_rect.r_width, screen.scr_rect.r_height,
			    op, (Pixrect *)0, 0, 0);
		}
	}
	pr_set_plane_group (pixwin->pw_pixrect, original_pg);
	/*
	 * Unlock screen.
	 */
	(void)pw_unlock(pixwin);
	exit(0);
Arg_Count_Error:
	(void)fprintf(stderr, "%s arg count error\n", args);
	exit (-1);
}

static
args_remaining(args)
		char **args;
{
	register i;

	for (i = 0; *(args+i); i++) {}
	return (i);
}

static
get_focus_from_args(argv_ptr, event, value, shift)
	char ***argv_ptr;
	register short *event;
	register int *value;
	register int *shift;
{
#define	SHIFT_MASK(bit) (1 << (bit))
	char str[200];
	register char *arg;

	if (args_remaining(*argv_ptr) < 4) {
		(void)fprintf(stderr, "%s arg count error\n", *argv_ptr);
		exit (-1);
	}
	(*argv_ptr)++;
	arg = **argv_ptr;
	if (strcmp(arg, "LOC_WINENTER") == 0)
		*event = LOC_WINENTER;
	else if (strcmp(arg, "MS_LEFT") == 0)
		*event = MS_LEFT;
	else if (strcmp(arg, "MS_MIDDLE") == 0)
		*event = MS_MIDDLE;
	else if (strcmp(arg, "MS_RIGHT") == 0)
		*event = MS_RIGHT;
	else if (sscanf(arg, "BUT%s", str) == 1)
		*event = atoi(str)+BUT_FIRST;
	else if (sscanf(arg, "KEY_LEFT%s", str) == 1)
		*event = atoi(str)+KEY_LEFTFIRST-1;
	else if (sscanf(arg, "KEY_RIGHT%s", str) == 1)
		*event = atoi(str)+KEY_RIGHTFIRST-1;
	else if (sscanf(arg, "KEY_TOP%s", str) == 1)
		*event = atoi(str)+KEY_TOPFIRST-1;
	else if (strcmp(arg, "KEY_BOTTOMLEFT") == 0)
		*event = KEY_BOTTOMLEFT;
	else if (strcmp(arg, "KEY_BOTTOMRIGHT") == 0)
		*event = KEY_BOTTOMRIGHT;
	else
		*event = atoi(arg);
	(*argv_ptr)++;
	arg = **argv_ptr;
	if (strcmp(arg, "DOWN") == 0 || strcmp(arg, "Down") == 0 ||
	    strcmp(arg, "down") == 0)
		*value = 1;
	else if (strcmp(arg, "ENTER") == 0 || strcmp(arg, "Enter") == 0 ||
	    strcmp(arg, "enter") == 0)
		*value = 1;
	else if (strcmp(arg, "UP") == 0 || strcmp(arg, "Up") == 0 ||
	    strcmp(arg, "up") == 0)
		*value = 0;
	else
		*value = atoi(arg);
	(*argv_ptr)++;
	arg = **argv_ptr;
	if (strcmp(arg, "SHIFT_LEFT") == 0)
		*shift = SHIFT_MASK(LEFTSHIFT);
	else if (strcmp(arg, "SHIFT_RIGHT") == 0)
		*shift = SHIFT_MASK(RIGHTSHIFT);
	else if (strcmp(arg, "SHIFT_LEFTCTRL") == 0)
		*shift = SHIFT_MASK(LEFTCTRL);
	else if (strcmp(arg, "SHIFT_RIGHTCTRL") == 0)
		*shift = SHIFT_MASK(RIGHTCTRL);
	else if (strcmp(arg, "SHIFT_DONT_CARE") == 0)
		*shift = DONT_CARE_SHIFT;
	else if (strcmp(arg, "SHIFT_ALL_UP") == 0)
		*shift = 0;
	else
		*shift = atoi(arg);

}

static void
root_winmgr()
{
    struct inputmask      im;
    struct inputevent     event;
    int                   keyexit = 0;

    /*
     * Set up input mask so can do menu stuff 
     */
    (void)input_imnull(&im);
    im.im_flags |= IM_NEGEVENT;
    im.im_flags |= IM_ASCII;
    win_setinputcodebit(&im, SELECT_BUT);
    win_setinputcodebit(&im, MENU_BUT);
    win_keymap_set_smask(rootfd, ACTION_STOP);
    win_keymap_set_imask_from_std_bind(&im, ACTION_STOP);
    win_setinputcodebit(&im, KBD_REQUEST);
    win_keymap_set_smask(rootfd, KEY_PUT);
    win_keymap_set_smask(rootfd, KEY_GET);
    win_keymap_set_smask(rootfd, KEY_FIND);
    win_keymap_set_smask(rootfd, KEY_DELETE);
#ifdef ecd.help
    win_keymap_set_smask(rootfd, KEY_HELP);
    win_keymap_set_imask_from_std_bind(&im, KEY_HELP);
#endif
    win_keymap_set_imask_from_std_bind(&im, KEY_PUT);
    win_keymap_set_imask_from_std_bind(&im, KEY_GET);
    win_keymap_set_imask_from_std_bind(&im, KEY_FIND);
    win_keymap_set_imask_from_std_bind(&im, KEY_DELETE);
    (void)win_setinputmask(rootfd, &im, (struct inputmask *) 0, WIN_NULLLINK);
    /*
     * Read and invoke menu items 
     */
    for (;;) {
	fd_set                   ibits;
 	int			 nfds;
	int 			 maxfds = GETDTABLESIZE();

#ifdef ecd.suntools
	if (root_SIGTERM)
		return ;

#endif
	/*
	 * Use select (to see if have input) so will return on SIGWINCH or
	 * SIGCHLD. 
	 */
	/* ibits = 1 << rootfd; */
	FD_ZERO(&ibits);
        FD_SET(rootfd, &ibits);
	do {
	    if (root_SIGCHLD)
		root_sigchldhandler();
	    if (root_SIGWINCH)
		root_sigwinchhandler();
	} while (root_SIGCHLD || root_SIGWINCH);
	nfds = select(maxfds, &ibits, (fd_set *) 0, (fd_set *) 0,
		      (struct timeval *) 0);
	if (nfds == -1) {
	    if (errno == EINTR)
		/*
		 * Go around again so that signals can be handled.  ibits may
		 * be non-zero but should be ignored in this case and they will
		 * be selected again. 
		 */
		continue;
	    else {
		abort();
		perror("SunView");
		break;
	    }
	}
	/* if (ibits & (1 << rootfd)) { */
	if (FD_ISSET(rootfd, &ibits)) {
	    /*
	     * Read will not block. 
	     */
	    if (input_readevent(rootfd, &event) < 0) {
		if (errno != EWOULDBLOCK) {
		    perror("SunView");
		    break;
		}
	    }
	} else
	    continue;

	switch (event_action(&event)) {
	  case CTRL(q):	       /* Escape for getting out	 */
	    if (keyexit) {	       /* when no mouse around	 */
		return;
	    }
	    continue;
	  case CTRL(d):
	    keyexit = 1;
	    continue;
	  case KEY_STOP:
	    if (root_seln_handle != (Seln_client) NULL) {
		seln_clear_functions();
	    }
	    break;
	  case KBD_REQUEST:	/* Always refuse keyboard focus request */
	    (void)win_refuse_kbd_focus(rootfd);
	    break;
	  case KEY_PUT:
	  case KEY_GET:
	  case KEY_FIND:
	  case KEY_DELETE:
	    if (root_seln_handle != (Seln_client) NULL) {
		seln_report_event((Seln_client)(LINT_CAST(
			root_seln_handle)), &event);
	    }
	    break;
	  case KEY_CLOSE:
	    break;
	  case MS_LEFT:
	    if (win_inputposevent(&event)) {
		/*  the left button went down; clear the selection.  */
		(void)selection_set(&empty_selection, dummy_proc, dummy_proc, rootfd);
		if (root_seln_handle != (Seln_client) NULL) {
		    Seln_rank             rank;

		    rank = seln_acquire((Seln_client)(LINT_CAST(
		    	root_seln_handle)), SELN_UNSPECIFIED);
		    (void)seln_done((Seln_client)(LINT_CAST(root_seln_handle)),
		    	 rank);
		}
	    }
	    break;
	  case MENU_BUT:
	    if (win_inputposevent(&event)) {
		if (!root_menu_mgr(&event)) {
		    return;
		}
	    }
	    break;
#ifdef ecd.help
	  case KEY_HELP:
	    if (win_inputposevent(&event))
		(void)help_request(NULL, "sunview:rootwindow", &event);
	    break;
#endif
	  default:
	    break;
	}
	keyexit = 0;
    }
}

extern struct menuitem *menu_display();

static int
root_menu_mgr(event)
	struct inputevent    *event;
{
	Menu_item     mi; /* Old and new menu item */
	int	      exit_local;

	if (GET_MENU(ROOTMENUNAME, wmgr_rootmenu, rootmenufile,
		     root_items, root_itemstrings, ROOTMENUITEMS) <= 0) {
	    (void)fprintf(stderr, "SunView: invalid root menu\n");
	    return 1;
	}
	for (;;) {
	    struct inputevent tevent;

	    exit_local = 0;
	    tevent = *event;
	    if (walk)
		mi = menu_show_using_fd(wmgr_rootmenu, rootfd, event);
	    else
		mi = (Menu_item)menu_display((struct menu **)(LINT_CAST(
			&wmgr_rootmenu)), event, rootfd);
	    if (mi)
		exit_local = MENU_ITEM(wmgr_rootmenu, mi, rootfd) == -1;
	    if (event_action(event) == MS_LEFT && !exit_local) {
		*event = tevent;
/*		win_setmouseposition(rootfd, event->ie_locx, event->ie_locy);*/
	    } else {
		break;
	    }
	}
	return (!exit_local);
}

static void
root_sigchldhandler()
{
	union	wait status;

	root_SIGCHLD = 0;
	while (wait3(&status, WNOHANG, (struct rusage *)0) > 0)
		{}
}

static void
root_sigwinchhandler()
{
	root_SIGWINCH = 0;
	(void)pw_damaged(pixwin);
	switch (root_image_type) {
	case ROOT_IMAGE_PATTERN:
		(void)pw_replrop(pixwin,
		    screen.scr_rect.r_left, screen.scr_rect.r_top,
		    screen.scr_rect.r_width, screen.scr_rect.r_height,
		    PIX_SRC | PIX_COLOR(root_color), root_image_pixrect, 0, 0);
		break;
	case ROOT_IMAGE_SOLID:
	default:
		(void)pw_writebackground(pixwin,
		    screen.scr_rect.r_left, screen.scr_rect.r_top,
		    screen.scr_rect.r_width, screen.scr_rect.r_height,
		    PIX_SRC | PIX_COLOR(root_color));
	}
	(void)pw_donedamaged(pixwin);
	return;
}

static void
root_sigchldcatcher()
{
	root_SIGCHLD = 1;
}

static void
root_sigwinchcatcher()
{
	root_SIGWINCH = 1;
}

#ifdef ecd.suntools
  static void
root_sigtermhandler()
{
	root_SIGTERM = TRUE ;
}

#endif
static char *
get_home_dir()
{
	extern	char *getlogin();
	extern	struct	passwd *getpwnam(), *getpwuid();
	struct	passwd *passwdent;
	char	*home_dir = getenv("HOME"), *loginname;

	if (home_dir != NULL)
		return(home_dir);
	loginname = getlogin();
	if (loginname == NULL) {
		passwdent = getpwuid(getuid());
	} else {
		passwdent = getpwnam(loginname);
	}
	if (passwdent == NULL) {
		(void)fprintf(stderr,
		    "SunView: couldn't find user in password file.\n");
		return(NULL);
	}
	if (passwdent->pw_dir == NULL) {
		(void)fprintf(stderr,
		    "SunView: no home directory in password file.\n");
		return(NULL);
	}
	return(passwdent->pw_dir);
}

#define	ROOT_ARGBUFSIZE		1000
#define ROOT_SETUPFILE		"/.sunview"
#define	ROOT_SETUPFILE_ALT	"/.suntools"
#define	ROOT_MAXTOOLDELAY	10
#define	ROOT_DEFAULTSETUPFILE	"/usr/lib/.sunview"

static void
root_initialsetup(requestedfilename)
	char	*requestedfilename;
{
	register i;
	FILE	*file;
	char	filename[MAXNAMLEN], programname[MAXNAMLEN],
		otherargs[ROOT_ARGBUFSIZE];
	struct	rect rectnormal, recticonic;
	int	iconic, topchild, bottomchild, seconds, j;
	char	line[ARG_CHARS], full_programname[MAXPATHLEN];

	if (requestedfilename[0] == NULL) { /* first look for .sunview */
		char *home_dir = get_home_dir();
		if (home_dir == NULL)
			return;
		(void) strcpy(filename, home_dir);
		(void) strncat(filename, ROOT_SETUPFILE,
		    sizeof(filename)-1-strlen(filename)-strlen(
			ROOT_SETUPFILE));
	} else (void) strncpy(filename,requestedfilename,sizeof(filename)-1);
	file = fopen(filename, "r");
	if (!file && !requestedfilename[0]) { /* else get .suntools */
		char *home_dir = get_home_dir();
		if (home_dir == NULL)
			return;
		(void) strcpy(filename, home_dir);
		(void) strncat(filename, ROOT_SETUPFILE_ALT,
		    sizeof(filename)-1-strlen(filename)-strlen(
			ROOT_SETUPFILE_ALT));
		file = fopen(filename, "r");
	}
	if (!file && !requestedfilename[0]) {
	/* If default file not found in HOME, look in public library */
		(void) strcpy(filename, ROOT_DEFAULTSETUPFILE);
		file = fopen(filename, "r");
	}
	if (!file) {
/*  We used to not give an error if looking for default .sunview.
    Now that we check the defaults lib dir, we give an error message.
		if (requestedfilename[0] == NULL)
			return;
*/
		(void)fprintf(stderr,"SunView: couldn't open %s\n",filename);
		return;
	}
	while (fgets(line, sizeof (line), file)) {
		register char *t;
		for (t = line; isspace(*t); t++);
		if (*t == '#' || *t == '\0')
			continue;
		otherargs[0] = '\0';
		programname[0] = '\0';
		i = sscanf(line, "%s%hd%hd%hd%hd%hd%hd%hd%hd%hd%[^\n]\n",
		    programname,
		    &rectnormal.r_left, &rectnormal.r_top,
		    &rectnormal.r_width, &rectnormal.r_height,
		    &recticonic.r_left, &recticonic.r_top,
		    &recticonic.r_width, &recticonic.r_height,
		    &iconic, otherargs);
		if (i == EOF)
			break;
		if (i < 10 || i > 11) {
		   /*
		    * Just get progname and args.
		    */
		    otherargs[0] = '\0';
		    programname[0] = '\0';
		    j = sscanf(line, "%s%[^\n]\n", programname, otherargs);
		    if (j > 0) {
			iconic = 0;
			rect_construct(&recticonic, WMGR_SETPOS, WMGR_SETPOS,
			    WMGR_SETPOS, WMGR_SETPOS);
			rect_construct(&rectnormal, WMGR_SETPOS, WMGR_SETPOS,
			    WMGR_SETPOS, WMGR_SETPOS);
		    } else {
		    (void)fprintf(stderr,
		   "SunView: in file=%s fscanf gave %ld, correct format is:\n",
			filename, i);
		    (void)fprintf(stderr,
 "program open-left open-top open-width open-height close-left close-top close-width close-height iconicflag [args] <newline>\n OR\nprogram [args] <newline>\n");
		    continue;
		    }
		}
		/*
		 * Remember who top and bottom children windows are for use when
		 * trying to determine when tool is installed.
		 */
		topchild = win_getlink(rootfd, WL_TOPCHILD);
		bottomchild = win_getlink(rootfd, WL_BOTTOMCHILD);
		/*
		 * Fork tool.
		 */
		suntools_mark_close_on_exec();
		expand_path(programname, full_programname);
		(void) wmgr_forktool(full_programname, otherargs,
		    &rectnormal, &recticonic, iconic);
		/*
		 * Give tool chance to intall self in tree before starting next.
		 */
		for (seconds = 0; seconds < ROOT_MAXTOOLDELAY; seconds++) {
			usleep(1 << 20);
			if (topchild != win_getlink(rootfd, WL_TOPCHILD) ||
			    bottomchild != win_getlink(rootfd, WL_BOTTOMCHILD))
				break;
		}
	}
	(void) fclose(file);
}

Pkg_private
suntools_mark_close_on_exec()
{
	register i;
	int limit_fds = GETDTABLESIZE();

	/* Mark all fds (other than stds) as close on exec */
	for (i = 3; i < limit_fds; i++)
		(void) fcntl(i, F_SETFD, 1);
}

static void
root_set_pattern(token, ptr_single_color)
	char *token;
	struct singlecolor *ptr_single_color;
{
	char err[IL_ERRORMSG_SIZE];
	struct pixrect *mpr;

	if (strcmp(token, "on") == 0) {
		root_image_type = ROOT_IMAGE_PATTERN;
	} else if (strcmp(token, "off") == 0) {
		root_image_type = ROOT_IMAGE_SOLID;
	} else if (strcmp(token, "grey") == 0 || strcmp(token, "gray") == 0) {
		ptr_single_color->red = ptr_single_color->green =
		    ptr_single_color->blue = 128;
		root_color = 1;
		root_image_type = ROOT_IMAGE_SOLID;
	} else if ((mpr = icon_load_mpr(token, err))== (struct pixrect *)0) {
		(void)fprintf(stderr, "SunView: ");
		(void)fprintf(stderr, err);
	} else {
		root_image_pixrect = mpr;
		root_image_type = ROOT_IMAGE_PATTERN;
	}
}

static void
root_set_background(filename)
	char	*filename;
{
	int		 x, y;
	FILE		*file;
	register struct pixrect	*tmp_pr, *root_pr;

	if ((file = fopen(filename, "r"))  == (FILE *) NULL)  {
		(void)fprintf(stderr, "Couldn't open background file \"%s\":",
			filename);
		perror("");
		return;
	}
	if ((tmp_pr = pr_load(file, (colormap_t *)NULL/* Ignoring colormap */))
	    == (struct pixrect *) NULL)  {
		(void)fprintf(stderr, "Couldn't load background from %s\n",
			 filename);
		 (void)fclose(file);
		 return;
	}
	(void)fclose(file);
	root_pr =
	    mem_create(screen.scr_rect.r_width, screen.scr_rect.r_height, 1);
	/* Center image */
	x = (screen.scr_rect.r_width - tmp_pr->pr_width) / 2;
	y = (screen.scr_rect.r_height - tmp_pr->pr_height) / 2;
	/* Initialize background */
	switch (root_image_type) {
	case ROOT_IMAGE_PATTERN:
		(void)pr_replrop(root_pr, 0, 0,
		    screen.scr_rect.r_width, screen.scr_rect.r_height,
		    PIX_SRC | PIX_COLOR(root_color), root_image_pixrect, 			    0, 0);
		break;
	case ROOT_IMAGE_SOLID:
	default:
		(void)pr_rop(root_pr, 0, 0,
		    screen.scr_rect.r_width, screen.scr_rect.r_height,
		    PIX_SRC | PIX_COLOR(root_color), (Pixrect *)0, 0, 0);
	}
	/* Draw picture on image pixrect */
	(void)pr_rop(root_pr, x, y, tmp_pr->pr_width, tmp_pr->pr_height,
		PIX_SRC, tmp_pr, 0, 0);
	(void)pr_destroy(tmp_pr);
	root_image_pixrect = root_pr;
	/* PATTERN will cause image pixrect to be roped without replication */
	root_image_type = ROOT_IMAGE_PATTERN;
}

Pkg_private int
wmgr_menufile_changes()
{
	struct stat statb;
	int sa_count;

	if (wmgr_nextfile == 0) return 1;
	/* Whenever existing menu going up, stat menu files */
	for (sa_count = 0;sa_count < wmgr_nextfile;sa_count++) {
		if (stat(wmgr_stat_array[sa_count].name, &statb) < 0) {
			if (errno == ENOENT)
				return(1);
			(void)fprintf(stderr, "SunView: ");
			perror(wmgr_stat_array[sa_count].name);
			return(-1);
		}
		if (statb.st_mtime > wmgr_stat_array[sa_count].mftime)
			return(1);
	}
	return 0;
}

Pkg_private
wmgr_free_changes_array()
{   
    int sa_count = 0;
    
    while (sa_count < wmgr_nextfile) {
	free(wmgr_stat_array[sa_count].name);      /* file name */
	wmgr_stat_array[sa_count].name = NULL;
	wmgr_stat_array[sa_count].mftime = 0;
	sa_count++;
    }
    wmgr_nextfile = 0;
}

static
wmgr_freerootmenus(menu)
	struct menu *menu;
{
	struct menu *next = menu->m_next, *nnext;

	while (next) {
		nnext = next->m_next;
		if (next->m_items) {
			/* free string storage */
			free((char *)(LINT_CAST(next->m_items->mi_data)));
			/* item storage */
			free((char *)(LINT_CAST(next->m_items)));
		}
		free((char *)(LINT_CAST(next)));			      /* menu storage */
		next = nnext;
	}
	wmgr_free_changes_array();
}

static
wmgr_getrootmenu(mn, menu, mf, mi, mis, maxitems)
	char *mn, *mf;
	struct menu *menu;
	struct menuitem *mi;
	struct menuitemstrings *mis;
	int maxitems;
{
	FILE *f;
	int lineno;
	char line[ARG_CHARS], full_mf[MAXPATHLEN];
	char tag[32], prog[256], args[ARG_CHARS];
	struct stat statb;
	struct menu *menunext = (struct menu *)(LINT_CAST(wmgr_rootmenu));
	int nitems = 0;
	static char *nqformat = "%[^ \t\n]%*[ \t]%[^ \t\n]%*[ \t]%[^\n]\n";
	static char *qformat = "\"%[^\"]\"%*[ \t]%[^ \t\n]%*[ \t]%[^\n]\n";

	if (menu == (struct menu *)(LINT_CAST(wmgr_rootmenu)) && wmgr_nextfile != 0) {
		if (wmgr_menufile_changes() != 0)
			wmgr_freerootmenus((struct menu *)(LINT_CAST(wmgr_rootmenu)));
		else
			return menu->m_itemcount;
	}
	if (wmgr_nextfile >= MAX_FILES-1) {
		(void)fprintf(stderr,
		    "SunView: max number of menus is %ld\n", MAX_FILES);
		return -1;
	}
	expand_path(mf, full_mf);
	if ((f = fopen(full_mf, "r")) == NULL) {
		(void)fprintf(stderr, "SunView: can't open menu file %s\n", full_mf);
		return -1;
	}
	if (stat(full_mf, &statb) < 0) {
	    (void)fprintf(stderr, "SunView: ");
	    perror(full_mf);
	    (void)fclose(f);
	    return -1;
	}
	wmgr_stat_array[wmgr_nextfile].mftime = statb.st_mtime;
	wmgr_stat_array[wmgr_nextfile].name = wmgr_savestr(full_mf);
	++wmgr_nextfile;
	menu->m_imagetype = MENU_IMAGESTRING;
	menu->m_imagedata = mn;
	menu->m_items = mi;
	for (nitems = 0, lineno = 1; nitems < maxitems &&
	    fgets(line, sizeof (line), f); lineno++) {
		if (line[0] == '#')
			continue;
		args[0] = '\0';
		if (sscanf(line, line[0] == '"' ? qformat : nqformat,
		    tag, prog, args) < 2) {
			(void)fprintf(stderr,
			    "SunView: format error in %s: line %d\n",
			    full_mf, lineno);
			continue;
		}
		if (strcmp(prog, "MENU") == 0) {
		    struct menu *m;
		    struct menuitem *mi_local;
		    struct menuitemstrings *ms;
		    if (menu != (struct menu *)(LINT_CAST(wmgr_rootmenu))) {
			(void)fprintf(stderr,
	"SunView: MENU command illegal in secondary menu file %s: line %d\n",
			    full_mf, lineno);
			continue;
		    }
		    if (wmgr_getrootmenu(
		        wmgr_savestr(tag),			   /* menu name */
		        m = (struct menu *)(LINT_CAST(calloc(1, sizeof(struct menu)))),
			args,				   /* file name */
		        mi_local = (struct menuitem *)(LINT_CAST(
				calloc(ROOTMENUITEMS, sizeof(struct menuitem)))),
		        ms = (struct menuitemstrings *)(LINT_CAST(
				calloc(ROOTMENUITEMS, sizeof(struct menuitemstrings)))),
			ROOTMENUITEMS) <= 0) {
			    (void)fprintf(stderr,
			        "SunView: invalid secondary menu %s\n", args);
			    free((char *)(LINT_CAST(m))); 
			    free((char *)(LINT_CAST(mi_local))); 
			    free((char *)(LINT_CAST(ms)));
			    continue;
		    } else {
			menunext->m_next = m;
			menunext = m;
		    }
		} else {
		    if (mi->mi_imagedata)
		    	free((char *)mi->mi_imagedata);
		    mi->mi_imagetype = MENU_IMAGESTRING;
		    mi->mi_imagedata = (caddr_t)wmgr_savestr(tag);
		    mi->mi_data = (caddr_t)mis;
		    if (mis->mis_prog) free(mis->mis_prog);
		    if (mis->mis_args) free(mis->mis_args);
		    mis->mis_prog = wmgr_savestr(prog);
		    if (args[0] == '\0')
		    	mis->mis_args = (char *)NULL;
		    else
		    	mis->mis_args = wmgr_savestr(args);
		    mi++;
		    mis++;
		    nitems++;
		}
	}
	(void)fclose(f);
	return menu->m_itemcount = nitems;
}

Pkg_private char *
wmgr_savestr(s)
	register char *s;
{
	register char *p;

	if ((p = malloc((unsigned)(strlen(s) + 1))) == NULL) {
		if (rootfd) (void)win_screendestroy(rootfd);
		(void)fprintf(stderr, "SunView: out of memory for menu strings\n");
		exit(1);
	}
	(void)strcpy(p, s);
	return (p);
}

Pkg_private char *
wmgr_save2str(s, t)
	register char *s, *t;
{
	register char *p;

	if ((p = malloc((unsigned)(strlen(s) + strlen(t) + 1 + 1))) == NULL) {
		if (rootfd)
			(void)win_screendestroy(rootfd);
		(void)fprintf(stderr, "SunView: out of memory for menu strings\n");
		exit(1);
	}
	(void)strcpy(p, s);
	(void)strcpy(index(p, '\0') + 1, t);
	return (p);
}

/* ARGSUSED */
static
wmgr_handlerootmenuitem(menu, mi, rootfd_local)
	struct	menu *menu;
	struct	menuitem *mi;
	int	rootfd_local;
{   
    int	returncode = 0;
    struct	rect recticon, rectnormal;
    struct	menuitemstrings *mis;
    char full_prog[MAXPATHLEN];

    /*
     * Get next default tool positions
    */
    rect_construct(&recticon,
		   WMGR_SETPOS, WMGR_SETPOS, WMGR_SETPOS, WMGR_SETPOS);
    rectnormal = recticon;
    mis = (struct menuitemstrings *)(LINT_CAST(mi->mi_data));
    if (strcmp(mis->mis_prog, "EXIT") == 0) {
	int result;
	Event alert_event;
	int real_result = 0;

	if (defaults_get_boolean(
		"/Compatibility/Alerts", (Bool)TRUE, (int *)NULL)) {
	    result = alert_prompt(
		(Frame)0,
		&alert_event,
		ALERT_MESSAGE_STRINGS,
		    "Do you really want to exit SunView?",
		    0,
		ALERT_BUTTON_YES,	"Confirm",
		ALERT_BUTTON_NO,	"Cancel",
		0);
	    switch (result) {
		case ALERT_YES: 
		    returncode = -1;
		    break;
		case ALERT_NO:
		    returncode = 0;
		    break;
		default: /* alert_failed */
		    returncode = wmgr_confirm(rootfd_local,
			"Press the left mouse button to confirm Exit.  \
To cancel, press the right mouse button now.");
		    break;
	    }
	} else {
	returncode = wmgr_confirm(rootfd_local,
			"Press the left mouse button to confirm Exit.  \
To cancel, press the right mouse button now.");
	}
    } else if (strcmp(mis->mis_prog, "REFRESH") == 0) {
	wmgr_refreshwindow(rootfd_local);
    } else {
	suntools_mark_close_on_exec();
	expand_path(mis->mis_prog, full_prog);
	(void) wmgr_forktool(full_prog, mis->mis_args,
			     &rectnormal, &recticon, 0/*!iconic*/);
    }
    return(returncode);
}


/* dummy proc for selection_set()
*/
static int
dummy_proc()
{
}


static void
root_start_service()
{
	register int	i;
static char		*args[2] = {"selection_svc", 0 };
	if (vfork() == 0)  {
		for (i = 30; i > 2; i--)  {
			(void)close(i);
		}
		execvp(seln_svc_file, args, 0);
		perror("Couldn't fork selection service");
		usleep(7 << 20);
		exit(1);
	}
}
ork too./share/src/sun/suntool/mailtool/                                                                      775       3      12            0  4424737233  12136                                                                                                                                                                                                                                                                                                                                                                      ./share/src/sun/suntool/mailtool/tool.o                                                                644       0      12        22030  4424737232  13367                                                                                                                                                                                                                                                                                                                                                                                               NV  Hx Hx N    PO#    Hx N    XO#    Hx N    XO#    Hx N    XO#     y    Br#    #    #    r#    r#    B    B    B    B    B    #    B    B    B    B    #       N^NuNVN  8/9    N    XO/9    N    XON    N    BHx Hy   8N    O -@HyBHxN    PO".   Ё#    B/. Hn HyK"Hx HyF	/9    HyF
J    gp`p / HyF	Hx HyF	/9    HyF
	aHy   JHyJ 	a 9  #й    й  $ V/ HyJ* 9    _ / HyJ%AHy    BN    O X#    B/9    N    PO/. /. N    POHyJ)/9    N    PO#    HyJA	/9    N    PO#     y    #     y    #     HyJ,
 /9    N    PO-@ @"|    #h  "BHz/9    N    O HyJ0
/9    N    PO#  #J    f  BHy   mHyD[	a/9  #N    O #    g  BBHyD:	BHzlHyD 
aHy   HyD[	aHyD?JABHz|HyD 
aHy   HyD[	aHyD?JABHy    HyD-
aHy   HyD[	aHyD?JABHzzHyD 
aHy   rHyD[	aHyD?JAN    O l#    B/9    HyDM
/9    N    O Hzv/9    N    POBHx HyEY	Hx HyE	BHyE	/9    HyE;Hy   HyJ 	a/9  #HyJ*HyJ_
 Hy    /9    N    O @#    Hx /9    N    POBHx HyE	!/9    N    O J    fN    `<       fN    `(       fN    `Hy   Hy   (N    PON    #    J    gB/9    HyA3/9    N    O BHx HyE	Hx HyEb	BHyE	/9    HyE;/9    HyJ$
BHyJ!AHy   HyJ 	aHyJ_
 Hy    /9    N    O H#    Hx /9    N    POHyES
a/9    N    PO#  $BHz	HyES
a/9    N    O J    fJ    f>/9    N    XO-@ @#     #    B/ HyAp
/9    N    O `B    B    Hx Hx HzHy    N    O Hx Hx HzHy    N    O N    / Hy    Hy    N    O N    N  
R/9    N    XO/9    N    XON^NuNVBHx Hy  !"N    O Jfp`B#    BHx Hy  !GN    O #    BBHy  !]N    O #    r#    J    gDB    Hy  !lN    XO-@g x/ N    XO-@o f#    ` \R#    Hx //9    N    PO-@fHy  !uN    XOJgp `p#    Hy  !N    XOJgp`p #    Hy  !N    XOJgp`p #    J    g  Hy  !N    XOJg  Hy  !Hy  !N    XO/ N    POJg  Hy  !Hy  !N    XO/ N    POJfr`nHy  !Hy  !N    XO/ N    POJf$B    J    fDHy  !Hy   (N    PO`&Hy  "N    XO/ Hy  "Hy   (N    O r#    #wwww    r
#  #r#  $ #    Hy  "N    XO-@g/ N    XO-@o#  #Hy  "N    XO-@g/ N    XO-@o#  $ Hy  "N    XO-@g/ N    XO-@o#    B    B    Hy  "N    XO-@g/ N    XO#    J    nB    Hy  "N    XO-@g/ N    XO#    J    nB    Hy  "N    XOJgBHy  "N    PON^NuNVHyF	/. N    PO-@B/. /. /. N    O -@ n p 0( f0H` n p 0(  @|   f$HyJ)/9    N    PO#    N    `  HyF	/. N    PO-@fJgJJ    gBHyJ/	/9    N    PO-@f$BJfp`B/ HyJ/	/9    N    O JgDJf>BBHyDM
/9    N    O J    gBHy   Hx Hz`Hy    N     .N^NuNV  J    f
BN    XO    fBN    XON        fp `p/ N    XOp N^NuNV    f  J    gHBHy  #6Hy  #Hy  #Hy  #	BB/9    N    O  JfV/. N    XOB    `  BHy  #aHy  #ZHy  #RHx B/9    N    O Jf/. N    `HN    /. N  XO/. /. N    PO-@`"/. /. N    PO-@Hy    N    XO .N^NuNVr#    BB/9    N    O BB/9    N    O HyAp
/9    N    PO-@Hy  #N    XOJg  Hy  #N    XO-@g @Jf-|  #Hn/.N    POHy  #HnN    PO-@g/ N    XO`  B.`  J.g nJ  gBBHn/N    O BB n/N    O HyJK
 n/N    PO-@    g$BHx HyK*	/ N    O /.N    XO n-h (Jf tBHx HyK*	/. N    N^NuNVBHy  #N    XO-@g/ N    XO-@Jf-|  ,#  $#  $BHy  $BHz BHy    N    O J    f$r#    BHy   (Hx Hz "Hy    N    N^NuNVN    p N^NuNVBnBBHnJ    g 9    ` 9    / N  .p N^NuNV  B    /. /. /. N    N^NuNVBnBB    BBHyF	/9    N    p N^NuNV-y    BnBr#    Hn/9    N    PO#    p N^NuNV  r#    BBHyF	/9    N    p N^NuNVHy  #Hy  #/9    N    #     9    N^NuNVB-n `   nE
 fVHy  #N    XOJfDBHy  #Hy  #Hy  #Hx Hx /9    N    O JfBHyE]
 /. N    `^r-A n rrf rЈ` .X/  n/N    PO-@ nJf ZJg/. /.  y  $NPON^Nu                                  p       @  `    |      AA AA !  !           H  re	  e5	 B	 
       @A  `  PH   <p     ؈  '  <!  <    1A$A @@? @@ @@` @@  @@  @@  @@- @@p @@h @@ @@ @@   @@@ @@ @@  @@  @@  @C   @L    @p                                     @   @      @ @         @ @       @ @                                       p        @  `                 A@  A@            d       DE lc U	 U	 E E               <p     ؈  '  <!  <    1A$A @@? @@ @@` @@  @@  @@  @@- @@p @@h @@ @@ @@   @@@ @@ @@  @@  @@  @C   @L    @p                  8                   @   @     8 @ @         @ @  L     @ @           """"""#DDDDDDE興"".>""#DDtGDDEȈ"b">""#GD|dDE"*"#EELDEQQ茈"#&"#DDUDDDEj3"&"#veMDDDEu5ʝ/*"&"#DEDDDEɈb"&"#UTLDLDE=q""*##DDLOgLE=1""+/#DDOuEQ5ɘ"bb?2#DDDDEQQqȈ"bb2"#DDDTDEQQ=Ȉ"bbj#DDDGEQQȌ"bbb#DDDEEQQȘ"bb"#DDGDDEQ]""""#DDDDDDE                        @   @      @ @         @ @       @ @                   _     \     =     n    ""@   lDD`   0   h   ""(   DDDD   
   H   """   DDF         """   DDF                 ́6   6   6   ́6         ́   ́   &   kצ                 """   DDF         """  DDF  5   բ""" DD8 	uQ9 ꚋV _^ ?]T׮  .ԯY ,ѩ   tP    H                                                                                        @   @      @ @         @ @       @ @           """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""a"""""""F""""""&"""""""+h""""""Rb""""""I#'#O     )##  RB#    I #  $# 
H   )  #  R@ #    )     #   #    `     #    #              #     #               #     #               ##     (                   @   @     ( @ @         @ @  <     @ @           """"""""""""""""""/"""""< >"""  Ȉ">   r"""x   ""        <     "p     "         ge       gfF  "    gk      h     Rb         I        %O   )   RC    I  $  
H  )   R@     )            g|   #    #        #     #      n   #     #               ##     x                   @   @     x @ @         @ @       @ @           """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""a"""""""F""""""&"""""""+h""""""Rb""""""I#'#O     )##  RB#    I #  $# 
H   )  #  R@ #    )     #   #    g|   #    #        #     #      n   #     #               ##                        @   @      @ @         @ @       @ @                                         /Text/Left_margin mailtool: unable to create window
 Open Read New Mail Read Folder Compose Message Just Open mailtool: Unable to create header window
 unrecognized value for mt_panel_style
 mailtool: unable to create message window
 /Compatibility/New_Mailtool_features /Compatibility/Alerts /Text/Retained cmdlines disablefields alwaysusepopup 4.1features panelstyle panelstyle New panelstyle Old panelstyle ThreeDImages *****3DImage panel style has been specified in user's defaults!
Mailtool must be compiled with -DUSE_IMAGES in order to use this feature!
Using default panel style instead.
 unrecognized default setting for panelstyle: %s
 panelstyle headerlines maillines popuplines bell flash autoprint autoprint Confirm Cancel Are you sure you want to Quit without committing changes? Confirm Cancel Are you sure you want to Quit? save DEAD ~/dead.letter w interval   editmessagewindow Confirm Cancel Did you really intend to edit this window?        _close_on_exec();
		expand_path(programname, full_programname);
		(void) wmgr_forktool(full_programname, otherargs,
		    &rectnormal, &recticonic, iconic);
		/*
		 * Give tool chance to intall self in tree before starting next.
		 */
		for (seconds = 0; seconds < ROOT_MAXTOOLDELAY; seconds++) {
			usleep(1 << 20);
			if (topchild != win_getlink(rootfd, WL_TOPCHILD) ||
			    bottomchild != win_getlink(rootfd, WL_BOTTOMCHILD))
				break;
		}
	}
	(void) fclose(file);
}

Pkg_private
su./share/src/sun/suntool/mailtool/selection.o                                                           644       0      12         1340  4424737232  14360                                                                                                                                                                                                                                                                                                                                                                         8      8                NVHx N    XO-@ @C0< "QJf/9    Hy  8Hy   (N    p `pN^NuNVBHx N    XO-@ @0< "|  "QJ  g/9    Hy  N    POJf-y    r-A`zBBHyGHy@ HyGbHy  N    O #   y  J f$J f/9    Hy  ZHy   (N    p `  /9  N  XOR/ N  XO-@Jo" .    nЀ" Ё y    0 g.J f$BJg <  {` <  / /9    N    p `BHy  N    XOJg$ .    lr` .    or#    #     .N^NuNV n r-HXGbfX nXGgp` n N^NuNVJ m*r y    `(  f
S f `RA     op N^Nu    %s: can't find selection service
 %s: can't get current selection
 No message is selected Illegal message number. allowreversescan      N    O #   y  J f$J f/9    Hy  ZHy   (N    p `  /9  N  XOR/ N  XO-@Jo" .    nЀ" Ё y    0 g.J f$BJg <  {` <  / /9    N    p `BHy  N    XOJg$ .    lr` .    or#    #     .N^NuNV n r-HXGbfX n./share/src/sun/suntool/mailtool/cmds.o                                                                644       0      12        27160  4424737232  13351                                                                                                                                                                                                                                                                                                                                                                         %    H                NV  r#     n 0( r0gHy  %Hy  %N    PO/9    N    XON^NuNVHy  %N    XO-@Hx Jg/ N    XO    mp`B/ /. /. N  N^NuNVHyAw
/. N    PO-@HyAp
/ N    PO-@ n 0( r0f  HyEA	 n/N    POJgh n    f,BHy  %Hy  %Hy  %BB/N    O Jf2` @BHy  &(Hy  &Hy  &BB n/N    O Jg Hy  &PN    XOJglHy  &UN    XO-@g @Jf-|  &ZHn/.N    POHy  &hHnN    PO-@g"/ N    XOBBHn n/N    O BB n/N    O  n/( N    XO nB   n (     gBHy    HyF
/( N    O  nJ f/N    XO`$ n    fBHx HyF	/( N    N^NuNVJ    f
N    ` HyA3/9    N    PO-@f-|  &j/9    /.N    POJg  /.Hy  &lN    PO/9    N    XO y    B0/9    N    XOJl^ 9        l 9    A    /0 Hy  &v`/9    Hy  &}/9    N    O B/9    /9    N    O `./9    N    XO/./9    N    POHy  &N    XOJ    gN    N^NuNV n -h 
J  .g .  .exJ    gJ    fBHy  &/9    N    `X/9    N    XON    /9    /9    N    POJfBBHy  &`
BB/9    N  O N    #  .N^NuNV/. N    XO-@g B n 0( r0-@gBN    XO-@g N    /.Hy  &N    XOJg n 0( rfp`B` n 0( r/  n/( /.N    O Jg /.N    XOHyE8 n/N    PO-@B/ HyE8 n/( HyE!	aHxHyE8/N    O  BHx HyE2 n/N    O J    g  HyE2 n/N    PO-@Hx Hx Hy  &Hx Hy  &HnHn n/N    O  Hx /./. n/N    O B/.HyE2 n/N    O /.N    XO n (     gBHy    HyF
/( N    O N    rl.BHy  &Hy  &HyJK
 n/N    PO/ N    O J    g$N    / Hy  &N    POHy   N    XON^NuNV  /. BN  HPON^NuNVJ    gBHy  '/9    N    `nBN    XO-@g^N  %H-@N    Hy  'N    XO-@f .    gN    Jg/./.N    PO/./. /.N  N^NuNV  /. /. N  PON^NuNV  /. /. N  PON^NuNVN    BHx HyF	/9    N    O Hx Hx/9    N    O Hx Hx/9    N    O Hy  '%Hx N    POJ    gB/9    HyDM
/9    N    O /9    N    XON    N    JgFr#    B    Hy  '3/9    N    PON  % Hy  ':N    XO-@g
/ N    XOBN    XON^NuNV n -h 
J  .g .  .eh/9    N    XOHyA3/9    N    PO-@g @JfBHy  '@/9    N    `*/.N  XOBB/.N  O N    #  .N^NuNVJ    gBHy  'X/9    N    `  BN    XO-@g  HyAp
HyAw
/. N    PO/ N    PO-@HyJK
 @/N    PO-@N     n 0( r0/ Hy    /.N    O Jg  BHy    HyE-	aHnHyE_
 n/N    O    f@BHy  (Hy  (zHy  (LHy  (Hy  'Hy  'Hy  'Hy  '`/.N    O (Hy    N    XON^NuNVHy  (N    XO/ Hy  (N    PON    N    N    B    HyAp
/9    N    PO-@N    N    N^NuNVJ    gBHy  (/9    N    `  N  %H-@ n 0( rg8-y    D    /9    N    XO-@ .D    fL#    `B 9    Ѐ" Ё y    0 g/9    N    XO#    /9    N    XO-@/.Hx Hx Hx /.N    N^NuNV  BHx /. /. N  N^NuNV  Hx N  XON^NuNV  N^NuNV  Hx N  XON^NuNVJ    gBHy  (/9    N    `BN    XO-@g
/ N    XON^NuNV   n 1|  /. /. a PON^NuNVH J    gBHy  (/9    N    ` BN    XO-@g  Hy    N    XO .    fN    Hy    /.N    PON    Jf  J    g 9    `N    #    . `/N    XOSrnBN    XOBHy    N    POHy    N    XOHy  (N    XO*@Jg"BHUHy  )
Hy  )
Hy  )N    O `BHy  )!Hy  )Hy  )N    O HxN    XOL N^NuNV  /9    N    XON     n 0( r0gHy  )+Hy  )$N    PO/9    N    XON^NuNVBHy  ),N    XO/ Hy    BN    O Jg DHyAw
/. N    PO-@HyAp
/ N    PO-@HyE8 @/N    PO-@BHx HyE2/ HyE8Hy    HyE-	aHxHyE8BHyE2 n/N    O 0J    g  HyE2 n/N    PO-@Hx Hx Hy  )5Hx Hy  )2HnHn n/N    O  Hx /./. n/N    O B/.HyE2 n/N    O  n/N    XO n (     gBHy    HyF
/( N    N^NuNVJ    gBHy  )8/9    ` BN    XO-@g /. N    XO-@g N     n 0( r0/ 0( r/  n/( /.N    O Jg /.N    XOHyE8 n/N    PO-@BHywwwwHyE2/ HyE8 n/( HyE!	aHxHyE8/N    O (J    g~HyE2/.N    PO-@Hx Hx Hy  )CHx Hy  )@HnHn n/N    O  Hx /./. n/N    O B/.HyE2 n/N    O /.N    XO n (     gBHy    HyF
/( N    O J    g$N    / Hy  )FN    POHy   N    XON    rl*BHy  )Hy  )`HyJK
 n/N    PO/ N    N^NuNVHyAw
/. N    PO-@HyAp
/ N    PO-@ @!n  /.N    XON^NuNV  N  %H/ /. Hx N  HN^NuNVJ    gBHy  )/9    N    `8BN    XO-@g(BBHx  n 0( rr JWD//.N    N^NuNVJ    fBHy  )/9    N    ` N  %H-@ 9        rN    -@N    /.N    XO y    #     J    fvJ    gnJ    fB/9    HyAY	/9    N    O HyAp
/9    N    PO-@BHx HyD<	Hx HyDI @/N    O / N    O  .Ѐ" Ё y    /0 .Ѐ" Ё y    /0 N    PO#    J    gB    `Hy  )N    XOJg/.Hx BHx /9    N    O J    fX       g <  )` <  )/ /9    Hy  )/9    N    O /9    N    XOHx /9    N    PON^NuNV  J    fBHy  *9Hy  )/9    N    `
BN  XON^NuNVHyAp
/9    N    PO-@HyA3/9    N    PO/ HnN    POJ    g"HyA3/9    N    PO/ Hn N    PO/9    N    XO/9    N    XOB    J fN    `:B        fN    `"    fN    Hx Hy  *RN    PO#     J    fZ/9    N    XO/9    N    XO/9    N    XO/9    N    XO/9    N    XO-@ @#     #    B/.HyAp
/9    N    O BHx HyAN	!HnHyA3/9    N    O J    g&BHx HyAN	!Hn HyA3/9    N    O B/9    HyJ$
BHyJ!A/9    N    O B/9    HyJ$
BHyJ!A/9    N    O J    gN    N^NuNV . RЀ" Ё y    /0  . Ѐ" Ё y    /0 N    PO/. N    XOJ    ftJ    glJ    fB/9    HyAY	/9    N    O HyAp
/9    N    PO-@BBHyD<	Hx HyDI @/N    O / N    O  . Ѐ" Ё y    !     . Ѐ" Ёй    #     n 0( r0gHy  *SN    XOr JW`Hy  *]N    XOr JVD-A .     gJg   n 0( rg6-y    D    /. N    XO-@ .D    f#    `/. N    XO-@JfN  % `zJg* 9    g/. Hx BHx /.N    O `J .     f&BB/9    N    O `/. N    XO-@/.N    XO/.N    XOJ    fX       o <  *|` <  *~/ /9    Hy  *g/9    N    O /9    N    XOHx /9    N    PON^NuNVH  n 0( ~0-@HyAw
/. N    PO-@HyAp
/ N    PO-@*|  %`N~-GB/N    XO/ /HnHn n/N    O ~g/./. n/N    O XMJfB. Hn  n/N    POHyEA	 n/N    POJg BJ. g   n/( Hn N    POJg  BHn /9    N    POHy  */9    N    POHy  *N    XOJg~-GHy  *N    XOB/9    Hy  *Hy  *Hy  *BHx  n/N    O  -@JgHy  *Hy  *N    POJgBB n/N    O Jg6` `BB n/( /N    O Jf B n/( Hn N    POJfJ n (     g&    fBHx HyF	/( N    O ` nJ f
/N    XON    Jf  J    g 9    `N    #    . `/N    XOSrnBN    XOBHn N    POJf n/( N    XOBHy  +Hy  +Hy  *N    O HxN    XOJf n/N    XO nB   n (     g.BHy    HyF
/( N    `BHy  +	/9    N    L N^NuNVJ    gBHy  +/9    N    ` BN    XO-@g  HyA3/9    N    PO-@g @JfBHy  +%/9    N    `  N    N    /./.N    POJg/.N  XO`B/9    /9    N    O B /9    Hy  .N    POJ g/. /. /.a nO Hy  .N    XOHx ]Hy  .N    PO-@g
R nBHx Hy  .N    PON^NuNV n p 0( f0H` n p 0(  @|   "f   n 0(    f  J    fBHy  +=/9    N    `  B/. /9    N    PO/ /9    /9    N    O -@gzHyD[	a/ N    PO-@B/ HyA3/9    N    O B/.HyDY
/9    N    O /.Hy  +QN    PO`BHy  +wHy  +e/. /. N    N^NuNV n -h 
J  /gJg .  /eN n 0( r0g//. a vPO`8/9    N    XON    /. /. Hy  +xN  O N    #  /N^NuNVH J    fBHy    HyD 
aN    O #    ,9  /RB~`bHyD[	a/.N    PO/ /. N    POJfBR  //9  /HyDb
/.`  HyDb
/.N    PO* l-n,R/HyDI/9    N    O -@fS-GHy  +zN    XOJf~
`Hy  +N    XO/ N    XO. o*BR  //9  //. N    XO/ HyD\"/9    `XHyD[	a/.N    PO/ N    XOB/. N    XO/ HyD[	a/.N    O BR  //9  /HyDb
/.N    L N^NuNVl./9    N    XON    J    fN    Hy  +/. N    POr JWD-AJ gJ    fJ    gJgp`B-@ J g J    f J    g Jg J    f Hy  +Hx N    PO.9    ` Ѐ" Ё y    0 gSJnN    Jg @-y    p/9    HnxN    PO/9    Hy  +N    POJf  Hy  +/9    N    POJg .pR/ N    XOJfDBHy  -OHy  -Hy  ,Hy  ,Hy  ,Hy  ,MHy  ,Hy  +/9    N    O (`PJ f .pR#    J fp`B/ N    XOJ f"N  %H/ BBHx  .pR/ N    O ~#    BN    XOHnxN    XOHx :HnyN    PO-@tf Hx HnxN    PO` NBN    XOB.xJ    gHy  -|`&J    gHy  -/9    N    POJgHy  -HnxN    POJ    fvJg J.xgHy  -HnxN    POHy  -`D/9    /. N    POJg:J.xgHy  -HnxN    POHy  -HnxN    PO/. HnxN    POHy  -HnxN    POHnxHx N    PO/. N    XO-@o  /9    HnxN    PO#    B    B    N    Hx N    XON    B    N  %H/ BBHx /9    N    O BN    XOB    ~#    J    fB/9    HyAY	/9    N    O J    fHnxN    XOBHy  -/9    N    O Hx :HnyN    PO-@tHx Rt/.tN    PO` PJf  /9    HnxN    PO#    B    B    N    /9    N    XOBHy  -/9    N    O Hx :HnyN    PO-@tHx Rt/.tN    POBN    XON  % B    J    f  B/9    HyAY	/9    N    `  BN    XO/9    N    XOBHy  -/. N    POJf <  -` <  -/ /9    N    O Hx /9    N    PO/9    Hy  -N    POJfB/9    /9    N    ..lN^NuNV  r#    BB/9    N    O Hy    N    XOB    BB/9    N    N^NuNVHx N    XO-@ @0< "|  .P"QJ  .Tg/9    Hy  .PN    POJgp`BN^Nu  .   .  .   .5        expert  commitfrequency Confirm Do NOT clear window Are you sure you want to Clear window? Confirm Do NOT cancel window Are you sure you want to Cancel window? save DEAD ~/dead.letter w ~ echo "%s" cd: %s cd: errno=%d  No Mail % askcc |> <| Warning: low on fds. Don't use text filters or the text extras menu in composition windows. replysw setup, #fds = %d
 No Mail trash going idle... [None] trash Must specify file name. No Mail Insertion failed: memory buffer exceeded. You can get around this by undoing the Include, using the text menu to store the contents of the message composition window to a file, and then redoing the include. Or, you can enlarge the size of the memory buffer by using defaultsedit to increase the default value of 'memorymaximum' quitting mailtool, and starting again. source %s MAILRC No Mail No Mail No Mail printmail /bin/sh sh -c /usr/ucb/lpr lpr -p expert  askcc |> <| No Mail |> <| replysw setup, #fds = %d
 Warning: low on fds. Don't use text filters or the text extras menu in composition windows. No Mail No deleted messages. autoprint %d deleted message%s s  This instance of mailtool was not compiled with -DUSE_IMAGES. No images are available.  autoprint autoprint %d deleted message%s s   ? expert expert Yes: save edits in file No: use temporary file Do you want the edits to this window written back to expert  Mail Mail -t Can't save changes. No Mail Must specify file name. No saved file names set folder name to  input folder name  % filemenusize filemenusize % retrieving new mail... No new mail for Mail: skipping garbage before messages
 Mail is confused about the state of your spool file. This could occur if you did a commit while running another instance of Mail or mailtool since the last time you committed in *this* mailtool. Suggest you exit mailtool without committing your changes using the menu behind the 'Done' button. (Note: this will cause any messages that you deleted since the last time you commmited in mailtool to reappear.) loading messages [None] committing changes  and  retrieving new mail  and  switching to  ...  [No Mail] %  [No Mail] No mail for    |>subject<| |>body of message<| |>other recipients<| |>blind carbon copies<|    N^NuNVJ    gBHy  (/9    N    `  N  %H-@ n 0( rg8-y    D    /9    N    XO-@ .D    fL#    `B 9    Ѐ" Ё y    0 g/9    N    XO#    /9    N    XO-@/.Hx Hx Hx /.N    N^NuNV  BHx /. /. N  N^NuNV  Hx N  XON^NuNV  N^NuNV  Hx N  XON^NuNVJ    gBHy  (/9    N    `BN    XO-@g
/ N    XON^NuNV   n 1|  /. /. a PON^NuNVH J  ./share/src/sun/suntool/mailtool/mail.o                                                                644       0      12        17540  4424737233  13347                                                                                                                                                                                                                                                                                                                                                                         8                      NV  Hx HxN    PO#    B    B    Hx Hx N    PO#    Hx Hx N    PO#  PHx Hx N    PO#    Hx Hx N    PO#    Hx Hx N    PO#    r#    B  DN^NuNV  p N^NuNVHy  ^Hy    N    PO-@fp ` HxHy    N    PO#      HHy  `/.N    PO/.N    XOHnN    XOHnN    XON    #  @f  B/.N    POHx /.N    POHx /.N    POJ    g 9    `N    #    -@`/.N    XOS   nBHy  8Hy  N    O HxN    XO/.N    XO/.N    XOHy  /.N    PO#  HHy  /.N    PO#  LHy  /9    N    PO/9  @Hz 0Hy    N    O Hx Hx 
Hz hHy    N    pN^NuNV  Hy  Hy   (N    PO/9  HN    XO/9  LN    XOHy    N    XOHx N    XOp N^NuNV  J  Dg`Hy  Hy   (N    PO/9  HN    XO/9  LN    XOHy    N    XOHy  )Hy   (N    POHx N    XOp N^NuNVHy  =Hy    N    PO-@fp `@HxHy    N    POHy  ?/.N    PO/.N    XOHy    N  XOpN^NuNV  J g <  b` <  d/ N  XO/9  HN    XO/9  LN    XOHy    N    XON^NuNV  J gN    /. N    XO`N    N   N^NuNVHn/9    N    POJl,J    gHy    Hy  iN    POBN  XOp `  J    g"/9  X/././.Hy  N    O  .ذo  XnJf(J    gHy  N    XO#  XBN  `R .హ  Xo2J    gHy  N    XO#  XHx N  XON    `J    gHy  N    XOp      TWD N^NuNVB#   T 9  TgPrgf/9    N    XOHx /./9    N    O J    fB/.HyAY	/9    N    N^Nu#        -|  	-y    `#        -|  
-y    ` ~NV.Br-A/. Hy  N  PO`  Jg@Hx :/9    N    PO-@g$Hy  / N    POJfN  Jfp `  B 9    T/ N    XO-@  m.BHy  ^Hy  9/9    N    O SN  Jgl` y     >f#     y      *n"
    J g/- N    XO/9    N    XO+@ B   N  Jf #     9    RЀ" Ё y     p*nN^NuNV  /. Hy  qN  PO 9    N^NuNVHy  yN  XO y     "f8Hx " 9    R/ N    PO-@g @B 9    R/ /9    N    PON^NuNV0B 9  PX-@B .   -@ n B n JgHy  N    XOJg/. Hy  ` n  +f R` . / Hy  N  PO`
 n BR N  Jfn`RRN  JfHx /.Hy  /9    N    O BHy  @Hy  Hy  /9    /9    N     nB n   9  PXN^NuR   nHy  h/9    N    POJg b n  XR n Jf . d
 @ +R -y    ` . d @"nRR  n 
f n ( @fx/. HnlN    PO/9    N    XO y    B0/9    HnlN    POHn0HnlN    POrg(0.6     @ f n | / n  @R  . e nHxHy  k/9    N    O BHy  Hy  /9    /9    N    O  nBN  Jg `NVHy  N  XO`v/9    N    XOSй    -@ @BSHx =/9    N    PO-@g( @BR n "f n "fRB/.`Hy  /9    N    PON  JfN^NuNV  J f/. Hy  N  PO`8/. N    XOJf/. Hy  !N  PO`/. /. Hy  (N  N^NuNV  Hy  4N  XO/9    N    XO y    B0/9    /. N    PON^NuNV  /. Hy  9N  PON^NuNVHy  ?/. N    PO-@fp `  Hx/. N    POHx B/. /. /.N  O J    g,Hy  AN    XOJgHy  OHy  G/.N    O J    g,Hy  dN    XOJgHy  tHy  k/.N    O Hy  /.N    POJ gHx /. BB/.N  O J    gHy  /.N    PO/.N    XOpN^NuNVHy  /. N    PO-@fp ` Hx/. N    POJ    g <  ` <  / Hy  /.N    O Hy  N    XOJg,J    g <  ` <  / Hy  /.N    O J g,J    g <  ` <  / Hy  /.N    O J    g,Hy  N    XOJgHy  Hy  /.N    O Hy  $/.N    POJ    gHy  &/.N    POJ g`J    g <  ;` <  b/ /.N    POB/. BB/.N  O J    g <  ` <  / /.N    PO/.N    XOpN^NuNVHy  /. N    PO-@fp `  Hx/. N    POJ f$J    g <  ` <  / /.N    PO/. /. BB/.N  O J f$J    g <   ` <  E/ /.N    PO/.N    XOpN^NuNVHy  iN    XO-@f-|  pJ g2/. J g <  y` <  / Hy  r/9  HN    O `Hy  /9  HN    POJ g4/. J gpm`pf/  nHH/ Hy  /9  HN    O  nHH/ HH/ Hy  /9  HN    O /9  HN    XO/9  LHx /9    N    O JfB`~Hy  /9    N    POJf`Hy  /9    N    POJglHy  /9    N    POJfR`./. Hy  N    POSJn/. /9    N    PO/9  LHx /9    N    O Jf ~J g,/. Hy  N    PO`Hy  /9    N    POJg/9  LHx /9    N    O JfN^NuNV  /. /. Hy  N  N^NuNV./. /. Hy  N  O Hx [/9    N    PO*@Jg6Hx Hy  RMHUN    O JgHx Hy  HUN    Jfp`p *nN^NuNV./. /. /. Hy  N  O Hx [/9    N    PO*@Jg6Hx Hy   RMHUN    O JgHx Hy  	HUN    Jfp`p *nN^NuNV  J g2Hy  N    XOJf/. /. Hy  `@/. /. Hy  N`0Hy  YN    XOJg/. /. Hy  f`/. /. Hy  N  O Hx/. N    PON^NuNV  /. Hy  N  PON^NuNVHy    N    XO/. Hy  N  PO . Ѐ" Ё y      n "     . RЀ" Ё"y     1 -@ . R-@`4 .Ѐ" Ё y    ".  .Ѐ" Ё y    SR 9    RlR    N^NuNV/. Hy  N  PO . Ѐ" Ё y      . Ѐ" Ё y    /0N    XO-@ . R-@`4 .Ѐ" Ё y    ".Ӱ  .Ѐ" Ё y    RR 9    RlS    N^NuNV.r-A/. Hy  N  `  Hy  N    XO-@B/9    N    PO*@    eHy  HUN    POJg  Hy  N    XO-@B/9    N    PO*@    eHy  HUN    POJgT y     "f4Hx " 9    R/ N    PO*@JgRM :fRMHUN    XO-@/9    /9    N    PON  Jf  .*nN^NuNV  Hy  N  XOHy  /9    N    POJfp `pN^NuNV... `Jo& Ѐ" Ё y    0 gn޹        o . Ѐ" Ё y    0 f .     fN.. `8JoB Ѐ" Ё y    0 fHy  N    XOJgD     `        op ..N^NuNV  /. Hy  N  PO/9    N    XO y    B0/9    N    XON^NuNV.~#  D/. /. /. /. /9  HN    O Hy  %/9  HN    PO/9  HN    XO`2Hy  ./9    N    POJg8Jg/9    /9    N    PO~ /9  LHx /9    N    O JfB  D..N^NuNV  r#  D/. /. /. /. /9  HN    O Hy  1/9  HN    PO/9  HN    XON^NuNV  /9  LHx /9    N    O JgHy  :/9    N    POJf
B  Dp ` 9    N^Nu  P  U  X  [        Mail -N -B -f w From xxx Fri Jan  1 00:00:00 1970
 Mail w r [None] Mail process died! Aborting mailtool!
 Mailtool not able to communicate with Mail!
(Perhaps Mail is not an executable appropriate for this machine.)
 Aborting mailtool!
 w From xxx Fri Jan  1 00:00:00 1970
 x quit checking mailbox: stat = %d
No Mail

 checking mailbox:
size = %d,
last accessed = %d,
last modified = %d,
last checked = %d,
 No Mail

 New Mail

 No change

  [New Mail] from %d-$ : Invalid message number
 Maximum number of messages exceeded. Split this folder. from %d folder foldermenupullrights !ls -F %s folders %s %d folders exceeds maximum number (%d) allowed. Additional folders will be left off of folder menu. Suggest you combine several folders, or move some folders to other folder subdirectories. !
 Maximum number of characters (%d) in folder names exceeded. Suggest you delete or give some folders shorter names, or move some folders to other folder subdirectories. set  unset %s set %s set %s="%s" !pwd cd %s w askcc Cc: %s
 |>other recipients<| askbcc Bcc: %s
 |>blind carbon copies<| 
 |>body of message<|
 w To: %s
 |>recipients<|  asksub Subject: %s
 |>subject<|  Cc: %s
 |>other recipients<|  askbcc Bcc: %s
 |>blind carbon copies<| 
 |>body of message<|
 
----- Begin Forwarded Message -----

 
----- Begin Included Message -----

 
----- End Forwarded Message -----

 
----- End Included Message -----

 w 
----- Begin Forwarded Message -----

 
----- Begin Included Message -----

 
----- End Forwarded Message -----

 
----- End Included Message -----

 escape ~ %s %d
 Reply reply m
 %c%c %d
 %cp
%cq
 Message contains:
 (continue)
 
 
 
 Interrupt
 load %d %s copy %d %s Appended New file copy %d-%d %s Appended New file alwaysignore set alwaysignore
copy %d %s
unset alwaysignore copy %d %s alwaysignore unset alwaysignore
copy %d %s
set alwaysignore copy %d %s preserve %d delete %d undelete %d file %s complete
 complete
 removed
 removed
 inc Unknown command: "inc"
 allowreversescan echo %s 
echo 
 
 
echo 
 
      XOHx /./9    N    O J    fB/.HyAY	/9    N    N^Nu#        -|  	-y    `#        -|  
-y    ` ~NV.Br-A/. Hy  N  PO`  ./share/src/sun/suntool/mailtool/subr.o                                                                644       0      12          570  4424737233  13333                                                                                                                                                                                                                                                                                                                                                                         8                        NVH0 *n HUN    XOR/ N    XO(@"f2/9    Hy  8Hy   (N    O BN    XOHx N    XOHUHTN    PO L0 N^NuNVHnHnN    PO .N^NuNV"n  n JfpN^NuJggp `NV n BJ gn n  /gTHy  LN    XO/ /. N    PO n  ~fR /. N    XO n 0 /gHy  Q/. N    PO/. /. N    PON^Nu      %s: Out of memory!
 HOME /      ecipients<| askbcc Bcc: %s
 |>blind carbon copies<| 
 |>body of message<|
 w To: %s
 |>recipients<|  asksub Subject: %s
 |>subject<|  Cc./share/src/sun/suntool/mailtool/vars.o                                                                644       0      12         1350  4424737233  13350                                                                                                                                                                                                                                                                                                                                                                                P                NV   n  -fRH/N   XO`> n  nf( o fTH/N   XO`Hy  /. N  XO/ /. N   ^N^NuNVH /. /. N  ,PO*@.
fH/. N  vXO. Hx Hx N    PO*@/. N  XO+@   n *  n !x `/- N  XO+n  L N^NuNVH8*n Hy  HUN  ,PO&@JfHUHy  N    POp`rHUN  vXO. A  ȷ f  @  C  "qx  `A  (px `(T f(/+ N  XO/+ N  XOHSN    XOp L8N^NuNV.*n Hy  HUN    POJg
HUN    XO*nN^NuNV  Hy  /. N    POJf <  `/. N    XON^NuNV.Hy  /. N  ,PO*@Jf/. N    XO` - *nN^NuNVH /. N  vXO n *p `/. /- N    POJf 
`*U.
fp L N^NuNV. n ~ `
HHށJf rN    ..N^Nu    "%s": undefined variable
        -----

 w 
----- Begin Forwarded Message -----

 
----- Begin Included Message -----

 
----- End Forwarded Message -----

 
----- End Included Message -----

 escape ~ %s %d
 Reply reply m
 %c%c %d
 %cp
%cq
 Message contains:
 (continue)
 
 
 
 Interrupt
 load %d %s copy %d %s                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Jg@Hx :/9    N    PO-@g$Hy  / N    POJfN  Jfp `  B 9    T/ N    XO-@  m.BHy  ^Hy  9/9    N    O SN  Jgl` y     >f#     y      *n"
    J g/- N    XO/9    N    XO+@ B   N  Jf #     9    RЀ" Ё y     p*nN^NuNV  /. Hy  qN  PO 9    N^NuNVHy  yN  XO y     "f8Hx " 9    R/ N    PO-@g @B 9    R/ /9    N    PON^NuNV0B 9  PX-@B .   -@ n B n JgHy  N    XOJg/. Hy  ` n  +f R` . / Hy  N  PO`
 n BR N  Jfn`RRN  JfHx /.Hy  /9    N    O BHy  @Hy  Hy  /9    /9    N     nB n   9  PXN^NuR   nHy  h/9    N    POJg b n  XR n Jf . d
 @ +R -y    ` . d @"nRR  n 
f n ( @fx/. HnlN    PO/9    N    XO y    B0/9    HnlN    POHn0HnlN    POrg(0.6     @ f n | / n  @R  . e nHxHy  k/9    N    O BHy  Hy  /9    /9    N    O  nBN  Jg `NVHy  N  XO`v/9    N    XOSй    -@ @BSHx =/9    N    PO-@g( @BR n "f n "fRB/.`Hy  /9    N    PON  JfN^NuNV  J f/. Hy  N  PO`8/. N    XOJf/. Hy  !N  PO`/. /. Hy  (N  N^NuNV  Hy  4N  XO/9    N    XO y    B0/9    /. N    PON^NuNV  /. Hy  9N  PON^NuNVHy  ?/. N    PO-@fp `  Hx/. N    POHx B/. /. /.N  O J    g,Hy  AN    XOJgHy  OHy  G/.N    O J    g,Hy  dN    XOJgHy  tHy  k/.N    O Hy  /.N    POJ gHx /. BB/.N  O J    gHy  /.N    PO/.N    XOpN^NuNVHy  /. N    PO-@fp ` Hx/. N    POJ    g <  ` <  / Hy  /.N    O Hy  N    XOJg,J    g <  ` <  / Hy  /.N    O J g,J    g <  ` <  / Hy  /.N    O J    g,Hy  N    XOJgHy  Hy  /.N    O Hy  $/.N    POJ    gHy  &/.N    POJ g`J    g <  ;` <  b/ /.N    POB/. BB/.N  O J    g <  ` <  / /.N    PO/.N    XOpN^NuNVHy  /. N    PO-@fp `  Hx/. N    POJ f$J    g <  ` <  / /.N    PO/. /. BB/.N  O J f$J    g <   ` <  E/ /.N    PO/.N    XOpN^NuNVHy  iN    XO-@f-|  pJ g2/. J g <  y` <  / Hy  r/9  HN    O `Hy  /9  HN    POJ g4/. J gpm`pf/  nHH/ Hy  /9  HN    O  nHH/ HH/ Hy  /9  HN    O /9  HN    XO/9  LHx /9    N    O JfB`~Hy  /9    N    POJf`Hy  /9    N    POJglHy  /9    N    POJfR`./. Hy  N    POSJn/. /9    N    PO/9  LHx /9    N    O Jf ~J g,/. Hy  N    PO`Hy  /9    N    POJg/9  LHx /9    N    O JfN^NuNV  /. /. Hy  N  N^NuNV./. /. Hy  N  O Hx [/9    N    PO*@Jg6Hx Hy  RMHUN    O JgHx Hy  HUN    Jfp`p *nN^NuNV./. /. /. Hy  N  O Hx [/9    N    PO*@Jg6Hx Hy   RMHUN    O JgHx Hy  	HUN    Jfp`p *nN^NuNV  J g2Hy  N    XOJf/. /. Hy  `@/. /. Hy  N`0Hy  YN    XOJg/. /. Hy  f`/. /. Hy  N  O Hx/. N    PON^NuNV  /. Hy  N  PON^NuNVHy    N    XO/. Hy  N  PO . Ѐ" Ё y      n "     . RЀ" Ё"y     1 -@ . R-@`4 .Ѐ" Ё y    ".  .Ѐ" Ё y    SR 9    RlR    N^NuNV/. Hy  N  PO . Ѐ" Ё y      . Ѐ" Ё y    /0N    XO-@ . R-@`4 .Ѐ" Ё y    ".Ӱ  .Ѐ" Ё y    RR 9    RlS    N^NuNV.r-A/. Hy  N  `  Hy  N    XO-@B/9    N    PO*@    eHy  HUN    POJg  Hy  N    XO-@B/9    N    PO*@    eHy  HUN    POJgT y     "f4Hx " 9    R/ N    PO*@JgRM :fRMHUN    XO-@/9    /9    N    PON  Jf  .*nN^NuNV  Hy  N  XOHy  /9    N    POJfp `pN^NuNV... `Jo& Ѐ" Ё y    0 gn޹        o . Ѐ" Ё y    0 f .     fN.. `8JoB Ѐ" Ё y    0 fHy  N    XOJgD     `        op ..N^NuNV  /. Hy  N  PO/9    N    XO y    B0/9    N    XON^NuNV.~#  D/. /. /. /. /9  HN    O Hy  %/9  HN    PO/9  HN    XO`2Hy  ./9    N    POJg8Jg/9    /9    N    PO~ /9  LHx /9    N    O JfB  D..N^NuNV  r#  D/. /. /. /. /9  HN    O Hy  1/9  HN    PO/9  HN    XON^NuNV  /9  LHx /9    N    O JgHy  :/9    N    POJf
B  Dp ` 9    N^Nu  P  U  X  [        Mail -N -B -f w From xxx Fri Jan  1 00:00:00 1970
 Mail w r [None] Mail process died! Aborting mailtool!
 Mailtool not able to communicate with Mail!
(Perhaps Mail is not an executable appropriate for this machine.)
 Aborting mailtool!
 w From xxx Fri Jan  1 00:00:00 1970
 x quit checking mailbox: stat = %d
No Mail

 checking mailbox:
size = %d,
last accessed = %d,
last modified = %d,
last checked = %d,
 No Mail

 New Mail

 No change

  [New Mail] from %d-$ : Invalid message number
 Maximum number of messages exceeded. Split this folder. from %d folder foldermenupullrights !ls -F %s folders %s %d folders exceeds maximum number (%d) allowed. Additi