Added SILC Thread Queue API
[crypto.git] / apps / irssi / src / core / special-vars.h
1 #ifndef __SPECIAL_VARS_H
2 #define __SPECIAL_VARS_H
3
4 #include "signals.h"
5
6 #define PARSE_FLAG_GETNAME      0x01 /* return argument name instead of it's value */
7 #define PARSE_FLAG_ISSET_ANY    0x02 /* arg_used field specifies that at least one of the $variables was non-empty */
8 #define PARSE_FLAG_ESCAPE_VARS  0x04 /* if any arguments/variables contain % chars, escape them with another % */
9 #define PARSE_FLAG_ESCAPE_THEME 0x08 /* if any arguments/variables contain { or } chars, escape them with % */
10 #define PARSE_FLAG_ONLY_ARGS    0x10 /* expand only arguments ($0 $1 etc.) but no other $variables */
11
12 typedef char* (*SPECIAL_HISTORY_FUNC)
13         (const char *text, void *item, int *free_ret);
14
15 /* Parse and expand text after '$' character. return value has to be
16    g_free()'d if `free_ret' is TRUE. */
17 char *parse_special(char **cmd, SERVER_REC *server, void *item,
18                     char **arglist, int *free_ret, int *arg_used, int flags);
19
20 /* parse the whole string. $ and \ chars are replaced */
21 char *parse_special_string(const char *cmd, SERVER_REC *server, void *item,
22                            const char *data, int *arg_used, int flags);
23
24 /* execute the commands in string - commands can be split with ';' */
25 void eval_special_string(const char *cmd, const char *data,
26                          SERVER_REC *server, void *item);
27
28 void special_history_func_set(SPECIAL_HISTORY_FUNC func);
29
30 void special_vars_add_signals(const char *text,
31                               int funccount, SIGNAL_FUNC *funcs);
32 void special_vars_remove_signals(const char *text,
33                                  int funccount, SIGNAL_FUNC *funcs);
34 /* Returns [<signal id>, EXPANDO_ARG_xxx, <signal id>, ..., -1] */
35 int *special_vars_get_signals(const char *text);
36
37 #endif