示例#1
0
文件: exef.c 项目: rmblair/tecoc
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;
}
示例#2
0
文件: flowel.c 项目: rmblair/tecoc
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;
}
示例#3
0
integer ExeU()					/* execute U command */
{
	DBGFEN(1,"ExeU",NULL);
	if (EStTop == EStBot) {			/* if no numeric argument */
		ErrMsg(ERR_NAU);
		DBGFEX(1,DbgFNm,"FAILURE, no arg before U");
		return FAILURE;
	}

	if (GetNmA() == FAILURE) {		/* get numeric argument */
		DBGFEX(1,DbgFNm,"FAILURE, GetNmA() failed");
		return FAILURE;
	}
	if (IncCBP() == FAILURE) {		/* increment to Q-reg name */
		DBGFEX(1,DbgFNm,"FAILURE, IncCBp() failed.");
		return FAILURE;
	}
	if (FindQR() == FAILURE) {
		DBGFEX(1,DbgFNm,"FAILURE, FindQR() failed");
		return FAILURE;
	}

	QR->Number = NArgmt;
	if (CmdMod & MARGIS) {			/* if m,nUq */
		DBGFEX(1,DbgFNm,"PushEx()");
		return PushEx(MArgmt, OPERAND);
	}

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

	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
示例#4
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;
}
示例#5
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;
}
示例#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;
}
示例#7
0
文件: exef.c 项目: rmblair/tecoc
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;
}
示例#8
0
文件: exef.c 项目: rmblair/tecoc
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;
}
示例#9
0
文件: exef.c 项目: rmblair/tecoc
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;
}
示例#10
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;
}
示例#11
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;
}
示例#12
0
/*****************************************************************************
	ExeDot()
	This function executes a . (dot) command.
	.	Equivalent to the number of characters between the
		beginning of the buffer and the current position of the
		pointer. Thus "." represents the current position of
		the pointer.
*****************************************************************************/
#include "zport.h"		/* define portability identifiers */
#include "tecoc.h"		/* define general identifiers */
#include "defext.h"		/* define external global variables */
DEFAULT ExeDot()		/* execute a . (dot) command */
{
#if DEBUGGING
	DBGFEN(1,"ExeDot",NULL);
	sprintf(DbgSBf,"PushEx(%ld)", (LONG)(GapBeg-EBfBeg));
	DbgFEx(1,DbgFNm,DbgSBf);
#endif
	return PushEx((LONG)(GapBeg-EBfBeg), OPERAND);
}
示例#13
0
integer ExeAtS()		/* execute an @ (at sign) command */
{
    DBGFEN(1,"ExeAtS",NULL);

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

    DBGFEX(1,DbgFNm,"SUCCESS");
    return SUCCESS;
}
示例#14
0
文件: exef.c 项目: rmblair/tecoc
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();
}
示例#15
0
文件: exef.c 项目: rmblair/tecoc
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;
}
示例#16
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);
}
示例#17
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;
}
示例#18
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);
}
示例#19
0
文件: exew.c 项目: rmblair/tecoc
static DEFAULT VDoW()		/* execute an nW command */
{
    DBGFEN(1,"VDoW",NULL);

#if CURSES
    if (NArgmt== (-4)) {
	redraw();
	wrefresh(curscr);    
	return SUCCESS;
    } else if (NArgmt==0 || NArgmt == 16) {
	redraw();
	refresh();
	return SUCCESS;
    } else if (NArgmt == -1) {
	skiprefresh = 1;
	return SUCCESS;
    } else if (NArgmt == 1) {
	skiprefresh = 0;
	return SUCCESS;
    } else if (NArgmt == 2) {	/* put line containing dot at top */
	p_scope_start=GapBeg;
	scope_start=GapBeg - EBfBeg;
	redraw();
	refresh();
        return SUCCESS;
    } else
	return SUCCESS;
#else  /* if CURSES */
#if DEBUGGING
    if (NArgmt == -1) {
	printf("VDoW: -1W refreshing the screen\r\n");
    } else if (NArgmt == 0) {
	printf("VDoW: 0W Placing default cursor line at 16. Forgetting.\r\n");
    } else if (NArgmt == -1000) {
	printf("VDoW: -1000W Forgetting output was done.\r\n");
    } else if (NArgmt < 0) {
	printf("VDoW: %ldW telling refresher top %ld lines are altered.\r\n",
		NArgmt, -NArgmt-1);
    } else {
	printf("VDoW: %ldW Placing def. cursor at line %ld. Forgetting.\r\n",
		NArgmt, NArgmt);
    }

    DBGFEX(1,DbgFNm,"SUCCESS");
    return SUCCESS;
#else
    return ExeNYI();
#endif /* DEBUGGING */
#endif /* CURSES */
}
示例#20
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;
}
示例#21
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;
}
示例#22
0
文件: exej.c 项目: rmblair/tecoc
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);
}
示例#23
0
文件: exebar.c 项目: rmblair/tecoc
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;
}
示例#24
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);
}
示例#25
0
文件: exer.c 项目: rmblair/tecoc
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);
}
示例#26
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;
}
示例#27
0
文件: exef.c 项目: rmblair/tecoc
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();
}
示例#28
0
文件: exew.c 项目: rmblair/tecoc
static DEFAULT VGetW()		/* execute an n:W command */
{
    DBGFEN(1,"VGetW",NULL);
    DBGFEX(1,DbgFNm,"PushEx()");
    return PushEx(	NArgmt==0 ? CrType :
			NArgmt==1 ? HtSize :
			NArgmt==2 ? VtSize :
			NArgmt==3 ? SeeAll :
			NArgmt==4 ? MrkFlg :
			NArgmt==5 ? HldFlg :
			NArgmt==6 ? TopDot :
			NArgmt==7 ? ScroLn :
#if CURSES
		        NArgmt==8 ? SpcMrk :
		        NArgmt==9 ? KeyPad :
#endif
		                             0 , OPERAND);
}
示例#29
0
文件: skpcmd.c 项目: rmblair/tecoc
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;
}
示例#30
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;
}