[net.micro.att] UNIX PC quickie environment, installment 6

adam@npois.UUCP (Adam V. Reed) (05/21/85)

/* 2v.c */
/* When executed in the login shell or in a shell
window (preferably, but not necessarily, the only active shell window)
this program will divide the screen between two 24-line high vertical,
asynchronous windows. Substitue sh if you don't have ksh. */

#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <sys/font.h>
#include <sys/window.h>
#include <wind.h>

main()
	{
	struct uwdata thiswindow;
	extern int errno;
	int pid;

	(void)ioctl(0,WIOCGETD,&thiswindow);
	thiswindow.uw_x = 364;
	thiswindow.uw_y = 12;
	thiswindow.uw_width = 356;
	thiswindow.uw_height = 288;
	thiswindow.uw_uflags |= NBORDER;
	(void)ioctl(0,WIOCSETD,&thiswindow);

	if ((pid=fork()) == 0)
		{
		(void)winit();
		if (wprexec()) wexit(errno);
		thiswindow.uw_x = 0;
		thiswindow.uw_width = 357;
		(void)ioctl(0,WIOCSETD,&thiswindow);
		if (execl("/bin/ksh","/bin/ksh",0)) wexit(errno);
		}
		else exit(pid);
	}