From 4ebf931a1e6d65388d0164926854266d6744b09f Mon Sep 17 00:00:00 2001 From: Stephan Bosch <stephan@rename-it.nl> Date: Tue, 22 Dec 2009 11:21:34 +0100 Subject: [PATCH] Variables extension: improved source code comment. --- src/lib-sieve/plugins/variables/ext-variables-name.c | 10 +++++++--- src/lib-sieve/plugins/variables/ext-variables-name.h | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib-sieve/plugins/variables/ext-variables-name.c b/src/lib-sieve/plugins/variables/ext-variables-name.c index 7a23e6c98..d71225252 100644 --- a/src/lib-sieve/plugins/variables/ext-variables-name.c +++ b/src/lib-sieve/plugins/variables/ext-variables-name.c @@ -23,8 +23,8 @@ int ext_variable_name_parse struct ext_variable_name *cur_element; string_t *cur_ident; - /* Acquire current position in the substitution structure or allocate - * a new one if this substitution consists of more elements than before. + /* Acquire current position in the array of name elements or allocate a new + * one if this substitution consists of more elements than before. */ if ( nspace_used < (int) array_count(vname) ) { cur_element = array_idx_modifiable @@ -37,6 +37,8 @@ int ext_variable_name_parse cur_ident = cur_element->identifier = t_str_new(32); } + /* Parse element */ + /* Identifier */ if ( *p == '_' || i_isalpha(*p) ) { cur_element->num_variable = -1; @@ -72,9 +74,11 @@ int ext_variable_name_parse *str = p; return -1; } - + + /* Advance to next name element */ nspace_used++; + /* Check whether next name element is present */ if ( p < strend && *p == '.' ) p++; else diff --git a/src/lib-sieve/plugins/variables/ext-variables-name.h b/src/lib-sieve/plugins/variables/ext-variables-name.h index ab5e34636..749941382 100644 --- a/src/lib-sieve/plugins/variables/ext-variables-name.h +++ b/src/lib-sieve/plugins/variables/ext-variables-name.h @@ -10,9 +10,9 @@ * 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 byte - * code a variable string will look as a series of substrings interrupted by - * integer operands that refer to variables. During execution the strings and + * 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. -- GitLab