4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen#ifndef AUTH_REQUEST_VAR_EXPAND_H
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen#define AUTH_REQUEST_VAR_EXPAND_H
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainentypedef const char *
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainenauth_request_escape_func_t(const char *string,
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen const struct auth_request *auth_request);
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen#define AUTH_REQUEST_VAR_TAB_USER_IDX 0
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen#define AUTH_REQUEST_VAR_TAB_USERNAME_IDX 1
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen#define AUTH_REQUEST_VAR_TAB_DOMAIN_IDX 2
e88c6613d3bc78fa928b0e74f8e4ebd91151206eAki Tuomi#define AUTH_REQUEST_VAR_TAB_COUNT 35
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainenextern const struct var_expand_table
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainenauth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_COUNT+1];
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen
9698cd24356147d8a5471260062ea7e10e692fdfAki Tuomiextern const struct var_expand_func_table auth_request_var_funcs_table[];
9698cd24356147d8a5471260062ea7e10e692fdfAki Tuomi
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainenconst struct var_expand_table *
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainenauth_request_get_var_expand_table(const struct auth_request *auth_request,
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen auth_request_escape_func_t *escape_func)
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen ATTR_NULL(2);
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainenstruct var_expand_table *
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainenauth_request_get_var_expand_table_full(const struct auth_request *auth_request,
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen auth_request_escape_func_t *escape_func,
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen unsigned int *count) ATTR_NULL(2);
38ceb710e2bc957a66a75c68957cb87746682a75Timo Sirainen
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainenint auth_request_var_expand(string_t *dest, const char *str,
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainen const struct auth_request *auth_request,
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainen auth_request_escape_func_t *escape_func,
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainen const char **error_r);
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainenint auth_request_var_expand_with_table(string_t *dest, const char *str,
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainen const struct auth_request *auth_request,
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainen const struct var_expand_table *table,
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainen auth_request_escape_func_t *escape_func,
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainen const char **error_r);
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainenint t_auth_request_var_expand(const char *str,
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainen const struct auth_request *auth_request,
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainen auth_request_escape_func_t *escape_func,
0f5dc4da3982053036be65190e44bf28a67b1ca2Timo Sirainen const char **value_r, const char **error_r);
38ceb710e2bc957a66a75c68957cb87746682a75Timo Sirainen
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainenconst char *auth_request_str_escape(const char *string,
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen const struct auth_request *request);
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen
4b7957c5e995f2c1820891d77a292a4886d52a43Timo Sirainen#endif