static int dictSdsKeyCaseCompare(void *privdata, const void *key1, const void *key2) { DICT_NOTUSED(privdata); return strcasecmp(key1, key2) == 0; }
static int _dictStringCopyHTKeyCompare(void *privdata, const void *key1, const void *key2) { DICT_NOTUSED(privdata); return strcmp(key1, key2) == 0; }
void dictSdsDestructor(void *privdata, void *val) { DICT_NOTUSED(privdata); sdsfree(val); }
void dictCounterDestructor(void *privdata, void *val) { DICT_NOTUSED(privdata); listNode *ln; listIter li; counter *cntr = val; pubsub *p; /* Unsubscribe everyone */ if (cntr->subscribers != NULL) { while (listLength(cntr->subscribers)) { ln = listFirst(cntr->subscribers); p = listNodeValue(ln); pubsubUnsubscribeCounter(p->c,cntr->name,1); } } /* Free all shards */ listRewind(cntr->shards,&li); while ((ln = listNext(&li)) != NULL) { shard *shrd = listNodeValue(ln); zfree(shrd); } listRelease(cntr->shards); if (cntr->want_acks) dictRelease(cntr->want_acks); /* cntr->name will be freed by the dict code. */ zfree(cntr); }
void dicttriggleDestructor(void *privdata, void *val) { DICT_NOTUSED(privdata); struct bridge_db_triggle_t *tmptrg=(struct bridge_db_triggle_t *)val; decrRefCount(tmptrg->lua_scripts); zfree(val); }
void dictObjectDestructor(void *privdata, void *val) { DICT_NOTUSED(privdata); if (val == NULL) return; /* Values of swapped out keys as set to NULL */ decrRefCount(val); }
void dict_string_destructor(void *privdata, void *val) { DICT_NOTUSED(privdata); struct string *s = val; string_deinit(s); dn_free(s); }
static void dict_node_destructor(void *privdata, void *val) { DICT_NOTUSED(privdata); struct gossip_node *node = val; node_deinit(node); dn_free(node); }
static void *_dictStringKeyValCopyHTValDup(void *privdata, const void *val) { int len = strlen(val); char *copy = _dictAlloc(len+1); DICT_NOTUSED(privdata); memcpy(copy, val, len); copy[len] = '\0'; return copy; }
int dictSdsKeyCompare(void *privdata, const void *key1, const void *key2) { int l1, l2; DICT_NOTUSED(privdata); l1 = sdslen((sds) key1); l2 = sdslen((sds) key2); if (l1 != l2) return 0; return memcmp(key1, key2, l1) == 0; }
static void *_dictStringDup(void *privdata, const void *key) { int len = strlen(key); char *copy = zmalloc(len+1); DICT_NOTUSED(privdata); memcpy(copy, key, len); copy[len] = '\0'; return copy; }
int dict_string_key_compare(void *privdata, const void *key1, const void *key2) { DICT_NOTUSED(privdata); const struct string *s1 = key1; const struct string *s2 = key2; //return (s1->len != s2->len)? 0 : strncmp(s1->data, s2->data, s1->len) == 0; return string_compare(s1, s2) == 0; }
/* This function gets called when a blocked client timed out in order to * send it a reply of some kind. */ void replyToBlockedClientTimedOut(client *c) { DICT_NOTUSED(c); /*if (c->btype == CLIENT_BLOCKED_JOB_REPL) { addReplySds(c, sdsnew("-NOREPL Timeout reached before replicating to " "the requested number of nodes\r\n")); return; } else if (c->btype == CLIENT_BLOCKED_QUEUES) { addReply(c,shared.nullmultibulk); } else { serverPanic("Unknown btype in replyToBlockedClientTimedOut()."); }*/ }
static int dict_node_key_compare(void *privdata, const void *key1, const void *key2) { DICT_NOTUSED(privdata); const struct gossip_node *node1 = key1; const struct gossip_node *node2 = key2; ASSERT(node1 == NULL || node2 == NULL); return (string_compare(&node1->dc, &node2->dc) == 0) && (string_compare(&node1->rack, &node2->rack) == 0) && (cmp_dyn_token(&node1->token, &node2->token) == 0); }
static void dictDbValDeferDestructor(void *privdata, void *val) { DICT_NOTUSED(privdata); listAddNodeHead(deferObjDelete, val); }
/* dictionary destructors for defering delete */ void dictDbKeyDeferDestructor(void *privdata, void *val) { DICT_NOTUSED(privdata); listAddNodeHead(deferSdsDelete, val); }
static void _dictStringDestructor(void *privdata, void *key) { DICT_NOTUSED(privdata); zfree(key); }
void dictValueDestructor(void *privdata, void *val) { DICT_NOTUSED(privdata); freeValue(val); }
void * dictStrDup (void *privdata, const void *val) { DICT_NOTUSED (privdata); return zstrdup ((char *) val); }
void dictStrDestructor (void *privdata, void *val) { DICT_NOTUSED (privdata); zfree (val); }
static void _dictJsonDestructor(void * privdata, void * value) { DICT_NOTUSED(privdata); json_decref((json_t *)value); }
static void _dictStringCopyHTKeyDestructor(void *privdata, void *key) { DICT_NOTUSED(privdata); _dictFree((void*)key); /* ATTENTION: const cast */ }
static void _dictStringKeyValCopyHTValDestructor(void *privdata, void *val) { DICT_NOTUSED(privdata); _dictFree((void*)val); /* ATTENTION: const cast */ }
void * dictSdsDup (void *privdata, const void *val) { DICT_NOTUSED (privdata); return sdsdup ((sds) val); }
static void _listDestructor(void * p, void * value) { DICT_NOTUSED(p); listRelease((list*)value); }
/* ==================================================================== * Dict Helpers * ==================================================================== */ static void *dictSdsDup(void *privdata, const void *string) { DICT_NOTUSED(privdata); return sdsnew(string); }
static void dictRedisObjectDestructor(void *privdata, void *val) { DICT_NOTUSED(privdata); decrRefCount(val); }
int dictStrKeyCaseCompare (void *privdata, const void *key1, const void *key2) { DICT_NOTUSED (privdata); return strcasecmp ((char *) key1, (char *) key2) == 0; }
static void _varintDestructor(void * privdata, void * value) { DICT_NOTUSED(privdata); DECREF((varint_t*)value); }
void dictCacheEntryDestructor(void *privdata, void *val) { DICT_NOTUSED(privdata); free(val); }