X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/e2641e09cc0daf44f63f654230f72d22acf3a9af..ef231a7c56cafc42ff486b91d88ae7ec642a2117:/src/dict.h diff --git a/src/dict.h b/src/dict.h index 30ace4db..74bcd2aa 100644 --- a/src/dict.h +++ b/src/dict.h @@ -74,10 +74,13 @@ typedef struct dict { int iterators; /* number of iterators currently running */ } dict; +/* If safe is set to 1 this is a safe iteartor, that means, you can call + * dictAdd, dictFind, and other functions against the dictionary even while + * iterating. Otherwise it is a non safe iterator, and only dictNext() + * should be called while iterating. */ typedef struct dictIterator { dict *d; - int table; - int index; + int table, index, safe; dictEntry *entry, *nextEntry; } dictIterator; @@ -132,11 +135,13 @@ dictEntry * dictFind(dict *d, const void *key); void *dictFetchValue(dict *d, const void *key); int dictResize(dict *d); dictIterator *dictGetIterator(dict *d); +dictIterator *dictGetSafeIterator(dict *d); dictEntry *dictNext(dictIterator *iter); void dictReleaseIterator(dictIterator *iter); dictEntry *dictGetRandomKey(dict *d); void dictPrintStats(dict *d); unsigned int dictGenHashFunction(const unsigned char *buf, int len); +unsigned int dictGenCaseHashFunction(const unsigned char *buf, int len); void dictEmpty(dict *d); void dictEnableResize(void); void dictDisableResize(void);