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

	ExeC()

	This function executes a C command.

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

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

extern	DEFAULT	DoCJR();	/* do C, J or R stuff */
extern	DEFAULT	GetNmA();	/* get numeric argument */
extern	VOID	UMinus();	/* handle unary minus */

EXTERN	WORD	EStBot;		/* expression stack bottom */
EXTERN	WORD	EStTop;		/* expression stack top */
EXTERN	LONG	NArgmt;		/* numeric argument */


DEFAULT ExeC()			/* execute a C command */
{
#if DEBUGGING
DbgInd+=2;if(DbgLvl>=1){DbgMsg();DbgDBf("ExeC: called.\015\012");DbgROf();}
#endif

	if (EStTop == EStBot)			/* if no numeric argument */
		NArgmt = 1L;			/* default is 1C */
	else
		{
		UMinus();			/* if it's -C, make it -1C */
		if (GetNmA() == FAILURE)
#if DEBUGGING
{if(DbgLvl>=1)
{DbgMsg();DbgDBf("ExeC: returning FAILURE.\015\012");DbgROf();}DbgInd-=2;
#endif
			return(FAILURE);
#if DEBUGGING
}
#endif
		}

#if DEBUGGING
if(DbgLvl>=1){DbgMsg();
DbgDBf("ExeC: returning DoCJR().\015\012");DbgROf();}DbgInd-=2;
#endif
	return(DoCJR(NArgmt));
}
