Beispiel #1
0
integer ExeV()			/* execute an V command */
{
	long firstarg;

	DBGFEN(1,"ExeV",NULL);
	if (EStTop == EStBot) {			/* if no numeric argument */
		NArgmt = 1;			/* default is 1V */
	} else {
		UMinus();			/* if it's -V, make it -1V */
		if (GetNmA() == FAILURE) {	/* get numeric argument */
			DBGFEX(1,DbgFNm,"FAILURE");
			return FAILURE;
		}
	}

	firstarg = 1 - ((CmdMod & MARGIS) ? MArgmt : NArgmt);
	if (firstarg <= 0) {
		TypBuf(GapBeg+Ln2Chr(firstarg), GapBeg);
	} else {
		TypBuf(GapEnd+1, GapEnd+Ln2Chr(firstarg)+1);
	}

	if (NArgmt <= 0) {
		TypBuf(GapBeg+Ln2Chr(NArgmt), GapBeg);
	} else {
		TypBuf(GapEnd+1, GapEnd+Ln2Chr(NArgmt)+1);
	}

	CmdMod = '\0';				/* clear modifiers flags */

	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #2
0
/*****************************************************************************
	ExeLst()
	This function executes a less-than-sign (<) command.
	n<	Iterate n times
*****************************************************************************/
#include "zport.h"		/* define portability identifiers */
#include "tecoc.h"		/* define general identifiers */
#include "defext.h"		/* define external global variables */
#include "deferr.h"		/* define identifiers for error messages */
DEFAULT ExeLst()				/* execute a  < command */
{
	DBGFEN(1,"ExeLst",NULL);
	if (++LStTop >= LPS_SIZE) {		/* if loop stack is full */
		ErrMsg(ERR_PDO);		/* push-down list overflow */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}
	if (EStTop == EStBot) {			/* if no numeric argument */
		NArgmt = INFINITE;		/* make it an infinite loop */
	} else {
		if (GetNmA() == FAILURE) {	/* get numeric argmument */
			DBGFEX(1,DbgFNm,"FAILURE");
			return FAILURE;
		}
		if (NArgmt <= 0) {		/* if null loop */
			if (FlowEL()== FAILURE) { /* flow to end of loop */
				DBGFEX(1,DbgFNm,"FAILURE");
				return FAILURE;
			}
			CmdMod = '\0';		/* clear modifiers flags */
			DBGFEX(1,DbgFNm,"SUCCESS");
			return SUCCESS;
		}
	}
	LStack[LStTop].LIndex = NArgmt;		/* store loop index */
	LStack[LStTop].LAddr = CBfPtr;		/* store loop start */
	CmdMod = '\0';				/* clear modifiers flags */
	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #3
0
DEFAULT FlowEL()		/* flow to end of loop */
{
	WORD	TmpNst;		/* temporary loop nest count */

	DBGFEN(3,"FlowEL",NULL);

	TmpNst = 1;
	do {
		if (CBfPtr == CStEnd) {		/* if end of command string */
			ErrUTC();		/* unterminated command */
			DBGFEX(3,DbgFNm,"FAILURE");
			return FAILURE;
		}
		++CBfPtr;			/* move to next command */
		if (*CBfPtr == '<') {		/* if loop start character */
			++TmpNst;		/* increment nesting count */
		} else if (*CBfPtr == '>') {	/* else if loop end char */
			--TmpNst;		/* decrement nesting count */
		} else {
			if (SkpCmd() == FAILURE) {
				DBGFEX(3,DbgFNm,"FAILURE");
				return FAILURE;
			}
		}
	} while (TmpNst > 0);

	if (TraceM) {				/* if tracing is on */
		EchoIt(*CBfPtr);		/* echo the character */
	}
	--LStTop;				/* pop loop stack */

	DBGFEX(3,DbgFNm,"FlowEL");
	return SUCCESS;
}
Beispiel #4
0
static DEFAULT ExeFD()			/* execute an FD command */
{
	DBGFEN(1,"ExeFD",NULL);

/*
 * The command m,nFD is illegal: the user should use m,nFB
 */

	if (CmdMod & MARGIS) {			/* if it's m,nFD */
		ErrStr(ERR_ILL, "m,nFD");	/* illegal command "m,nFD" */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	if (CmdMod & DCOLON) {			/* if it's ::FD */
		ErrStr(ERR_ILL, "::FD");	/* illegal command "::FD" */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	SrcTyp = S_SEARCH;
	if (Search(FALSE) == FAILURE) {
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	if (Matchd) {				/* if successful search */
		GapBeg += RefLen;		/* delete found string */
	}

	CmdMod = '\0';				/* clear modifiers flags */

	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #5
0
static DEFAULT SkpOne()		/* skip one command character */
{
#if DEBUGGING
	static char *DbgFNm = "SkpOne";
	sprintf(DbgSBf,"*CBfPtr = '%c'", *CBfPtr);
	DbgFEn(3,DbgFNm,DbgSBf);
#endif
	if (CBfPtr == CStEnd) {
		if (MStTop < 0) {		/* if not in a macro */
			ErrUTC();		/* unterminated command */
			DBGFEX(3,DbgFNm,"FAILURE");
			return FAILURE;
		} else {
			DBGFEX(3,DbgFNm,"SUCCESS");
			return SUCCESS;
		}
	}

	++CBfPtr;

#if DEBUGGING
	sprintf(DbgSBf,"*CBfPtr = '%c'", *CBfPtr);
	DbgFEx(3,DbgFNm,DbgSBf);
#endif
	return SUCCESS;
}
Beispiel #6
0
integer ExeGtr()				/* execute a > command */
{
	DBGFEN(1,"ExeGtr",NULL);

	if (LStTop == LStBot) {			/* if not in loop */
		ErrMsg(ERR_BNI);		/* BNI = > not in iteration */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	if (LStack[LStTop].LIndex != INFINITE) {/* if not infinite loop */
		--LStack[LStTop].LIndex;	/* decrement loop counter */
	}
	if ((LStack[LStTop].LIndex == INFINITE) ||	/* if infinite loop */
	    (LStack[LStTop].LIndex > 0)) {	/* or more iterations to do */
		CBfPtr = LStack[LStTop].LAddr;	/* jump to front of loop */
	} else {
		--LStTop;			/* leave the loop */
	}
	CmdMod = '\0';				/* clear modifiers flags */
	EStTop = EStBot;			/* clear expression stack */

	DBGFEX(1,DbgFNm,"SUCCESS");

	return SUCCESS;
}
Beispiel #7
0
static DEFAULT ExeFUn()				/* execute an F_ command */
{
	DBGFEN(1,"ExeFUn",NULL);

/*
 * The command m,nF_ is illegal: the user should use m,nFC
 */


	if (CmdMod & MARGIS) {			/* if it's m,nF_ */
		ErrStr(ERR_ILL, "m,nF_");	/* illegal command "m,nF_" */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	if (CmdMod & DCOLON) {			/* if it's ::F_ */
		ErrStr(ERR_ILL, "::F_");	/* illegal command "::F_" */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	SrcTyp = U_SEARCH;

	if (Replac() == FAILURE) {
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	CmdMod = '\0';				/* clear modifiers flags */

	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #8
0
static DEFAULT ExeFK()			/* execute an FK command */
{
	DBGFEN(1,"ExeFK",NULL);

	if (CmdMod & MARGIS) {			/* if it's m,nFK */
		ErrStr(ERR_ILL, "m,nFK");	/* illegal command "m,nFK" */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	if (CmdMod & DCOLON) {			/* if it's ::FK */
		ErrStr(ERR_ILL, "::FK");	/* illegal command "::FK" */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	SrcTyp = FK_SEARCH;

	if (Search(FALSE) == FAILURE) {
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	CmdMod = '\0';				/* clear modifiers flags */

	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #9
0
/*****************************************************************************
	ExeEY()
	This function executes an EY command.
*****************************************************************************/
#include "zport.h"		/* define portability identifiers */
#include "tecoc.h"		/* define general identifiers */
#include "defext.h"		/* define external global variables */
DEFAULT ExeEY()			/* execute an EY command */
{
	BOOLEAN	ColonMod;
	DBGFEN(1,"ExeEY",NULL);
	ColonMod = (CmdMod & COLON);		/* is it :EY ? */
	CmdMod &= ~COLON;			/* clear modifiers flags */
	GapBeg = EBfBeg;			/* clear the...   */
	GapEnd = EBfEnd;			/*   ...edit buffer */
	if (IsEofI[CurInp]) {			/* if at end-of-file */
		if (ColonMod) {			/* if it's :EY */
			DBGFEX(1,DbgFNm,"PushEx(0)");
			return PushEx(0L, OPERAND);
		} else {
			EStTop = EStBot;	/* clear expression stack */
			DBGFEX(1,DbgFNm,"SUCCESS");
			return SUCCESS;
		}
	}
	if (RdPage() == FAILURE) {		/* read a page */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}
	if (ColonMod) {				/* if it's :EY */
		DBGFEX(1,DbgFNm,"PushEx(-1)");
		return PushEx(-1L, OPERAND);
	}
	EStTop = EStBot;			/* clear expression stack */
	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #10
0
integer
DoCJR(long HowFar)                /* do C, J or R stuff */
/* long HowFar;                         positive or negative displacement */
{
    long    InRange;
    bool ColonMod;

#if DEBUGGING
    static char *DbgFNm = "DoCJR";
    sprintf(DbgSBf,"HowFar = %ld", HowFar);
    DbgFEn(2,DbgFNm,DbgSBf);
#endif

    ColonMod = (CmdMod & COLON);                /* is it :C, :J, or :R? */
    CmdMod &= ~COLON;                        /* clear : flag */

    InRange = -1;                                /* -1 means SUCCESS in TECO */
    if (HowFar > 0)
    {
        if ((GapEnd + HowFar) > EBfEnd)
            InRange = 0;                /* 0 means FAILURE in TECO */
        else
        {
            MEMMOVE(GapBeg, GapEnd + 1, HowFar);
            GapBeg += HowFar;
            GapEnd += HowFar;
        }
    }
    else
    {
        if ((GapBeg + HowFar) < EBfBeg)
            InRange = 0;                /* 0 means FAILURE in TECO */
        else
        {
            GapBeg += HowFar;
            GapEnd += HowFar;
            MEMMOVE(GapEnd+1, GapBeg, -(HowFar));
        }
    }

    if (ColonMod)                      /* if colon modifier */
    {
        DBGFEX(2,DbgFNm,"PushEx");
        return PushEx(InRange, OPERAND);
    }
    else if (InRange == 0)              /* if out-of-bounds */
    {
        ErrChr(ERR_POP, *CBfPtr);
        DBGFEX(2, DbgFNm, "FAILURE");
        return FAILURE;
    }

    CmdMod = '\0';                                /* clear modifiers flags */
    EStTop = EStBot;                        /* clear expression stack */

    DBGFEX(2,DbgFNm,"SUCCESS");

    return SUCCESS;
}
Beispiel #11
0
integer ExeCCC()		/* execute a control-^ command */
{
	DBGFEN(1,"ExeCCC",NULL);

	if (IncCBP() == FAILURE) {
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	DBGFEX(1,DbgFNm,"PushEx()");
	return PushEx((long)*CBfPtr, OPERAND);
}
Beispiel #12
0
DEFAULT GetAra()		/* get m,n addresses */
{
	LONG	TmpLng;

#if DEBUGGING
	static char *DbgFNm = "GetAra";
	sprintf(DbgSBf,"MArgmt = %ld, NArgmt = %ld", MArgmt, NArgmt);
	DbgFEn(4,DbgFNm,DbgSBf);
#endif

	if (MArgmt < 0) {			/* if negative m */
		ErrMsg(ERR_NCA);		/* negative argument to , */
		DBGFEX(4,DbgFNm,"FAILURE, negative m");
		return FAILURE;
	}

	if (NArgmt < 0)	{			/* if negative n */
		ErrStr(ERR_POP, ErrTxt);	/* POP = pointer off page */
		DBGFEX(4,DbgFNm,"FAILURE, negative n");
		return FAILURE;
	}

	if (MArgmt > NArgmt) {			/* if wrong order */
		TmpLng = NArgmt;
		NArgmt = MArgmt;
		MArgmt = TmpLng;
	}

	AraBeg = EBfBeg + MArgmt;		/* compute area beginning */
	if (AraBeg > GapBeg-1) {		/* if past start of gap */
		AraBeg += (GapEnd-GapBeg) + 1;	/* correct for gap */
	}

	AraEnd = (EBfBeg + NArgmt) - 1;		/* compute area end */
	if (AraEnd > GapBeg-1) {		/* if before end of gap */
		AraEnd += (GapEnd-GapBeg) + 1;	/* correct for gap */
	}

	if ((AraBeg > EBfEnd) ||		/* if m or n too large */
	    (AraEnd > EBfEnd)) {
		ErrStr(ERR_POP, ErrTxt);	/* POP = pointer off page */
		DBGFEX(4,DbgFNm,"FAILURE");
		return FAILURE;
	}

#if DEBUGGING
	sprintf(DbgSBf,"SUCCESS, AraBeg = %ld, AraEnd = %ld",
		Zcp2ul(AraBeg), Zcp2ul(AraEnd));
	DbgFEx(4,DbgFNm,DbgSBf);
#endif
	return SUCCESS;
}
Beispiel #13
0
static int
DoCtVW(charptr EndArg, unsigned char TmpChr)        /* do a control-V or control-W */
/* charptr EndArg;                         ptr to end of string argument */
/* unsigned char TmpChr;                 temporary character */
{
    unsigned char WVFlag = TmpChr;                /* ^W or ^V flag */
    DBGFEN(3, "DoCtVW", NULL);

    if (++CBfPtr == EndArg)                 /* move past ^W or ^V,  too far? */
    {
        ErrMsg(ERR_ISS);                /* yes, illegal search string */
        DBGFEX(2, DbgFNm, "FAILURE");
        return FAILURE;
    }

    if ((*CBfPtr == '^') && ((EdFlag & ED_CARET_OK) == 0))
    {
        if (++CBfPtr == EndArg)
        {
            ErrMsg(ERR_ISS);
            DBGFEX(2, DbgFNm, "FAILURE");
            return FAILURE;
        }
        TmpChr = To_Upper(*CBfPtr);

        if ((TmpChr < '@') || (TmpChr > '_'))
        {
            ErrChr(ERR_IUC, *CBfPtr);
            DBGFEX(2, DbgFNm, "FAILURE");
            return FAILURE;
        }
        TmpChr &= '\077';
    }
    else
        TmpChr = *CBfPtr;

    if (WVFlag == CTRL_V)
        if (TmpChr == CTRL_V)
            CaseCv = LOWER;
        else
            *BBfPtr++ = To_Lower(TmpChr);
    else
        if (TmpChr == CTRL_W)
            CaseCv = UPPER;
        else
            *BBfPtr++ = To_Upper(TmpChr);

    DBGFEX(2, DbgFNm, "SUCCESS");
    return SUCCESS;
}
Beispiel #14
0
static DEFAULT ExeFS()			/* execute an FS command */
{
	DBGFEN(1,"ExeFS",NULL);

/*
 * The command m,nFS is illegal: the user should use m,nFC
 */

	if (CmdMod & MARGIS) {			/* if it's m,nFS */
		ErrStr(ERR_ILL, "m,nFS");	/* illegal command "m,nFS" */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

/*
 * If it's ::FStext$,  it's a compare,  not a search.  The text argument is
 * compared to the characters immediately following the character pointer.
 * It returns -1 if the strings match, else 0.  A ::FStext$ command is
 * equivalent to a .,.+1:FCtext$ command, so that's the way it's implemented.
 */

	if (CmdMod & DCOLON) {			/* if it's ::FS */
		if (CmdMod & MARGIS) {		/* if it's m,n::FS */
			ErrStr(ERR_ILL, "m,n::FS");
			DBGFEX(1,DbgFNm,"FAILURE");
			return FAILURE;
		}
		if (EStTop > EStBot) {		/* if it's n::FS */
			ErrStr(ERR_ILL, "n::FS");
			DBGFEX(1,DbgFNm,"FAILURE");
			return FAILURE;
		}
		if (GapEnd == EBfEnd) {		/* if nothing to search */
			CmdMod = '\0';		/* clear modifiers flags */
			DBGFEX(1,DbgFNm,"PushEx(0)");
			return PushEx(0L,OPERAND);
		}
		CmdMod &= ~DCOLON;		/* clear double-colon bit */
		CmdMod |= COLON;		/* set colon bit */
		CmdMod |= MARGIS;		/* set m defined bit */
		MArgmt = GapBeg - EBfBeg;	/* set m */
		if (PushEx((LONG)((GapBeg-EBfBeg)+1),OPERAND) == FAILURE) {
			DBGFEX(1,DbgFNm,"FAILURE, PushEx() failed");
			return FAILURE;
		}
		DBGFEX(1,DbgFNm,"ExeFC()");
		return ExeFC();			/* execute FC command */
	}

	SrcTyp = S_SEARCH;
	if (Replac() == FAILURE) {
		DBGFEX(1,DbgFNm,"FAILURE, Replac() failed");
		return FAILURE;
	}

	CmdMod = '\0';				/* clear modifiers flags */

	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #15
0
integer ExeExc()		/* execute a ! (exclamation mark) command */
{
	DBGFEN(1,"ExeExc",NULL);
	if (FindES('!') == FAILURE) {		/* simply skip to next '!' */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	CmdMod = '\0';				/* clear modifiers flags */
	EStTop = EStBot;			/* clear expression stack */

	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #16
0
/*****************************************************************************
	ExeRtP()
	This function executes a ) command.
*****************************************************************************/
#include "zport.h"		/* define portability identifiers */
#include "tecoc.h"		/* define general identifiers */
#include "defext.h"		/* define external global variables */
#include "deferr.h"		/* define identifiers for error messages */
DEFAULT ExeRtP()		/* execute right parenthesis command */
{
	DBGFEN(1,"ExeRtP",NULL);
/*
 * if no numeric arg.  or not a number
 */
	if ((EStTop == EStBot) || (EStack[EStTop].ElType != OPERAND)) {
		ErrMsg(ERR_NAP);		/* no argument before ) */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}
	DBGFEX(1,DbgFNm,"PushEx(')')");
	return PushEx((LONG)')', OPERATOR);
}
Beispiel #17
0
DEFAULT ExeJ()			/* execute J command */
{
	DBGFEN(1,"ExeJ",NULL);

	if (EStTop == EStBot) {			/* if no numeric argument */
		NArgmt = 0;			/* default is 0J */
	} else {
		if (GetNmA() == FAILURE) {	/* get numeric argument */
			DBGFEX(1,DbgFNm,"FAILURE");
			return FAILURE;
		}
	}
	DBGFEX(1,DbgFNm,"DoCJR()");
	return DoCJR(EBfBeg-GapBeg+NArgmt);
}
Beispiel #18
0
DEFAULT ExeBar()		/* execute | (vertical bar) command */
{
	DBGFEN(1,"ExeBar",NULL);

	if (FlowEC() == FAILURE) {		/* flow to ' */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	CmdMod = '\0';				/* clear modifiers flags */
	EStTop = EStBot;			/* clear expression stack */

	DBGFEX(1,DbgFNm,"SUCCESS");

	return SUCCESS;
}
Beispiel #19
0
/*****************************************************************************
	ExeCtD()
	This function executes a ^D (control-D or caret-D) command.  This
command sets the radix to decimal.
*****************************************************************************/
#include "zport.h"		/* define portability identifiers */
#include "tecoc.h"		/* define general identifiers */
#include "defext.h"		/* define external global variables */
DEFAULT ExeCtD()		/* execute a ^D (control-D) command */
{
	DBGFEN(1,"ExeCtD",NULL);
	Radix = 10;
	CmdMod = '\0';				/* clear modifiers flags */
	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #20
0
integer ExeC()			/* execute a C command */
{
	DBGFEN(1,"ExeC",NULL);

	if (EStTop == EStBot) {			/* if no numeric argument */
		NArgmt = 1;			/* default is 1C */
	} else {
		UMinus();			/* if it's -C, make it -1C */
		if (GetNmA() == FAILURE) {
			DBGFEX(1,DbgFNm,"FAILURE");
			return FAILURE;
		}
	}

	DBGFEX(1,DbgFNm,"DoCJR");
	return DoCJR(NArgmt);
}
Beispiel #21
0
/*****************************************************************************
	ExeCom()
	This function executes a , (comma argument separator) command.
*****************************************************************************/
#include "zport.h"		/* define portability identifiers */
#include "tecoc.h"		/* define general identifiers */
#include "defext.h"		/* define external global variables */
#include "deferr.h"		/* define identifiers for error messages */
DEFAULT ExeCom()		/* execute a , (comma) command */
{
	DBGFEN(1,"ExeCom",NULL);
	if (EStTop == EStBot) {			/* if no numeric argument */
		ErrMsg(ERR_NAC);		/* no arg before , */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}
	if (GetNmA() == FAILURE) {
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}
	MArgmt = NArgmt;
	CmdMod |= MARGIS;
	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #22
0
DEFAULT ExeR()			/* execute a R command */
{
	DBGFEN(1,"ExeR",NULL);

	if (EStTop == EStBot) {			/* if no numeric argument */
		NArgmt = 1;			/* default is 1R */
	} else {
		UMinus();			/* if it's -R, make it -1R */
		if (GetNmA() == FAILURE) {
			DBGFEX(1,DbgFNm,"FAILURE");
			return FAILURE;
		}
	}

	DBGFEX(1,DbgFNm,"DoCJR()");
	return DoCJR(-NArgmt);
}
Beispiel #23
0
integer ExeAtS()		/* execute an @ (at sign) command */
{
    DBGFEN(1,"ExeAtS",NULL);

    CmdMod |= ATSIGN;		/* set at sign */

    DBGFEX(1,DbgFNm,"SUCCESS");
    return SUCCESS;
}
Beispiel #24
0
static DEFAULT ExeFR()			/* execute an FR command */
{
	DBGFEN(1,"ExeFR",NULL);

	if ((GapBeg-RefLen) < EBfBeg) {		/* if out of range */
		ErrMsg(ERR_DTB);		/* DTB = "delete too big" */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	GapBeg += RefLen;			/* delete */

	CmdMod = (CmdMod & COLON);		/* retain only colon bit */
	EStTop = EStBot;			/* clear expression stack */

	DBGFEX(1,DbgFNm,"ExeI()");
	return ExeI();
}
Beispiel #25
0
static DEFAULT ExeFBr()			/* execute an F| command */
{
	DBGFEN(1,"ExeFBr",NULL);

	CmdMod = '\0';				/* clear modifiers flags */
	EStTop = EStBot;			/* clear expression stack */

	DBGFEX(1,DbgFNm,"FlowEE()");
	return FlowEE();
}
Beispiel #26
0
static DEFAULT SkpDqu()		/* skip a " (double quote) command */
{
	DBGFEN(3,"SkpDqu",NULL);
	if (CBfPtr == CStEnd)			/* if end of command string */
		if (MStTop < 0)			/* if not in a macro */
			{
			ErrUTC();		/* unterminated command */
			return FAILURE;
			}
		else
			return SUCCESS;
	++CBfPtr;
	switch (To_Upper(*CBfPtr)) {
		case 'A':
		case 'C':
		case 'D':
		case 'E':
		case 'F':
		case 'U':
		case '=':
		case 'G':
		case '>':
		case 'L':
		case 'S':
		case 'T':
		case '<':
		case 'N':
		case 'R':
		case 'V':
		case 'W':
			break;

		default:
			ErrMsg(ERR_IQC);    /* ill. char. after " */
			DBGFEX(3,DbgFNm,"FAILURE");
			return FAILURE;
	}

	CmdMod = '\0';				/* clear modifiers flags */

	DBGFEX(3,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #27
0
static DEFAULT ExeFLs()			/* execute an F< command */
{
	DBGFEN(1,"ExeFLs",NULL);

	CmdMod = '\0';				/* clear modifiers flags */
	EStTop = EStBot;			/* clear expression stack */
	CBfPtr = (LStTop == LStBot) ? CStBeg-1 : LStack[LStTop].LAddr;

	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #28
0
/*****************************************************************************
	ExeCtR()
	This function executes a ^R (control-R or caret-R) command.  The
control-R command sets TECO's radix,  which controls how ASCII strings are
converted to/from their binary representations.  The current radix is used
by the backslash command and whenever TECO encounters a string of digits in
a command string.
*****************************************************************************/
#include "zport.h"		/* define portability identifiers */
#include "tecoc.h"		/* define general identifiers */
#include "defext.h"		/* define external global variables */
#include "deferr.h"		/* define identifiers for error messages */
DEFAULT ExeCtR()		/* execute a ^R (control-R) command */
{
	DBGFEN(1,"ExeCtR",NULL);
	if ((EStTop == EStBot) ||		    /* if no numeric arg or */
	    (EStack[EStTop].ElType != OPERAND)) {     /* partial expression */
		DBGFEX(1,DbgFNm,"PushEx");
		return PushEx((LONG)Radix, OPERAND);
	}
	if (GetNmA() == FAILURE) {
		DBGFEX(1,DbgFNm,"FAILURE, GetNmA() failed");
		return FAILURE;
	}
	if ((NArgmt != 8) && (NArgmt != 10) && (NArgmt != 16)) {
		ErrMsg(ERR_IRA);	/* illegal radix with ^R */
		DBGFEX(1,DbgFNm,"FAILURE, illegal radix");
		return FAILURE;
	}
	Radix = (DEFAULT)NArgmt;
	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #29
0
/*****************************************************************************
	ExeCln()
	This function handles the colon and double-colon modifiers.
	This function implements the modifiers by setting bits in the
CmdMod variable.  Commands which are sensitive to colon or double colon
modification check CmdMod explicitly.
*****************************************************************************/
#include "zport.h"		/* define portability identifiers */
#include "tecoc.h"		/* define general identifiers */
#include "defext.h"		/* define external global variables */
DEFAULT ExeCln()		/* execute : or :: modifiers */
{
	DBGFEN(1,"ExeCln",NULL);
	if (CmdMod & COLON) {			/* if colon bit is set */
		CmdMod &= ~COLON;		/* clear colon bit */
		CmdMod |= DCOLON;		/* set double-colon bit */
	} else {
		CmdMod |= COLON;		/* set colon bit */
	}
	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Beispiel #30
0
static DEFAULT ExeFC()			/* execute an FC command */
{
	DBGFEN(1,"ExeFC",NULL);

	if (CmdMod & DCOLON) {			/* if it's ::FC */
		ErrStr(ERR_ILL, "::FC");	/* illegal command "::FC" */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	SrcTyp = FB_SEARCH;
	if (Replac() == FAILURE) {
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	CmdMod = '\0';				/* clear modifiers flags */

	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}