mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 08:02:13 +02:00
make the $Z time overridable
This commit is contained in:
parent
f3e037f434
commit
a865b07a67
2 changed files with 3 additions and 1 deletions
|
|
@ -48,6 +48,7 @@ typedef struct {
|
||||||
} EXPANDO_REC;
|
} EXPANDO_REC;
|
||||||
|
|
||||||
const char *current_expando = NULL;
|
const char *current_expando = NULL;
|
||||||
|
time_t current_time = (time_t)-1;
|
||||||
|
|
||||||
static int timer_tag;
|
static int timer_tag;
|
||||||
|
|
||||||
|
|
@ -441,7 +442,7 @@ static char *expando_time(SERVER_REC *server, void *item, int *free_ret)
|
||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
char str[256];
|
char str[256];
|
||||||
|
|
||||||
now = time(NULL);
|
now = current_time != (time_t)-1 ? current_time : time(NULL);
|
||||||
tm = localtime(&now);
|
tm = localtime(&now);
|
||||||
|
|
||||||
if (strftime(str, sizeof(str), timestamp_format, tm) == 0)
|
if (strftime(str, sizeof(str), timestamp_format, tm) == 0)
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ typedef char* (*EXPANDO_FUNC)
|
||||||
(SERVER_REC *server, void *item, int *free_ret);
|
(SERVER_REC *server, void *item, int *free_ret);
|
||||||
|
|
||||||
extern const char *current_expando;
|
extern const char *current_expando;
|
||||||
|
extern time_t current_time;
|
||||||
|
|
||||||
/* Create expando - overrides any existing ones.
|
/* Create expando - overrides any existing ones.
|
||||||
... = signal, type, ..., NULL - list of signals that might change the
|
... = signal, type, ..., NULL - list of signals that might change the
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue