Branch data Line data Source code
1 : : #include "precizer.h"
2 : :
3 : : /**
4 : : * @brief Report whether the primary database changed during the current run
5 : : *
6 : : * @details Skips output in compare mode and after an interrupt. For an existing
7 : : * primary database the function delegates to `db_check_changes()`. For a
8 : : * brand-new primary database it prints whether any rows were added, removed, or
9 : : * updated since startup
10 : : *
11 : : * @return Return status code
12 : : */
13 : 361 : Return status_of_changes(void)
14 : : {
15 : : /* Status returned by this function through provide()
16 : : Default value assumes successful completion */
17 : 361 : Return status = SUCCESS;
18 : :
19 [ + + + - ]: 361 : if(config->compare != true && global_interrupt_flag == false)
20 : : {
21 [ + + ]: 249 : if(config->db_primary_file_exists == true)
22 : : {
23 : 94 : status = db_check_changes();
24 : :
25 : : } else {
26 [ + + ]: 155 : if(config->db_primary_file_modified == false)
27 : : {
28 : 6 : slog(EVERY,BOLD "Nothing has changed in the primary database since the program was launched (no files were added, updated, or deleted)" RESET "\n");
29 : : } else {
30 : 149 : slog(EVERY,BOLD "The brand-new primary database file %s was created and modified since the program started (files were added, removed, or updated)" RESET "\n",confstr(db_file_name));
31 : : }
32 : : }
33 : : }
34 : :
35 : 361 : provide(status);
36 : : }
|