Coverage Report

Created: 2026-04-12 07:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/pigeonhole/src/lib-sieve/plugins/regex/ext-regex.c
Line
Count
Source
1
/* Copyright (c) 2002-2018 Pigeonhole authors, see the included COPYING file
2
 */
3
4
/* Extension regex
5
 * ---------------
6
 *
7
 * Authors: Stephan Bosch
8
 * Specification: draft-murchison-sieve-regex-08 (not latest)
9
 * Implementation: full
10
 * Status: testing
11
 *
12
 */
13
14
/* FIXME: Regular expressions are compiled during compilation and
15
 * again during interpretation. This is suboptimal and should be
16
 * changed. This requires dumping the compiled regex to the binary.
17
 * Most likely, this will only be possible when we implement regular
18
 * expressions ourselves.
19
 */
20
21
/* NOTE: Extension does not support unicode equality operator `[=e=]` or
22
 * collation sequence `[.e.]` due to dovecot lib-regex limitations.
23
 */
24
25
#include "lib.h"
26
#include "mempool.h"
27
#include "buffer.h"
28
29
#include "sieve-common.h"
30
31
#include "sieve-code.h"
32
#include "sieve-extensions.h"
33
#include "sieve-commands.h"
34
35
#include "sieve-comparators.h"
36
#include "sieve-match-types.h"
37
38
#include "sieve-validator.h"
39
#include "sieve-generator.h"
40
#include "sieve-interpreter.h"
41
42
#include "ext-regex-common.h"
43
44
#include <sys/types.h>
45
46
/*
47
 * Extension
48
 */
49
50
static bool ext_regex_validator_load
51
  (const struct sieve_extension *ext, struct sieve_validator *validator);
52
53
const struct sieve_extension_def regex_extension = {
54
  .name = "regex",
55
  .validator_load = ext_regex_validator_load,
56
  SIEVE_EXT_DEFINE_OPERAND(regex_match_type_operand)
57
};
58
59
static bool ext_regex_validator_load
60
(const struct sieve_extension *ext, struct sieve_validator *valdtr)
61
0
{
62
0
  sieve_match_type_register(valdtr, ext, &regex_match_type);
63
64
0
  return TRUE;
65
0
}
66
67