aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/config.h
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-28 11:08:54 -0500
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-28 11:09:01 -0500
commite5f90f25d755b19151dfcfd98790c1bad3eb8068 (patch)
treec6af192b469e6cf86ee00cb5d0ab4e03a98bacae /include/sway/config.h
parentMerge pull request #3211 from emersion/child-view-unmapped-segfault (diff)
downloadsway-e5f90f25d755b19151dfcfd98790c1bad3eb8068.tar.gz
sway-e5f90f25d755b19151dfcfd98790c1bad3eb8068.tar.zst
sway-e5f90f25d755b19151dfcfd98790c1bad3eb8068.zip
Introduce a way to show config warnings in swaynag
Adds the function `config_add_swaynag_warning(char *fmt, ...)` so that handlers can add warnings to the swaynag config log in a uniform way. The formatting is identical to errors and include the line number, line, and config path. This also alters the background file access warning to use the function and introduces a warning for duplicate bindings.
Diffstat (limited to 'include/sway/config.h')
-rw-r--r--include/sway/config.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 1ff9a104..d02b0d63 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -425,6 +425,8 @@ struct sway_config {
425 list_t *config_chain; 425 list_t *config_chain;
426 const char *current_config_path; 426 const char *current_config_path;
427 const char *current_config; 427 const char *current_config;
428 int current_config_line_number;
429 char *current_config_line;
428 430
429 enum sway_container_border border; 431 enum sway_container_border border;
430 enum sway_container_border floating_border; 432 enum sway_container_border floating_border;
@@ -490,6 +492,11 @@ bool read_config(FILE *file, struct sway_config *config,
490 struct swaynag_instance *swaynag); 492 struct swaynag_instance *swaynag);
491 493
492/** 494/**
495 * Adds a warning entry to the swaynag instance used for errors.
496 */
497void config_add_swaynag_warning(char *fmt, ...);
498
499/**
493 * Free config struct 500 * Free config struct
494 */ 501 */
495void free_config(struct sway_config *config); 502void free_config(struct sway_config *config);