dunst/src/rules.h
Benedikt Heine 956b5c6401 Use gint64 as microseconds for internal timeunit
time(NULL) is vulnerable against timeshifts by NTP, timezones,...

g_get_monotonic_time() is not, but counts its in microseconds with the
gint64 datatype. To prevent any conversion bugs, all internal
timeformats are now using a gint64 and only get converted during import
or export (DBus notification arrives, configuration reading, age
threshold display).
2017-10-07 17:46:21 +02:00

44 lines
1001 B
C

/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#ifndef DUNST_RULES_H
#define DUNST_RULES_H
#include <glib.h>
#include <stdbool.h>
#include "notification.h"
#include "settings.h"
typedef struct _rule_t {
char *name;
/* filters */
char *appname;
char *summary;
char *body;
char *icon;
char *category;
int msg_urgency;
/* actions */
gint64 timeout;
int urgency;
enum markup_mode markup;
int history_ignore;
int match_transient;
int set_transient;
char *new_icon;
char *fg;
char *bg;
const char *format;
const char *script;
} rule_t;
extern GSList *rules;
void rule_init(rule_t *r);
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: */