#

include(`dict.h')
include(`KERcalls.h')

/*
 *       SCCS File Type - Emulator Source File
 *
 *       What identification string
 */
static char *_S_K00	"@(#)EM_K00.c	3.1";
	/****************************************************************/
	/*
	 *      K_build_segment
	 */

/*
 *      K_build_segment (
 *          1  &status,   : seg_stat_block: struct(* initial segment status *)
 *          2   da,       : discr_access  : int   (* initial segment access *)
 *          5  &segSeid,  : seid          : long  (* SEID given segment     *)
 *          6  &segDes,   : seg_des       : int   (* segment designator     *)
 *              )
 */

K_build_segment( Pstatus, Pda, PsegSeidP, PsegDesP)
	seg_stat_block  *Pstatus;
	discr_access    Pda;
	seid            *PsegSeidP;
	seg_des         *PsegDesP;
{
	K_err_num       ex;

	struct  {               /* Kbldseg_param */
			seg_stat_block  status;         /* const */
			discr_access    da;             /* const */
			/* vars */
			seid            vs_seid;
			seg_des         vsegDes;
		}pb;

	st_copy(Pstatus, &pb.status, sizeof(seg_stat_block) );
	pb.da = Pda;

	ex = EMT00(&pb);

	*PsegSeidP = pb.vs_seid;
	*PsegDesP = pb.vsegDes;

	return( ex );
}

