Added SILC Thread Queue API
[crypto.git] / apps / irssi / src / core / expandos.h
1 #ifndef __EXPANDOS_H
2 #define __EXPANDOS_H
3
4 #include "signals.h"
5
6 /* first argument of signal must match to active .. */
7 typedef enum {
8         EXPANDO_ARG_NONE = 1,
9         EXPANDO_ARG_SERVER,
10         EXPANDO_ARG_WINDOW,
11         EXPANDO_ARG_WINDOW_ITEM,
12
13         EXPANDO_NEVER /* special: expando never changes */
14 } ExpandoArg;
15
16 typedef char* (*EXPANDO_FUNC)
17         (SERVER_REC *server, void *item, int *free_ret);
18
19 extern const char *current_expando;
20
21 /* Create expando - overrides any existing ones.
22    ... = signal, type, ..., NULL - list of signals that might change the
23    value of this expando */
24 void expando_create(const char *key, EXPANDO_FUNC func, ...);
25 /* Add new signal to expando */
26 void expando_add_signal(const char *key, const char *signal, ExpandoArg arg);
27 /* Destroy expando */
28 void expando_destroy(const char *key, EXPANDO_FUNC func);
29
30 void expando_bind(const char *key, int funccount, SIGNAL_FUNC *funcs);
31 void expando_unbind(const char *key, int funccount, SIGNAL_FUNC *funcs);
32
33 /* Returns [<signal id>, EXPANDO_ARG_xxx, <signal id>, ..., -1] */
34 int *expando_get_signals(const char *key);
35
36 /* internal: */
37 EXPANDO_FUNC expando_find_char(char chr);
38 EXPANDO_FUNC expando_find_long(const char *key);
39
40 void expandos_init(void);
41 void expandos_deinit(void);
42
43 #endif