2000-04-26 04:03:38 -04:00
|
|
|
#ifndef __SPECIAL_VARS_H
|
|
|
|
#define __SPECIAL_VARS_H
|
|
|
|
|
2000-12-17 02:39:22 -05:00
|
|
|
#include "signals.h"
|
2000-08-26 11:39:44 -04:00
|
|
|
|
2000-12-17 02:39:22 -05:00
|
|
|
#define PARSE_FLAG_GETNAME 0x01 /* return argument name instead of it's value */
|
|
|
|
#define PARSE_FLAG_ISSET_ANY 0x02 /* arg_used field specifies that at least one of the $variables was non-empty */
|
2001-03-03 16:34:06 -05:00
|
|
|
#define PARSE_FLAG_ESCAPE_VARS 0x04 /* if any arguments/variables contain % chars, escape them with another % */
|
2001-06-26 11:33:07 -04:00
|
|
|
#define PARSE_FLAG_ESCAPE_THEME 0x08 /* if any arguments/variables contain { or } chars, escape them with % */
|
2001-09-20 12:44:22 -04:00
|
|
|
#define PARSE_FLAG_ONLY_ARGS 0x10 /* expand only arguments ($0 $1 etc.) but no other $variables */
|
2000-12-17 02:39:22 -05:00
|
|
|
|
2000-08-26 11:39:44 -04:00
|
|
|
typedef char* (*SPECIAL_HISTORY_FUNC)
|
|
|
|
(const char *text, void *item, int *free_ret);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
/* Parse and expand text after '$' character. return value has to be
|
|
|
|
g_free()'d if `free_ret' is TRUE. */
|
2000-08-26 11:39:44 -04:00
|
|
|
char *parse_special(char **cmd, SERVER_REC *server, void *item,
|
2000-12-17 02:39:22 -05:00
|
|
|
char **arglist, int *free_ret, int *arg_used, int flags);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
/* parse the whole string. $ and \ chars are replaced */
|
2000-08-26 11:39:44 -04:00
|
|
|
char *parse_special_string(const char *cmd, SERVER_REC *server, void *item,
|
2000-12-17 02:39:22 -05:00
|
|
|
const char *data, int *arg_used, int flags);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
/* execute the commands in string - commands can be split with ';' */
|
2000-08-26 11:39:44 -04:00
|
|
|
void eval_special_string(const char *cmd, const char *data,
|
|
|
|
SERVER_REC *server, void *item);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
void special_history_func_set(SPECIAL_HISTORY_FUNC func);
|
|
|
|
|
2000-12-17 02:39:22 -05:00
|
|
|
void special_vars_add_signals(const char *text,
|
|
|
|
int funccount, SIGNAL_FUNC *funcs);
|
|
|
|
void special_vars_remove_signals(const char *text,
|
|
|
|
int funccount, SIGNAL_FUNC *funcs);
|
2001-09-23 13:32:05 -04:00
|
|
|
/* Returns [<signal id>, EXPANDO_ARG_xxx, <signal id>, ..., -1] */
|
|
|
|
int *special_vars_get_signals(const char *text);
|
2000-12-17 02:39:22 -05:00
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
#endif
|