mirror of
https://github.com/irssi/irssi.git
synced 2025-04-26 04:51:11 -05:00
added $sysarch
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1454 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
014c07d71c
commit
0bd5755a2d
@ -81,6 +81,7 @@ $A .. $Z is important.
|
|||||||
|
|
||||||
$sysname system name (eg. Linux)
|
$sysname system name (eg. Linux)
|
||||||
$sysrelease system release (eg. 2.2.18)
|
$sysrelease system release (eg. 2.2.18)
|
||||||
|
$sysarch system architecture (eg. i686)
|
||||||
$topic channel topic
|
$topic channel topic
|
||||||
$usermode user mode
|
$usermode user mode
|
||||||
$tag server tag
|
$tag server tag
|
||||||
|
@ -53,7 +53,7 @@ static GHashTable *expandos;
|
|||||||
static time_t client_start_time;
|
static time_t client_start_time;
|
||||||
static char *last_sent_msg, *last_sent_msg_body;
|
static char *last_sent_msg, *last_sent_msg_body;
|
||||||
static char *last_privmsg_from, *last_public_from;
|
static char *last_privmsg_from, *last_public_from;
|
||||||
static char *sysname, *sysrelease;
|
static char *sysname, *sysrelease, *sysarch;
|
||||||
static const char *timestamp_format;
|
static const char *timestamp_format;
|
||||||
|
|
||||||
#define CHAR_EXPANDOS_COUNT \
|
#define CHAR_EXPANDOS_COUNT \
|
||||||
@ -381,6 +381,12 @@ static char *expando_sysrelease(SERVER_REC *server, void *item, int *free_ret)
|
|||||||
return sysrelease;
|
return sysrelease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* system architecture */
|
||||||
|
static char *expando_sysarch(SERVER_REC *server, void *item, int *free_ret)
|
||||||
|
{
|
||||||
|
return sysarch;
|
||||||
|
}
|
||||||
|
|
||||||
/* Topic of active channel (or address of queried nick) */
|
/* Topic of active channel (or address of queried nick) */
|
||||||
static char *expando_topic(SERVER_REC *server, void *item, int *free_ret)
|
static char *expando_topic(SERVER_REC *server, void *item, int *free_ret)
|
||||||
{
|
{
|
||||||
@ -454,11 +460,12 @@ void expandos_init(void)
|
|||||||
last_sent_msg = NULL; last_sent_msg_body = NULL;
|
last_sent_msg = NULL; last_sent_msg_body = NULL;
|
||||||
last_privmsg_from = NULL; last_public_from = NULL;
|
last_privmsg_from = NULL; last_public_from = NULL;
|
||||||
|
|
||||||
sysname = sysrelease = NULL;
|
sysname = sysrelease = sysarch = NULL;
|
||||||
#ifdef HAVE_SYS_UTSNAME_H
|
#ifdef HAVE_SYS_UTSNAME_H
|
||||||
if (uname(&un) == 0) {
|
if (uname(&un) == 0) {
|
||||||
sysname = g_strdup(un.sysname);
|
sysname = g_strdup(un.sysname);
|
||||||
sysrelease = g_strdup(un.release);
|
sysrelease = g_strdup(un.release);
|
||||||
|
sysarch = g_strdup(un.machine);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -526,6 +533,8 @@ void expandos_init(void)
|
|||||||
"", EXPANDO_NEVER, NULL);
|
"", EXPANDO_NEVER, NULL);
|
||||||
expando_create("sysrelease", expando_sysrelease,
|
expando_create("sysrelease", expando_sysrelease,
|
||||||
"", EXPANDO_NEVER, NULL);
|
"", EXPANDO_NEVER, NULL);
|
||||||
|
expando_create("sysarch", expando_sysarch,
|
||||||
|
"", EXPANDO_NEVER, NULL);
|
||||||
expando_create("topic", expando_topic,
|
expando_create("topic", expando_topic,
|
||||||
"window changed", EXPANDO_ARG_NONE,
|
"window changed", EXPANDO_ARG_NONE,
|
||||||
"window item changed", EXPANDO_ARG_WINDOW,
|
"window item changed", EXPANDO_ARG_WINDOW,
|
||||||
@ -556,6 +565,7 @@ void expandos_deinit(void)
|
|||||||
|
|
||||||
expando_destroy("sysname", expando_sysname);
|
expando_destroy("sysname", expando_sysname);
|
||||||
expando_destroy("sysrelease", expando_sysrelease);
|
expando_destroy("sysrelease", expando_sysrelease);
|
||||||
|
expando_destroy("sysarch", expando_sysarch);
|
||||||
expando_destroy("topic", expando_topic);
|
expando_destroy("topic", expando_topic);
|
||||||
expando_destroy("tag", expando_servertag);
|
expando_destroy("tag", expando_servertag);
|
||||||
expando_destroy("chatnet", expando_chatnet);
|
expando_destroy("chatnet", expando_chatnet);
|
||||||
@ -565,6 +575,7 @@ void expandos_deinit(void)
|
|||||||
g_free_not_null(last_sent_msg); g_free_not_null(last_sent_msg_body);
|
g_free_not_null(last_sent_msg); g_free_not_null(last_sent_msg_body);
|
||||||
g_free_not_null(last_privmsg_from); g_free_not_null(last_public_from);
|
g_free_not_null(last_privmsg_from); g_free_not_null(last_public_from);
|
||||||
g_free_not_null(sysname); g_free_not_null(sysrelease);
|
g_free_not_null(sysname); g_free_not_null(sysrelease);
|
||||||
|
g_free_not_null(sysarch);
|
||||||
|
|
||||||
g_source_remove(timer_tag);
|
g_source_remove(timer_tag);
|
||||||
signal_remove("message public", (SIGNAL_FUNC) sig_message_public);
|
signal_remove("message public", (SIGNAL_FUNC) sig_message_public);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user