From 964688699e1a9cad88d1493127bc61ec203aaa0b Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Fri, 27 Jan 2017 16:27:09 +0200 Subject: [PATCH] Use include guards consistently * Don't mix pragma guards and include guards, prefer classic include guards since apparently pragma guards are not a standard yet. * Use the DUNST_FILE_H naming convention for all include guards. --- src/dbus.h | 5 ++--- src/dunst.h | 5 ++++- src/menu.h | 4 ++++ src/notification.h | 4 +++- src/option_parser.h | 4 +++- src/rules.h | 4 +++- src/settings.h | 4 +++- src/utils.h | 6 +++--- src/x.h | 4 ++-- 9 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/dbus.h b/src/dbus.h index 0d536e6..01af660 100644 --- a/src/dbus.h +++ b/src/dbus.h @@ -1,7 +1,7 @@ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ -#ifndef _DUNST_DBUS_H -#define _DUNST_DBUS_H +#ifndef DUNST_DBUS_H +#define DUNST_DBUS_H #include @@ -14,5 +14,4 @@ void notification_closed(notification * n, int reason); void action_invoked(notification * n, const char *identifier); #endif - /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/dunst.h b/src/dunst.h index b2bc025..c54810f 100644 --- a/src/dunst.h +++ b/src/dunst.h @@ -1,6 +1,7 @@ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ -#pragma once +#ifndef DUNST_DUNST_H +#define DUNST_DUNST_H #include #include @@ -47,4 +48,6 @@ char *extract_urls(const char *str); void context_menu(void); void wake_up(void); void pause_signal_handler(int sig); + +#endif /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/menu.h b/src/menu.h index 86491f1..43cd1e6 100644 --- a/src/menu.h +++ b/src/menu.h @@ -1,4 +1,7 @@ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ +#ifndef DUNST_MENU_H +#define DUNST_MENU_H + #include "dunst.h" #include @@ -7,4 +10,5 @@ void open_browser(const char *url); void invoke_action(const char *action); void regex_teardown(void); +#endif /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/notification.h b/src/notification.h index e6d42dc..94639be 100644 --- a/src/notification.h +++ b/src/notification.h @@ -1,5 +1,6 @@ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ -#pragma once +#ifndef DUNST_NOTIFICATION_H +#define DUNST_NOTIFICATION_H #include "x.h" @@ -70,4 +71,5 @@ void notification_update_text_to_render(notification *n); int notification_get_ttl(notification *n); int notification_get_age(notification *n); +#endif /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/option_parser.h b/src/option_parser.h index 1b1d9df..b83d038 100644 --- a/src/option_parser.h +++ b/src/option_parser.h @@ -1,5 +1,6 @@ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ -#pragma once +#ifndef DUNST_OPTION_PARSER_H +#define DUNST_OPTION_PARSER_H #include @@ -33,4 +34,5 @@ int option_get_bool(char *ini_section, char *ini_key, char *cmdline_key, */ char *next_section(char *section); +#endif /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/rules.h b/src/rules.h index 218ce37..bebe1e0 100644 --- a/src/rules.h +++ b/src/rules.h @@ -1,5 +1,6 @@ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ -#pragma once +#ifndef DUNST_RULES_H +#define DUNST_RULES_H #include @@ -35,4 +36,5 @@ void rule_apply(rule_t * r, notification * n); void rule_apply_all(notification * n); bool rule_matches_notification(rule_t * r, notification * n); +#endif /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/settings.h b/src/settings.h index 290291f..9a1709c 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,5 +1,6 @@ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ -#pragma once +#ifndef DUNST_SETTINGS_H +#define DUNST_SETTINGS_H typedef struct _settings { bool print_notifications; @@ -67,4 +68,5 @@ extern settings_t settings; void load_settings(char *cmdline_config_path); +#endif /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/utils.h b/src/utils.h index cf193cc..88db004 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,6 +1,6 @@ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ -#ifndef UTIL_H -#define UTIL_H +#ifndef DUNST_UTILS_H +#define DUNST_UTILS_H /* replace all occurences of the character needle with the character replacement in haystack */ char *string_replace_char(char needle, char replacement, char *haystack); @@ -22,6 +22,6 @@ void string_strip_delimited(char *str, char a, char b); /* exit with an error message */ void die(char *msg, int exit_value); -#endif +#endif /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/x.h b/src/x.h index 767190b..55e4b6e 100644 --- a/src/x.h +++ b/src/x.h @@ -1,6 +1,6 @@ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ -#ifndef DRAW_H -#define DRAW_H +#ifndef DUNST_X_H +#define DUNST_X_H #include #include "glib.h"