Populates the Redis Command Table starting from the hard coded list * we have on top of server.c file. */
| 3447 | /* Populates the Redis Command Table starting from the hard coded list |
| 3448 | * we have on top of server.c file. */ |
| 3449 | void populateCommandTable(void) { |
| 3450 | int j; |
| 3451 | int numcommands = sizeof(redisCommandTable)/sizeof(struct redisCommand); |
| 3452 | |
| 3453 | for (j = 0; j < numcommands; j++) { |
| 3454 | struct redisCommand *c = redisCommandTable+j; |
| 3455 | int retval1, retval2; |
| 3456 | |
| 3457 | /* Translate the command string flags description into an actual |
| 3458 | * set of flags. */ |
| 3459 | if (populateCommandTableParseFlags(c,c->sflags) == C_ERR) |
| 3460 | serverPanic("Unsupported command flag"); |
| 3461 | |
| 3462 | c->id = ACLGetCommandID(c->name); /* Assign the ID used for ACL. */ |
| 3463 | retval1 = dictAdd(server.commands, sdsnew(c->name), c); |
| 3464 | /* Populate an additional dictionary that will be unaffected |
| 3465 | * by rename-command statements in redis.conf. */ |
| 3466 | retval2 = dictAdd(server.orig_commands, sdsnew(c->name), c); |
| 3467 | serverAssert(retval1 == DICT_OK && retval2 == DICT_OK); |
| 3468 | } |
| 3469 | } |
| 3470 | |
| 3471 | void resetCommandTableStats(void) { |
| 3472 | struct redisCommand *c; |
no test coverage detected