Lines Matching defs:pDict

70 static char *dictCopyName(FICL_DICT *pDict, STRINGINFO si);
82 void dictAbortDefinition(FICL_DICT *pDict)
86 pFW = pDict->smudge;
89 pDict->here = (CELL *)pFW->name;
119 void dictAlign(FICL_DICT *pDict)
121 pDict->here = alignPtr(pDict->here);
130 int dictAllot(FICL_DICT *pDict, int n)
132 char *cp = (char *)pDict->here;
136 if ((unsigned)n <= dictCellsAvail(pDict) * sizeof (CELL))
144 if ((unsigned)n <= dictCellsUsed(pDict) * sizeof (CELL))
147 cp -= dictCellsUsed(pDict) * sizeof (CELL);
152 pDict->here = PTRtoCELL cp;
162 int dictAllotCells(FICL_DICT *pDict, int nCells)
167 if (nCells <= dictCellsAvail(pDict))
168 pDict->here += nCells;
175 if (nCells <= dictCellsUsed(pDict))
176 pDict->here -= nCells;
178 pDict->here -= dictCellsUsed(pDict);
181 pDict->here += nCells;
191 void dictAppendCell(FICL_DICT *pDict, CELL c)
193 *pDict->here++ = c;
202 void dictAppendChar(FICL_DICT *pDict, char c)
204 char *cp = (char *)pDict->here;
206 pDict->here = PTRtoCELL cp;
216 FICL_WORD *dictAppendWord(FICL_DICT *pDict,
224 return dictAppendWord2(pDict, si, pCode, flags);
234 FICL_WORD *dictAppendWord2(FICL_DICT *pDict,
249 pName = dictCopyName(pDict, si);
250 pFW = (FICL_WORD *)pDict->here;
251 pDict->smudge = pFW;
260 pDict->here = pFW->param;
263 dictUnsmudge(pDict);
274 void dictAppendUNS(FICL_DICT *pDict, FICL_UNS u)
276 *pDict->here++ = LVALUEtoCELL(u);
285 int dictCellsAvail(FICL_DICT *pDict)
287 return pDict->size - dictCellsUsed(pDict);
295 int dictCellsUsed(FICL_DICT *pDict)
297 return pDict->here - pDict->dict;
309 void dictCheck(FICL_DICT *pDict, FICL_VM *pVM, int n)
311 if ((n >= 0) && (dictCellsAvail(pDict) * (int)sizeof(CELL) < n))
316 if ((n <= 0) && (dictCellsUsed(pDict) * (int)sizeof(CELL) < -n))
321 if (pDict->nLists > FICL_DEFAULT_VOCS)
323 dictResetSearchOrder(pDict);
326 else if (pDict->nLists < 0)
328 dictResetSearchOrder(pDict);
346 static char *dictCopyName(FICL_DICT *pDict, STRINGINFO si)
348 char *oldCP = (char *)pDict->here;
355 dictAlign(pDict);
356 return (char *)pDict->here;
369 pDict->here = PTRtoCELL cp;
370 dictAlign(pDict);
388 FICL_DICT *pDict;
394 pDict = ficlMalloc(sizeof (FICL_DICT));
395 assert(pDict);
396 memset(pDict, 0, sizeof (FICL_DICT));
397 pDict->dict = ficlMalloc(nAlloc);
398 assert(pDict->dict);
400 pDict->size = nCells;
401 dictEmpty(pDict, nHash);
402 return pDict;
429 void dictDelete(FICL_DICT *pDict)
431 assert(pDict);
432 ficlFree(pDict);
442 void dictEmpty(FICL_DICT *pDict, unsigned nHash)
446 pDict->here = pDict->dict;
448 dictAlign(pDict);
449 pHash = (FICL_HASH *)pDict->here;
450 dictAllot(pDict,
456 pDict->pForthWords = pHash;
457 pDict->smudge = NULL;
458 dictResetSearchOrder(pDict);
546 int dictIncludes(FICL_DICT *pDict, void *p)
548 return ((p >= (void *) &pDict->dict)
549 && (p < (void *)(&pDict->dict + pDict->size))
559 FICL_WORD *dictLookup(FICL_DICT *pDict, STRINGINFO si)
566 assert(pDict);
570 for (i = (int)pDict->nLists - 1; (i >= 0) && (!pFW); --i)
572 pHash = pDict->pSearch[i];
590 FICL_DICT *pDict = pSys->dp;
596 assert(pDict);
608 for (i = (int)pDict->nLists - 1; (i >= 0) && (!pFW); --i)
610 pHash = pDict->pSearch[i];
624 void dictResetSearchOrder(FICL_DICT *pDict)
626 assert(pDict);
627 pDict->pCompile = pDict->pForthWords;
628 pDict->nLists = 1;
629 pDict->pSearch[0] = pDict->pForthWords;
641 void dictSetFlags(FICL_DICT *pDict, UNS8 set, UNS8 clr)
643 assert(pDict->smudge);
644 pDict->smudge->flags |= set;
645 pDict->smudge->flags &= ~clr;
654 void dictSetImmediate(FICL_DICT *pDict)
656 assert(pDict->smudge);
657 pDict->smudge->flags |= FW_IMMEDIATE;
667 void dictUnsmudge(FICL_DICT *pDict)
669 FICL_WORD *pFW = pDict->smudge;
670 FICL_HASH *pHash = pDict->pCompile;
689 CELL *dictWhere(FICL_DICT *pDict)
691 return pDict->here;