/* $Header:_force.c 12.0$ */
/* $ACIS:_force.c 12.0$ */
/* $Source: /ibm/acis/usr/src/usr.lib/libaed/RCS/_force.c,v $ */

#ifndef lint
static char *rcsid = "$Header:_force.c 12.0$";
#endif

#include "whim.h"
#define then
#ifdef DEBG
#define PRINTF if(1) printf
#else
#define PRINTF if(0) printf
#endif

VI_Force()

{
#include "whimdcl.h"
	INT16 done; 		/* true when orders complete */

#ifdef DEBUG
	printf("VI_Force: called\n");
#endif
	if(saving) JOURNL(V_FORCE);

	if (vikoff > ORDATA)	/* orders being built */
	{
		/* set length into command */
		vikint[ORLEN] = vikoff-ORDATA;

		/* output command */
		command(vikoff-1);

		/* check for faults */
		done = 0;
		while (done == 0) {
			/* read rc and parm data */
			vread(&vikint[1],ORYPOSN+1,0X4002);

			/* process normal end, or fault */
			switch (vikint[1]) {
			case 0:
				/* command complete.  Update modes */
				parms.merge   =	 vikint[ORMERGE];
				parms.fontid  =	 vikint[ORFONTID];
				parms.width   =	 vikint[ORWIDTH];
				parms.dashpat =	 vikint[ORDASHPAT];
				parms.dashlen =	 vikint[ORDASHLEN];
				parms.xposn   =	 vikint[ORXPOSN];
				parms.yposn   =	 vikint[ORYPOSN];

				done = 1;
				break;
			case 1:
				fontfault();	  /* font not found */
				break;
			case 2:
				charfault();	  /* char defn not found */
				break;
			}
		}

		/* reset length */
		vikoff = 0;
	}
	
}
