From 020fe58720db0168b0dc7a939d07b99ba7697f3c Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Fri, 4 Jan 2008 01:11:56 +0100
Subject: [PATCH] Published compiler API using script objects instead of paths.

---
 src/lib-sieve/sieve.c |  2 +-
 src/lib-sieve/sieve.h | 18 ++++++++++++------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/lib-sieve/sieve.c b/src/lib-sieve/sieve.c
index e2ce4b464..3ab118fa4 100644
--- a/src/lib-sieve/sieve.c
+++ b/src/lib-sieve/sieve.c
@@ -83,7 +83,7 @@ static struct sieve_binary *sieve_generate
 	return sbin;
 }
 
-static struct sieve_binary *sieve_compile_script
+struct sieve_binary *sieve_compile_script
 (struct sieve_script *script, struct sieve_error_handler *ehandler) 
 {
 	struct sieve_ast *ast;
diff --git a/src/lib-sieve/sieve.h b/src/lib-sieve/sieve.h
index e64940fca..df23aac5b 100644
--- a/src/lib-sieve/sieve.h
+++ b/src/lib-sieve/sieve.h
@@ -10,6 +10,7 @@
 #define SIEVE_VERSION "0.0.1"
 #define SIEVE_IMPLEMENTATION "Dovecot Sieve " SIEVE_VERSION
 
+struct sieve_script;
 struct sieve_binary;
 
 /* The mail message + envelope data */
@@ -50,26 +51,31 @@ struct sieve_script_env {
 bool sieve_init(const char *plugins);
 void sieve_deinit(void);
 
+/* sieve_compile_script:
+ */
+struct sieve_binary *sieve_compile_script
+	(struct sieve_script *script, struct sieve_error_handler *ehandler);
+
 /* sieve_compile:
  *
- *   Compiles the script into a binary. 
+ *   Compiles the script into a binary.
  */
 struct sieve_binary *sieve_compile
 	(const char *scriptpath, struct sieve_error_handler *ehandler);
 
 /* sieve_open:
- * 
+ *
  *   First tries to open the binary version of the specified script and
- *   if it does not exist or if it contains errors, the script is 
- *   (re-)compiled. The binary is updated if the script is recompiled. 
+ *   if it does not exist or if it contains errors, the script is
+ *   (re-)compiled. The binary is updated if the script is recompiled.
  *   Note that errors in the bytecode are not caught here.
- *   
+ *
  */
 struct sieve_binary *sieve_open
 	(const char *scriptpath, struct sieve_error_handler *ehandler);
 
 /* sieve_dump:
- * 
+ *
  *   Dumps the byte code in human-readable form to the specified ostream.
  */
 void sieve_dump(struct sieve_binary *sbin, struct ostream *stream);
-- 
GitLab