diff options
author | Timo Sirainen <cras@irssi.org> | 2000-06-10 08:39:19 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-06-10 08:39:19 +0000 |
commit | 9b6d5f7e99b89671b53aa7d3eb44f9e754dad90a (patch) | |
tree | e34a48715800cbf5f70b7d14826a865d4e0b6f7b | |
parent | 7503302d2397f3440a8bae71d22281468bb9ceae (diff) | |
download | irssi-9b6d5f7e99b89671b53aa7d3eb44f9e754dad90a.zip |
Rotate time names changed :) week -> weekly, day -> daily, etc.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@308 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/core/log.c | 33 | ||||
-rw-r--r-- | src/core/log.h | 8 |
2 files changed, 21 insertions, 20 deletions
diff --git a/src/core/log.c b/src/core/log.c index ffe1e779..6f6768c5 100644 --- a/src/core/log.c +++ b/src/core/log.c @@ -209,14 +209,14 @@ LOG_REC *log_find(const char *fname) const char *log_rotate2str(int rotate) { switch (rotate) { - case LOG_ROTATE_HOUR: - return "hour"; - case LOG_ROTATE_DAY: - return "day"; - case LOG_ROTATE_WEEK: - return "week"; - case LOG_ROTATE_MONTH: - return "month"; + case LOG_ROTATE_HOURLY: + return "hourly"; + case LOG_ROTATE_DAILY: + return "daily"; + case LOG_ROTATE_WEEKLY: + return "weekly"; + case LOG_ROTATE_MONTHLY: + return "monthly"; } return NULL; @@ -228,13 +228,14 @@ int log_str2rotate(const char *str) return -1; if (g_strncasecmp(str, "hour", 4) == 0) - return LOG_ROTATE_HOUR; - if (g_strncasecmp(str, "day", 3) == 0) - return LOG_ROTATE_DAY; + return LOG_ROTATE_HOURLY; + if (g_strncasecmp(str, "day", 3) == 0 || + g_strncasecmp(str, "daily", 5) == 0) + return LOG_ROTATE_DAILY; if (g_strncasecmp(str, "week", 4) == 0) - return LOG_ROTATE_WEEK; + return LOG_ROTATE_WEEKLY; if (g_strncasecmp(str, "month", 5) == 0) - return LOG_ROTATE_MONTH; + return LOG_ROTATE_MONTHLY; if (g_strncasecmp(str, "never", 5) == 0) return LOG_ROTATE_NEVER; @@ -354,13 +355,13 @@ static int sig_rotate_check(void) continue; tm = localtime(&rec->opened); - if (rec->rotate == LOG_ROTATE_MONTH) { + if (rec->rotate == LOG_ROTATE_MONTHLY) { if (tm->tm_mon == tm_now.tm_mon) continue; - } else if (rec->rotate == LOG_ROTATE_WEEK) { + } else if (rec->rotate == LOG_ROTATE_WEEKLY) { if (tm->tm_wday != 1 || tm->tm_mday == tm_now.tm_mday) continue; - } else if (rec->rotate == LOG_ROTATE_DAY) { + } else if (rec->rotate == LOG_ROTATE_DAILY) { if (tm->tm_mday == tm_now.tm_mday) continue; } diff --git a/src/core/log.h b/src/core/log.h index 599be9e2..184f5ace 100644 --- a/src/core/log.h +++ b/src/core/log.h @@ -3,10 +3,10 @@ enum { LOG_ROTATE_NEVER, - LOG_ROTATE_HOUR, - LOG_ROTATE_DAY, - LOG_ROTATE_WEEK, - LOG_ROTATE_MONTH + LOG_ROTATE_HOURLY, + LOG_ROTATE_DAILY, + LOG_ROTATE_WEEKLY, + LOG_ROTATE_MONTHLY }; typedef struct { |