| 47 | } |
| 48 | |
| 49 | void 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 | |
| 65 | static void SaveOptions(void) { |
| 66 | EntryList_Save(&Options, "options.txt"); |
no test coverage detected