File: ext-variables-name.h

package info (click to toggle)
dovecot 1%3A2.1.7-7%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 33,368 kB
  • sloc: ansic: 284,478; sh: 23,068; makefile: 4,874; cpp: 1,381; perl: 263; xml: 45; python: 34; pascal: 27
file content (46 lines) | stat: -rw-r--r-- 1,741 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Copyright (c) 2002-2012 Pigeonhole authors, see the included COPYING file
 */

#ifndef __EXT_VARIABLES_NAME
#define __EXT_VARIABLES_NAME

/* Variable Substitution
 * ---------------------
 * 
 * The variable strings are preprocessed into an AST list consisting of variable 
 * substitutions and constant parts of the string. The variables to which
 * the substitutions link are looked up and their index in their scope storage
 * is what is added to the list and eventually emitted as byte code. So, in 
 * bytecode a variable string will look as a series of substrings interrupted by
 * integer operands that refer to variables. During execution, the strings and 
 * the looked-up variables are concatenated to obtain the desired result. The 
 * the variable references are simple indexes into an array of variables, so
 * looking these up during execution is a trivial process.
 * 
 * However (RFC 5229):
 *   Tests or actions in future extensions may need to access the
 *   unexpanded version of the string argument and, e.g., do the expansion
 *   after setting variables in its namespace.  The design of the
 *   implementation should allow this.
 *
 * Various options exist to provide this feature. If the extension is entirely
 * namespace-based there is actually not very much of a problem. The variable
 * list can easily be extended with new argument-types that refer to a variable
 * identifier in stead of an index in the variable's storage. 
 */

#include "lib.h"
#include "array.h"

#include "sieve-common.h"

#include "ext-variables-common.h"

/*
 * Variable name parsing
 */
 
int ext_variable_name_parse
	(ARRAY_TYPE(sieve_variable_name) *vname, const char **str, const char *strend);

#endif /* __EXT_VARIABLES_NAME */