MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / rewriteConfigEnumOption

Function rewriteConfigEnumOption

src/config.cpp:1615–1622  ·  view source on GitHub ↗

Rewrite an enumeration option. It takes as usually state and option name, * and in addition the enumeration array and the default value for the * option. */

Source from the content-addressed store, hash-verified

1613 * and in addition the enumeration array and the default value for the
1614 * option. */
1615void rewriteConfigEnumOption(struct rewriteConfigState *state, const char *option, int value, configEnum *ce, int defval) {
1616 sds line;
1617 const char *name = configEnumGetNameOrUnknown(ce,value);
1618 int force = value != defval;
1619
1620 line = sdscatprintf(sdsempty(),"%s %s",option,name);
1621 rewriteConfigRewriteLine(state,option,line,force);
1622}
1623
1624/* Rewrite the save option. */
1625void rewriteConfigSaveOption(struct rewriteConfigState *state) {

Callers 1

enumConfigRewriteFunction · 0.85

Calls 4

sdscatprintfFunction · 0.85
sdsemptyFunction · 0.85
rewriteConfigRewriteLineFunction · 0.85

Tested by

no test coverage detected