diff options
author | Timo Sirainen <cras@irssi.org> | 2002-10-27 22:30:41 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-10-27 22:30:41 +0000 |
commit | d58e119a98a534045f9a016e5e41477443ba3b98 (patch) | |
tree | b43289b4a39292b453d62d80a0f3aa19ef04b6bb /src/core | |
parent | d3f4f13f94098cdbccc54dd449d8a64debef6fd8 (diff) | |
download | irssi-d58e119a98a534045f9a016e5e41477443ba3b98.zip |
Exported expando interface to perl. Fix for statusbar deinit.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2975 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/expandos.c | 2 | ||||
-rw-r--r-- | src/core/expandos.h | 2 | ||||
-rw-r--r-- | src/core/special-vars.c | 14 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/core/expandos.c b/src/core/expandos.c index 8f97836a..7ebc4f20 100644 --- a/src/core/expandos.c +++ b/src/core/expandos.c @@ -46,6 +46,8 @@ typedef struct { int signal_args[MAX_EXPANDO_SIGNALS]; } EXPANDO_REC; +const char *current_expando = NULL; + static int timer_tag; static EXPANDO_REC *char_expandos[255]; diff --git a/src/core/expandos.h b/src/core/expandos.h index cf057994..45608a26 100644 --- a/src/core/expandos.h +++ b/src/core/expandos.h @@ -16,6 +16,8 @@ typedef enum { typedef char* (*EXPANDO_FUNC) (SERVER_REC *server, void *item, int *free_ret); +extern const char *current_expando; + /* Create expando - overrides any existing ones. ... = signal, type, ..., NULL - list of signals that might change the value of this expando */ diff --git a/src/core/special-vars.c b/src/core/special-vars.c index 7291f469..f7d69728 100644 --- a/src/core/special-vars.c +++ b/src/core/special-vars.c @@ -113,8 +113,10 @@ static char *get_long_variable_value(const char *key, SERVER_REC *server, /* expando? */ func = expando_find_long(key); - if (func != NULL) + if (func != NULL) { + current_expando = key; return func(server, item, free_ret); + } /* internal setting? */ type = settings_get_type(key); @@ -176,7 +178,15 @@ static char *get_variable(char **cmd, SERVER_REC *server, void *item, } *free_ret = FALSE; func = expando_find_char(**cmd); - return func == NULL ? NULL : func(server, item, free_ret); + if (func == NULL) + return NULL; + else { + char str[2]; + + str[0] = **cmd; str[1] = '\0'; + current_expando = str; + return func(server, item, free_ret); + } } static char *get_history(char **cmd, void *item, int *free_ret) |