From eb4b1f97aeef3cff8708e459aa26bd7ed993274c Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Tue, 20 Nov 2007 23:02:37 +0100
Subject: [PATCH] Updated documentation with respect to regex externsion and
 match-type support.

---
 README                                  | 27 +++++++++++++++----------
 src/lib-sieve/plugins/regex/ext-regex.c | 19 ++++++++++-------
 2 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/README b/README
index de6c8a124..48d632bdc 100644
--- a/README
+++ b/README
@@ -1,3 +1,8 @@
+Compilation
+-----------
+
+Refer to INSTALL file.
+
 Installation
 ------------
 
@@ -30,20 +35,20 @@ Features
 What works:
 * Scripts can be parsed, the grammar is fully supported. 
 * Script validation (contextual analysis) works almost completely.
-* Script code generation works for most core commands with exception
-  of match-type arguments. Comparators and address-part modifiers already work.
-* Interpreter runs and dumps core commands and tests. Comparators and 
-  address-part modifiers have the desired effect. Match types other than :is are
-  not supported yet. Action commands have no effect. 
+* Script code generation works for most core commands. Comparators, match-types 
+  and address-part modifiers already work.
+* Interpreter runs and dumps core commands and tests. Comparators, match-types and 
+  address-part modifiers have the desired effect. Match type :matches is not 
+  supported yet. Action commands have no effect. 
  
-Implemented extensions:
+Implemented extensions and their implementation status:
 	subaddress: full
 	comparator-i;ascii-numeric: full, but fails to handle leading zeros
 	vacation: validation and generation only. Execution is broken.
 	relational: validation and generation only. 
-	regex: skeleton
+	regex: full, but suboptimal
 	
-Other extensionsions will be added a soon as the necessary infrastructure is 
+Other extensions will be added a soon as the necessary infrastructure is 
 available. Extensions supported by cmu-sieve have priority, although variables 
 might be implemented somewhere in between. 
 
@@ -74,9 +79,11 @@ INTERPRETER: sieve-interpreter.c
 TODO
 ----
 
-* Implement match-type execution
+* Further implement error handling and limit the maximum number of errors. 
 * Resolve code duplication amongst comparator, address-part and match-type 
   support as much as possible. 
+* Use dovecot streams for code dump (debugging), currently the code is riddled 
+  with printf()s. 
 * Produce a fully working interpreter that actually executes actions, currently
   tests are evaluated and actions just print their occurence.
 * Give the binary format some more thought, it is currently quite rough and
@@ -86,6 +93,4 @@ TODO
 * Automate script tests; i.e. build a test suite.
 * Use mmap for the binary script representation. 
 * Allow the currently in-memory byte-code to be stored as a script binary
-* Use dovecot streams for code dump (debugging), currently the code is riddled 
-  with printf()s. 
 
diff --git a/src/lib-sieve/plugins/regex/ext-regex.c b/src/lib-sieve/plugins/regex/ext-regex.c
index e92cbabe3..9a57460b3 100644
--- a/src/lib-sieve/plugins/regex/ext-regex.c
+++ b/src/lib-sieve/plugins/regex/ext-regex.c
@@ -1,10 +1,16 @@
 /* Extension regex 
- * --------------------
+ * ---------------
  *
- * Author: Stephan Bosch
+ * Authors: Stephan Bosch
  * Specification: draft-murchison-sieve-regex-07
- * Implementation: skeleton
- * Status: under development
+ * Implementation: full, but suboptimal
+ * Status: experimental, largely untested
+ *
+ * FIXME: Regular expressions are compiled during compilation and 
+ * again during interpretation. This is suboptimal and should be 
+ * changed. This requires dumping the compiled regex to the binary. 
+ * Most likely, this will only be possible when we implement regular
+ * expressions ourselves. 
  * 
  */
 
@@ -67,9 +73,6 @@ static bool ext_regex_load(int ext_id)
 	return TRUE;
 }
 
-/* Actual extension implementation */
-
-
 /* Extension access structures */
 
 extern const struct sieve_match_type_extension regex_match_extension;
@@ -195,6 +198,8 @@ bool mtch_regex_validate_context
 	return TRUE;
 }
 
+/* Actual extension implementation */
+
 void *mtch_regex_match_init
 (const struct sieve_match_type *mtch ATTR_UNUSED, 
 	const struct sieve_comparator *cmp, const char *key, 
-- 
GitLab