From d1eaeca255025c38f70e9542ec141a5713496142 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 5 Dec 2000 00:53:04 +0000 Subject: Split expandos from special-vars.c to expandos.c. Added list of signals to each expando that can might change it's value. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@964 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/expandos.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/core/expandos.h (limited to 'src/core/expandos.h') diff --git a/src/core/expandos.h b/src/core/expandos.h new file mode 100644 index 00000000..3667449f --- /dev/null +++ b/src/core/expandos.h @@ -0,0 +1,36 @@ +#ifndef __EXPANDOS_H +#define __EXPANDOS_H + +#include "servers.h" + +/* first argument of signal must match to active .. */ +typedef enum { + EXPANDO_ARG_NONE, + EXPANDO_ARG_SERVER, + EXPANDO_ARG_SERVER2, /* second argument.. */ + EXPANDO_ARG_WINDOW, + EXPANDO_ARG_WINDOW_ITEM, + + EXPANDO_NEVER /* special: expando never changes */ +} ExpandoArg; + +typedef char* (*EXPANDO_FUNC) + (SERVER_REC *server, void *item, int *free_ret); + +/* Create expando - overrides any existing ones. + ... = signal, type, ..., NULL - list of signals that might change the + value of this expando */ +void expando_create(const char *key, EXPANDO_FUNC func, ...); +/* Add new signal to expando */ +void expando_add_signal(const char *key, const char *signal, ExpandoArg arg); +/* Destroy expando */ +void expando_destroy(const char *key, EXPANDO_FUNC func); + +/* internal: */ +EXPANDO_FUNC expando_find_char(char chr); +EXPANDO_FUNC expando_find_long(const char *key); + +void expandos_init(void); +void expandos_deinit(void); + +#endif -- cgit v1.2.3