ficlWord * ficlDictionarySet2ConstantInstruction(ficlDictionary *dictionary, ficlString s, ficlInstruction instruction, ficl2Integer value) { ficlWord *word; word = ficlDictionaryLookup(dictionary, s); /* * only reuse the existing word if we're sure it has space for a * 2constant */ #if FICL_WANT_FLOAT if ((word != NULL) && ((((ficlInstruction)word->code) == ficlInstruction2ConstantParen) || (((ficlInstruction)word->code) == ficlInstructionF2ConstantParen))) #else if ((word != NULL) && ((((ficlInstruction)word->code) == ficlInstruction2ConstantParen))) #endif /* FICL_WANT_FLOAT */ { word->code = (ficlPrimitive)instruction; word->param[0].u = FICL_2UNSIGNED_GET_HIGH(value); word->param[1].u = FICL_2UNSIGNED_GET_LOW(value); } else { word = ficlDictionaryAppend2ConstantInstruction(dictionary, s, instruction, value); } return (word); }
ficlWord * ficlDictionarySetConstantInstruction(ficlDictionary *dictionary, ficlString name, ficlInstruction instruction, ficlInteger value) { ficlWord *word = ficlDictionaryLookup(dictionary, name); ficlCell c; if (word == NULL) { word = ficlDictionaryAppendConstantInstruction(dictionary, name, instruction, value); } else { word->code = (ficlPrimitive)instruction; c.i = value; word->param[0] = c; } return (word); }
ficlWord * ficlDictionarySetPrimitive(ficlDictionary *dictionary, char *name, ficlPrimitive code, ficlUnsigned8 flags) { ficlString s; ficlWord *word; FICL_STRING_SET_FROM_CSTRING(s, name); word = ficlDictionaryLookup(dictionary, s); if (word == NULL) { word = ficlDictionaryAppendPrimitive(dictionary, name, code, flags); } else { word->code = (ficlPrimitive)code; word->flags = flags; } return (word); }
FICL_PLATFORM_EXTERN ficlWord *ficlLookupLoc (ficlSystem *system, ficlString name) { return ficlDictionaryLookup(ficlSystemGetLocals(system), name); }
FICL_PLATFORM_EXTERN ficlWord *dictLookup (ficlDictionary *dictionary, ficlString name) { return ficlDictionaryLookup(dictionary, name); }
/************************************************************************** f i c l L o o k u p ** Look in the system dictionary for a match to the given name. If ** found, return the address of the corresponding ficlWord. Otherwise ** return NULL. **************************************************************************/ ficlWord *ficlSystemLookup(ficlSystem *system, char *name) { ficlString s; FICL_STRING_SET_FROM_CSTRING(s, name); return ficlDictionaryLookup(system->dictionary, s); }