1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

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
This commit is contained in:
Timo Sirainen 2000-06-10 08:39:19 +00:00 committed by cras
parent 7503302d23
commit 9b6d5f7e99
2 changed files with 21 additions and 20 deletions

View File

@ -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;
}

View File

@ -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 {