/*
 ----------------------------------------------------------------
 |    Perlin Production Corporation, February-April 1993 (c).	|##
 |   WINDOW PACKAGE Source Code for SuperSoft C 1.2.3 compiler.	|##
 |    V e r s i o n  3.1 , part 3.  LAST CHANGES: 08.05.1993.	|##
 ----------------------------------------------------------------##
  #################################################################

			LIST OF FUNCTIONS:
	def_wn
	defs_wn
*/

#include "stdio.h"
#include "conio.h"
#include "wios.h"
#include "stddef.h"

char def_wn(xst,yst,xen,yen,border,wn)
char xst,yst,xen,yen;
BORDER *border;
WINDOW *wn;
{
	wn->xs=xst;
	wn->ys=yst;
	wn->xe=xen;
	wn->ye=yen;
	wn->brd=border;
	wn->fill=BLANK;
	wn->name=NULL;
	wn->bgrnd=NORM_VID;
	wn->bdr_att=NORM_VID;
	wn->l_mg=1;
	wn->r_mg=1;
	wn->t_xs=xst+2;
	wn->t_ys=yst+1;
	wn->t_xe=xen-2;
	wn->t_ye=yen-1;
	wn->t_lgt=xen-xst-3;
	wn->t_hgt=yen-yst-1;
	wn->row=0;
	wn->col=0;
	wn->winstate=ORDINARY;
	wn->scrbuffer=wn->winbuffer=NULL;
	wn->tfdynamic=FALSE;			/* dynamic window allocation */
	wn->tfvisible=FALSE;
	if (border) wn->shadow=SHADOW_2;
	else wn->shadow=NO_SHADOW;
	if (wn->t_lgt < 1 || wn->t_hgt < 1 ) return (werrno=WENOTP);
	return (werrno=WENOERR);
}

char defs_wn(xst,yst,xr,yr,border,wn)
char xst,yst,xr,yr;
BORDER *border;
WINDOW *wn;
{
	return def_wn(xst,yst,xst+xr-1,yst+yr-1,border,wn);
}
