diff --git a/config.h b/config.h index 15c0c53..d2cf382 100644 --- a/config.h +++ b/config.h @@ -110,7 +110,7 @@ struct settings defaults = { }; -rule_t default_rules[] = { +struct rule default_rules[] = { /* name can be any unique string. It is used to identify * the rule in dunstrc to override it there */ diff --git a/src/rules.c b/src/rules.c index 47f452e..a97b03f 100644 --- a/src/rules.c +++ b/src/rules.c @@ -10,7 +10,7 @@ /* * Apply rule to notification. */ -void rule_apply(rule_t *r, notification *n) +void rule_apply(struct rule *r, notification *n) { if (r->timeout != -1) n->timeout = r->timeout; @@ -53,7 +53,7 @@ void rule_apply(rule_t *r, notification *n) void rule_apply_all(notification *n) { for (GSList *iter = rules; iter; iter = iter->next) { - rule_t *r = iter->data; + struct rule *r = iter->data; if (rule_matches_notification(r, n)) { rule_apply(r, n); } @@ -63,7 +63,7 @@ void rule_apply_all(notification *n) /* * Initialize rule with default values. */ -void rule_init(rule_t *r) +void rule_init(struct rule *r) { r->name = NULL; r->appname = NULL; @@ -89,7 +89,7 @@ void rule_init(rule_t *r) /* * Check whether rule should be applied to n. */ -bool rule_matches_notification(rule_t *r, notification *n) +bool rule_matches_notification(struct rule *r, notification *n) { return ( (!r->appname || (n->appname && !fnmatch(r->appname, n->appname, 0))) && (!r->summary || (n->summary && !fnmatch(r->summary, n->summary, 0))) diff --git a/src/rules.h b/src/rules.h index 0e22eb8..e2a26a6 100644 --- a/src/rules.h +++ b/src/rules.h @@ -8,7 +8,7 @@ #include "notification.h" #include "settings.h" -typedef struct _rule_t { +struct rule { char *name; /* filters */ char *appname; @@ -32,14 +32,14 @@ typedef struct _rule_t { const char *format; const char *script; enum behavior_fullscreen fullscreen; -} rule_t; +}; extern GSList *rules; -void rule_init(rule_t *r); -void rule_apply(rule_t *r, notification *n); +void rule_init(struct rule *r); +void rule_apply(struct rule *r, notification *n); void rule_apply_all(notification *n); -bool rule_matches_notification(rule_t *r, notification *n); +bool rule_matches_notification(struct rule *r, notification *n); #endif /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/settings.c b/src/settings.c index d6e5834..a2c38f4 100644 --- a/src/settings.c +++ b/src/settings.c @@ -727,16 +727,16 @@ void load_settings(char *cmdline_config_path) continue; /* check for existing rule with same name */ - rule_t *r = NULL; + struct rule *r = NULL; for (GSList *iter = rules; iter; iter = iter->next) { - rule_t *match = iter->data; + struct rule *match = iter->data; if (match->name && strcmp(match->name, cur_section) == 0) r = match; } if (!r) { - r = g_malloc(sizeof(rule_t)); + r = g_malloc(sizeof(struct rule)); rule_init(r); rules = g_slist_insert(rules, r, -1); }