Lines Matching refs:pVM

70 void vmBranchRelative(FICL_VM *pVM, int offset)  in vmBranchRelative()  argument
72 pVM->ip += offset; in vmBranchRelative()
83 FICL_VM *vmCreate(FICL_VM *pVM, unsigned nPStack, unsigned nRStack) in vmCreate() argument
85 if (pVM == NULL) in vmCreate()
87 pVM = (FICL_VM *)ficlMalloc(sizeof (FICL_VM)); in vmCreate()
88 assert (pVM); in vmCreate()
89 memset(pVM, 0, sizeof (FICL_VM)); in vmCreate()
92 if (pVM->pStack) in vmCreate()
93 stackDelete(pVM->pStack); in vmCreate()
94 pVM->pStack = stackCreate(nPStack); in vmCreate()
96 if (pVM->rStack) in vmCreate()
97 stackDelete(pVM->rStack); in vmCreate()
98 pVM->rStack = stackCreate(nRStack); in vmCreate()
101 if (pVM->fStack) in vmCreate()
102 stackDelete(pVM->fStack); in vmCreate()
103 pVM->fStack = stackCreate(nPStack); in vmCreate()
106 pVM->textOut = ficlTextOut; in vmCreate()
108 vmReset(pVM); in vmCreate()
109 return pVM; in vmCreate()
118 void vmDelete (FICL_VM *pVM) in vmDelete() argument
120 if (pVM) in vmDelete()
122 ficlFree(pVM->pStack); in vmDelete()
123 ficlFree(pVM->rStack); in vmDelete()
125 ficlFree(pVM->fStack); in vmDelete()
127 ficlFree(pVM); in vmDelete()
141 void vmExecute(FICL_VM *pVM, FICL_WORD *pWord) in vmExecute() argument
143 pVM->runningWord = pWord; in vmExecute()
144 pWord->code(pVM); in vmExecute()
161 void vmInnerLoop(FICL_VM *pVM) in vmInnerLoop() argument
163 M_INNER_LOOP(pVM); in vmInnerLoop()
196 void vmInnerLoop(FICL_VM *pVM)
198 IPTYPE ip = pVM->ip;
199 FICL_STACK *pStack = pVM->pStack;
254 FICL_DICT *vmGetDict(FICL_VM *pVM) in vmGetDict() argument
256 assert(pVM); in vmGetDict()
257 return pVM->pSys->dp; in vmGetDict()
269 char *vmGetString(FICL_VM *pVM, FICL_STRING *spDest, char delimiter) in vmGetString() argument
271 STRINGINFO si = vmParseStringEx(pVM, delimiter, 0); in vmGetString()
291 STRINGINFO vmGetWord(FICL_VM *pVM) in vmGetWord() argument
293 STRINGINFO si = vmGetWord0(pVM); in vmGetWord()
297 vmThrow(pVM, VM_RESTART); in vmGetWord()
313 STRINGINFO vmGetWord0(FICL_VM *pVM) in vmGetWord0() argument
315 char *pSrc = vmGetInBuf(pVM); in vmGetWord0()
316 char *pEnd = vmGetInBufEnd(pVM); in vmGetWord0()
348 vmUpdateTib(pVM, pSrc); in vmGetWord0()
360 int vmGetWordToPad(FICL_VM *pVM) in vmGetWordToPad() argument
363 char *cp = (char *)pVM->pad; in vmGetWordToPad()
364 si = vmGetWord(pVM); in vmGetWordToPad()
385 STRINGINFO vmParseString(FICL_VM *pVM, char delim) in vmParseString() argument
387 return vmParseStringEx(pVM, delim, 1); in vmParseString()
390 STRINGINFO vmParseStringEx(FICL_VM *pVM, char delim, char fSkipLeading) in vmParseStringEx() argument
393 char *pSrc = vmGetInBuf(pVM); in vmParseStringEx()
394 char *pEnd = vmGetInBufEnd(pVM); in vmParseStringEx()
419 vmUpdateTib(pVM, pSrc); in vmParseStringEx()
428 CELL vmPop(FICL_VM *pVM) in vmPop() argument
430 return stackPop(pVM->pStack); in vmPop()
438 void vmPush(FICL_VM *pVM, CELL c) in vmPush() argument
440 stackPush(pVM->pStack, c); in vmPush()
449 void vmPopIP(FICL_VM *pVM) in vmPopIP() argument
451 pVM->ip = (IPTYPE)(stackPopPtr(pVM->rStack)); in vmPopIP()
460 void vmPushIP(FICL_VM *pVM, IPTYPE newIP) in vmPushIP() argument
462 stackPushPtr(pVM->rStack, (void *)pVM->ip); in vmPushIP()
463 pVM->ip = newIP; in vmPushIP()
472 void vmPushTib(FICL_VM *pVM, char *text, FICL_INT nChars, TIB *pSaveTib) in vmPushTib() argument
476 *pSaveTib = pVM->tib; in vmPushTib()
479 pVM->tib.cp = text; in vmPushTib()
480 pVM->tib.end = text + nChars; in vmPushTib()
481 pVM->tib.index = 0; in vmPushTib()
485 void vmPopTib(FICL_VM *pVM, TIB *pTib) in vmPopTib() argument
489 pVM->tib = *pTib; in vmPopTib()
499 void vmQuit(FICL_VM *pVM) in vmQuit() argument
501 stackReset(pVM->rStack); in vmQuit()
502 pVM->fRestart = 0; in vmQuit()
503 pVM->ip = NULL; in vmQuit()
504 pVM->runningWord = NULL; in vmQuit()
505 pVM->state = INTERPRET; in vmQuit()
506 pVM->tib.cp = NULL; in vmQuit()
507 pVM->tib.end = NULL; in vmQuit()
508 pVM->tib.index = 0; in vmQuit()
509 pVM->pad[0] = '\0'; in vmQuit()
510 pVM->sourceID.i = 0; in vmQuit()
519 void vmReset(FICL_VM *pVM) in vmReset() argument
521 vmQuit(pVM); in vmReset()
522 stackReset(pVM->pStack); in vmReset()
524 stackReset(pVM->fStack); in vmReset()
526 pVM->base = 10; in vmReset()
536 void vmSetTextOut(FICL_VM *pVM, OUTFUNC textOut) in vmSetTextOut() argument
539 pVM->textOut = textOut; in vmSetTextOut()
541 pVM->textOut = ficlTextOut; in vmSetTextOut()
551 void vmTextOut(FICL_VM *pVM, char *text, int fNewline) in vmTextOut() argument
553 assert(pVM); in vmTextOut()
554 assert(pVM->textOut); in vmTextOut()
555 (pVM->textOut)(pVM, text, fNewline); in vmTextOut()
565 void vmThrow(FICL_VM *pVM, int except) in vmThrow() argument
567 if (pVM->pState) in vmThrow()
568 longjmp(*(pVM->pState), except); in vmThrow()
572 void vmThrowErr(FICL_VM *pVM, char *fmt, ...) in vmThrowErr() argument
576 vsprintf(pVM->pad, fmt, va); in vmThrowErr()
577 vmTextOut(pVM, pVM->pad, 1); in vmThrowErr()
579 longjmp(*(pVM->pState), VM_ERREXIT); in vmThrowErr()