X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/af4e866dbb1455a50d51b3d5f46832f1a36e2080..497fc8775fd4b85289a6998bb4eaddbe657e6be7:/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);