MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Options_SetString

Function Options_SetString

src/Options.c:182–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void Options_SetString(const cc_string* key, const cc_string* value) {
183 if (!value || !value->length) {
184 if (!EntryList_Remove(&Options, key, '=')) return;
185 } else {
186 EntryList_Set(&Options, key, value, '=');
187 }
188
189#if defined OPTIONS_SAVE_IMMEDIATELY
190 if (!savingPaused) SaveOptions();
191#endif
192
193 if (HasChanged(key)) return;
194 StringsBuffer_Add(&changedOpts, key);
195}
196
197void Options_SetSecure(const char* opt, const cc_string* src) {
198 char data[2000], encData[1500+1];

Callers 5

InputBind_SetFunction · 0.85
InputBind_ResetFunction · 0.85
StoredHotkeys_RemoveFunction · 0.85
StoredHotkeys_AddFunction · 0.85
Options_SetFunction · 0.85

Calls 5

EntryList_RemoveFunction · 0.85
EntryList_SetFunction · 0.85
SaveOptionsFunction · 0.85
HasChangedFunction · 0.85
StringsBuffer_AddFunction · 0.85

Tested by

no test coverage detected