Coverage Report

Created: 2026-05-16 06:58

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/pigeonhole/src/lib-sieve/plugins/special-use/ext-special-use.c
Line
Count
Source
1
/* Copyright (c) 2019 Pigeonhole authors, see the included COPYING file */
2
3
/* Extension special-use
4
 * ---------------------
5
 *
6
 * Authors: Stephan Bosch
7
 * Specification: RFC 8579
8
 * Implementation: full
9
 * Status: testing
10
 *
11
 */
12
13
#include "sieve-common.h"
14
15
#include "sieve-code.h"
16
#include "sieve-extensions.h"
17
#include "sieve-actions.h"
18
#include "sieve-commands.h"
19
#include "sieve-validator.h"
20
#include "sieve-generator.h"
21
#include "sieve-interpreter.h"
22
#include "sieve-result.h"
23
24
#include "ext-special-use-common.h"
25
26
/*
27
 * Extension
28
 */
29
30
static bool
31
ext_special_use_validator_load(const struct sieve_extension *ext,
32
             struct sieve_validator *valdtr);
33
34
const struct sieve_extension_def special_use_extension = {
35
  .name = "special-use",
36
  .validator_load = ext_special_use_validator_load,
37
  SIEVE_EXT_DEFINE_OPERATION(specialuse_exists_operation),
38
  SIEVE_EXT_DEFINE_OPERAND(specialuse_operand)
39
};
40
41
static bool
42
ext_special_use_validator_load(const struct sieve_extension *ext,
43
             struct sieve_validator *valdtr)
44
0
{
45
  /* Register :specialuse tag with fileinto command and we don't care
46
     whether this command is registered or even whether it will be
47
     registered at all. The validator handles either situation gracefully.
48
   */
49
0
  sieve_validator_register_external_tag(
50
0
    valdtr, "fileinto", ext, &specialuse_tag,
51
0
    SIEVE_OPT_SIDE_EFFECT);
52
53
  /* Register new test */
54
0
  sieve_validator_register_command(valdtr, ext, &specialuse_exists_test);
55
56
0
  return TRUE;
57
0
}