Skip to content
Snippets Groups Projects
tst-not.c 944 B
/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file
 */

#include "sieve-common.h"
#include "sieve-commands.h"
#include "sieve-validator.h"
#include "sieve-generator.h"

/* 
 * Not test 
 *
 * Syntax:
 *   not <tests: test-list>   
 */

static bool tst_not_generate
	(const struct sieve_codegen_env *cgenv, struct sieve_command_context *ctx,
		struct sieve_jumplist *jumps, bool jump_true);

const struct sieve_command tst_not = { 
	"not", 
	SCT_TEST, 
	0, 1, FALSE, FALSE,
	NULL, NULL, NULL, NULL, 
	tst_not_generate 
};

/* 
 * Code generation 
 */

static bool tst_not_generate
(const struct sieve_codegen_env *cgenv, struct sieve_command_context *ctx,
	struct sieve_jumplist *jumps, bool jump_true)
{
	struct sieve_ast_node *test;
	
	/* Validator verified the existance of the single test already */
	test = sieve_ast_test_first(ctx->ast_node); 
	
	return sieve_generate_test(cgenv, test, jumps, !jump_true);
}

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.