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

Function Options_Reload

src/Options.c:49–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void Options_Reload(void) {
50 cc_string entry, key, value;
51 int i;
52
53 /* Reset all the unchanged options */
54 for (i = Options.count - 1; i >= 0; i--) {
55 entry = StringsBuffer_UNSAFE_Get(&Options, i);
56 String_UNSAFE_Separate(&entry, '=', &key, &value);
57
58 if (HasChanged(&key)) continue;
59 StringsBuffer_Remove(&Options, i);
60 }
61 /* Load only options which have not changed */
62 Options_LoadResult = EntryList_Load(&Options, "options.txt", '=', Options_LoadFilter);
63}
64
65static void SaveOptions(void) {
66 EntryList_Save(&Options, "options.txt");

Callers 2

Options_SaveIfChangedFunction · 0.85
DirectConnectScreen_LoadFunction · 0.85

Calls 5

StringsBuffer_UNSAFE_GetFunction · 0.85
String_UNSAFE_SeparateFunction · 0.85
HasChangedFunction · 0.85
StringsBuffer_RemoveFunction · 0.85
EntryList_LoadFunction · 0.85

Tested by

no test coverage detected