/* * d i c t C r e a t e W o r d l i s t * Create and initialize an anonymous wordlist */ ficlHash * ficlDictionaryCreateWordlist(ficlDictionary *dictionary, int bucketCount) { ficlHash *hash; ficlDictionaryAlign(dictionary); hash = (ficlHash *)dictionary->here; ficlDictionaryAllot(dictionary, sizeof (ficlHash) + (bucketCount - 1) * sizeof (ficlWord *)); hash->size = bucketCount; ficlHashReset(hash); return (hash); }
/* * d i c t E m p t y * Empty the dictionary, reset its hash table, and reset its search order. * Clears and (re-)creates the hash table with the size specified by nHash. */ void ficlDictionaryEmpty(ficlDictionary *dictionary, unsigned bucketCount) { ficlHash *hash; dictionary->here = dictionary->base; ficlDictionaryAlign(dictionary); hash = (ficlHash *)dictionary->here; ficlDictionaryAllot(dictionary, sizeof (ficlHash) + (bucketCount - 1) * sizeof (ficlWord *)); hash->size = bucketCount; ficlHashReset(hash); dictionary->forthWordlist = hash; dictionary->smudge = NULL; ficlDictionaryResetSearchOrder(dictionary); }
FICL_PLATFORM_EXTERN int dictAllot (ficlDictionary *dictionary, int n) { ficlDictionaryAllot(dictionary, n); return 0; }