From 7bda8083954d46145a174028d99922677451ef4f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 15 Dec 2001 23:26:09 +0000 Subject: [PATCH] Added $versiontime and Irssi::version_time() git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2257 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/expandos.c | 11 ++++++++++- src/perl/common/Core.xs | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/core/expandos.c b/src/core/expandos.c index 25d407db..a0719865 100644 --- a/src/core/expandos.c +++ b/src/core/expandos.c @@ -360,13 +360,20 @@ static char *expando_target(SERVER_REC *server, void *item, int *free_ret) return item == NULL ? "" : ((WI_ITEM_REC *) item)->name; } -/* client release date (numeric version string) */ +/* client release date (in YYYYMMDD format) */ static char *expando_releasedate(SERVER_REC *server, void *item, int *free_ret) { *free_ret = TRUE; return g_strdup_printf("%d", IRSSI_VERSION_DATE); } +/* client release time (in HHMM format) */ +static char *expando_releasetime(SERVER_REC *server, void *item, int *free_ret) +{ + *free_ret = TRUE; + return g_strdup_printf("%d", IRSSI_VERSION_TIME); +} + /* current working directory */ static char *expando_workdir(SERVER_REC *server, void *item, int *free_ret) { @@ -585,6 +592,8 @@ void expandos_init(void) "window item changed", EXPANDO_ARG_WINDOW, NULL); expando_create("V", expando_releasedate, "", EXPANDO_NEVER, NULL); + expando_create("versiontime", expando_releasetime, + "", EXPANDO_NEVER, NULL); expando_create("W", expando_workdir, NULL); expando_create("Y", expando_realname, "window changed", EXPANDO_ARG_NONE, diff --git a/src/perl/common/Core.xs b/src/perl/common/Core.xs index cf01de40..864eeb3f 100644 --- a/src/perl/common/Core.xs +++ b/src/perl/common/Core.xs @@ -445,6 +445,13 @@ CODE: OUTPUT: RETVAL +int +version_time() +CODE: + RETVAL = IRSSI_VERSION_TIME; +OUTPUT: + RETVAL + #******************************* MODULE = Irssi::Core PACKAGE = Irssi::Server #*******************************