This function does exactly the reverse of the function above: it gets * as input an integer with the xored flags and returns a string representing * the selected classes. The string returned is an sds string that needs to * be released with sdsfree(). */
| 68 | * the selected classes. The string returned is an sds string that needs to |
| 69 | * be released with sdsfree(). */ |
| 70 | sds keyspaceEventsFlagsToString(int flags) { |
| 71 | sds res; |
| 72 | |
| 73 | res = sdsempty(); |
| 74 | if ((flags & NOTIFY_ALL) == NOTIFY_ALL) { |
| 75 | res = sdscatlen(res,"A",1); |
| 76 | } else { |
| 77 | if (flags & NOTIFY_GENERIC) res = sdscatlen(res,"g",1); |
| 78 | if (flags & NOTIFY_STRING) res = sdscatlen(res,"$",1); |
| 79 | if (flags & NOTIFY_LIST) res = sdscatlen(res,"l",1); |
| 80 | if (flags & NOTIFY_SET) res = sdscatlen(res,"s",1); |
| 81 | if (flags & NOTIFY_HASH) res = sdscatlen(res,"h",1); |
| 82 | if (flags & NOTIFY_ZSET) res = sdscatlen(res,"z",1); |
| 83 | if (flags & NOTIFY_EXPIRED) res = sdscatlen(res,"x",1); |
| 84 | if (flags & NOTIFY_EVICTED) res = sdscatlen(res,"e",1); |
| 85 | if (flags & NOTIFY_STREAM) res = sdscatlen(res,"t",1); |
| 86 | if (flags & NOTIFY_MODULE) res = sdscatlen(res,"d",1); |
| 87 | } |
| 88 | if (flags & NOTIFY_KEYSPACE) res = sdscatlen(res,"K",1); |
| 89 | if (flags & NOTIFY_KEYEVENT) res = sdscatlen(res,"E",1); |
| 90 | if (flags & NOTIFY_KEY_MISS) res = sdscatlen(res,"m",1); |
| 91 | return res; |
| 92 | } |
| 93 | |
| 94 | /* The API provided to the rest of the Redis core is a simple function: |
| 95 | * |
no test coverage detected