summaryrefslogtreecommitdiffstats
path: root/pigeonhole/src/lib-sieve/plugins/mime/ext-mime-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'pigeonhole/src/lib-sieve/plugins/mime/ext-mime-common.c')
-rw-r--r--pigeonhole/src/lib-sieve/plugins/mime/ext-mime-common.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/pigeonhole/src/lib-sieve/plugins/mime/ext-mime-common.c b/pigeonhole/src/lib-sieve/plugins/mime/ext-mime-common.c
new file mode 100644
index 0000000..5b38bcb
--- /dev/null
+++ b/pigeonhole/src/lib-sieve/plugins/mime/ext-mime-common.c
@@ -0,0 +1,27 @@
+/* Copyright (c) 2002-2018 Pigeonhole authors, see the included COPYING file
+ */
+
+#include "sieve-common.h"
+#include "sieve-interpreter.h"
+
+#include "ext-mime-common.h"
+
+struct ext_foreverypart_runtime_loop *
+ext_foreverypart_runtime_loop_get_current
+(const struct sieve_runtime_env *renv)
+{
+ struct sieve_interpreter_loop *loop;
+ struct ext_foreverypart_runtime_loop *fploop;
+
+ loop = sieve_interpreter_loop_get_global
+ (renv->interp, NULL, &foreverypart_extension);
+ if ( loop == NULL ) {
+ fploop = NULL;
+ } else {
+ fploop = (struct ext_foreverypart_runtime_loop *)
+ sieve_interpreter_loop_get_context(loop);
+ i_assert(fploop->part != NULL);
+ }
+
+ return fploop;
+}