/*****************************************************************************

	TmpEI()

	This function execute a "temporary" EI command.  It is used to
implement initialization files (see ZIniFl) and mung commands (see Mung).
It builds an EI command string using the contents of the file specification
buffer and then executes it.

*****************************************************************************/

#include "ZPort.h"		/* define portability identifiers */
#include "DefTeco.h"		/* define general identifiers */
#include "DefChars.h"		/* define identifiers for characters */

extern	DEFAULT	ExeCSt();	/* execute a command string */

EXTERN	char	*CBfPtr;	/* pointer into command buffer */
EXTERN	char	*CStEnd;	/* pointer to last char of command string */
EXTERN	WORD	EStBot;		/* expression stack bottom */
EXTERN	WORD	EStTop;		/* expression stack top */
EXTERN	char	FBfBeg[];	/* file specification buffer */
EXTERN	char	*FBfPtr;	/* pointer into file specification buffer */



VOID TmpEI()			/* initialize system-dependent stuff */
{
	char	MngBeg[256];	/* temporary command string (mung) buffer */
	char	*MngPtr;	/* pointer into mung buffer */
	char	*TmpPtr;	/* temporary pointer */


	MngPtr = MngBeg;
	*MngPtr++ = 'e';
	*MngPtr++ = 'i';
	TmpPtr = FBfBeg;
	while (TmpPtr < FBfPtr)
		*MngPtr++ = *TmpPtr++;
	*MngPtr++ = ESCAPE;
	*MngPtr = ESCAPE;
	CBfPtr = MngBeg;		/* command string start */
	CStEnd = MngPtr;		/* command string end */
	EStTop = EStBot;		/* clear expression stack */
	ExeCSt();			/* execute command string */
}
