Esempio n. 1
0
static inline struct sieve_argument *_create_variable_argument
(struct sieve_command *cmd, struct sieve_variable *var)
{
	struct sieve_argument *argument = sieve_argument_create
		(cmd->ast_node->ast, NULL, cmd->ext, 0);

	argument->data = (void *) var;

	return argument;
}
static bool ext_variables_variable_argument_activate
(const struct sieve_extension *this_ext, struct sieve_validator *valdtr,
	struct sieve_ast_argument *arg, const char *variable)
{
	struct sieve_ast *ast = arg->ast;
	struct sieve_variable *var;

	var = ext_variables_validator_get_variable(this_ext, valdtr, variable, TRUE);

	if ( var == NULL ) {
		sieve_argument_validate_error(valdtr, arg,
			"(implicit) declaration of new variable '%s' exceeds the limit "
			"(max variables: %u)", variable,
			EXT_VARIABLES_MAX_SCOPE_SIZE);
		return FALSE;
	}

	arg->argument = sieve_argument_create(ast, &variable_argument, this_ext, 0);
	arg->argument->data = (void *) var;
	return TRUE;
}