| 1589 | } |
| 1590 | |
| 1591 | int |
| 1592 | config_error_done(void) |
| 1593 | { |
| 1594 | int n; |
| 1595 | struct _config_error_frame *tmp = config_error_data; |
| 1596 | |
| 1597 | if (!config_error_data) |
| 1598 | return 0; |
| 1599 | n = config_error_data->num_errors; |
| 1600 | #ifndef USER_SOUNDS |
| 1601 | if (gn.no_sound_notified > 0) { |
| 1602 | /* no USER_SOUNDS; config_error_add() was called once for first |
| 1603 | SOUND or SOUNDDIR entry seen, then skipped for any others; |
| 1604 | include those skipped ones in the total error count */ |
| 1605 | n += (gn.no_sound_notified - 1); |
| 1606 | gn.no_sound_notified = 0; |
| 1607 | } |
| 1608 | #endif |
| 1609 | if (n) { |
| 1610 | boolean cmdline = !strcmp(config_error_data->source, "command line"); |
| 1611 | |
| 1612 | pline("\n%d error%s %s %s.\n", n, plur(n), cmdline ? "on" : "in", |
| 1613 | *config_error_data->source ? config_error_data->source |
| 1614 | : configfile); |
| 1615 | wait_synch(); |
| 1616 | } |
| 1617 | config_error_data = tmp->next; |
| 1618 | free(tmp); |
| 1619 | program_state.config_error_ready = (config_error_data != 0); |
| 1620 | return n; |
| 1621 | } |
| 1622 | |
| 1623 | boolean |
| 1624 | read_config_file(const char *filename, int src) |