dovecot-2.0-pigeonhole: Copy extension: added public interface f...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Sun Jan 23 14:43:39 EET 2011
details: http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/f68dd69a4ac4
changeset: 1461:f68dd69a4ac4
user: Stephan Bosch <stephan at rename-it.nl>
date: Sun Jan 23 13:39:50 2011 +0100
description:
Copy extension: added public interface for adding the :copy tag to new commands.
diffstat:
src/lib-sieve/plugins/copy/Makefile.am | 10 ++++++++++
src/lib-sieve/plugins/copy/ext-copy.c | 14 ++++++++++++++
src/lib-sieve/plugins/copy/sieve-ext-copy.h | 21 +++++++++++++++++++++
3 files changed, 45 insertions(+), 0 deletions(-)
diffs (66 lines):
diff -r b894b8268a55 -r f68dd69a4ac4 src/lib-sieve/plugins/copy/Makefile.am
--- a/src/lib-sieve/plugins/copy/Makefile.am Tue Jan 18 21:46:08 2011 +0100
+++ b/src/lib-sieve/plugins/copy/Makefile.am Sun Jan 23 13:39:50 2011 +0100
@@ -6,3 +6,13 @@
libsieve_ext_copy_la_SOURCES = \
ext-copy.c
+
+public_headers = \
+ sieve-ext-copy.h
+
+headers =
+
+pkginc_libdir=$(dovecot_pkgincludedir)/sieve
+pkginc_lib_HEADERS = $(public_headers)
+noinst_HEADERS = $(headers)
+
diff -r b894b8268a55 -r f68dd69a4ac4 src/lib-sieve/plugins/copy/ext-copy.c
--- a/src/lib-sieve/plugins/copy/ext-copy.c Tue Jan 18 21:46:08 2011 +0100
+++ b/src/lib-sieve/plugins/copy/ext-copy.c Sun Jan 23 13:39:50 2011 +0100
@@ -115,6 +115,20 @@
&ext_side_effects
};
+/*
+ * Tag registration
+ */
+
+void sieve_ext_copy_register_tag
+(struct sieve_validator *valdtr, const struct sieve_extension *copy_ext,
+ const char *command)
+{
+ if ( sieve_validator_extension_loaded(valdr, copy_ext) ) {
+ sieve_validator_register_external_tag
+ (valdtr, command, copy_ext, ©_tag, SIEVE_OPT_SIDE_EFFECT);
+ }
+}
+
/*
* Tag validation
*/
diff -r b894b8268a55 -r f68dd69a4ac4 src/lib-sieve/plugins/copy/sieve-ext-copy.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lib-sieve/plugins/copy/sieve-ext-copy.h Sun Jan 23 13:39:50 2011 +0100
@@ -0,0 +1,21 @@
+#ifndef __SIEVE_EXT_COPY_H
+#define __SIEVE_EXT_COPY_H
+
+/* sieve_ext_copy_get_extension():
+ * Get the extension struct for the copy extension.
+ */
+static inline const struct sieve_extension *sieve_ext_copy_get_extension
+(struct sieve_instance *svinst)
+{
+ return sieve_extension_get_by_name(svinst, "copy");
+}
+
+/* sieve_ext_copy_register_tag():
+ * Register the :copy tagged argument for a command other than fileinto and
+ * redirect.
+ */
+void sieve_ext_copy_register_tag
+ (struct sieve_validator *valdtr, const struct sieve_extension *copy_ext,
+ const char *command);
+
+#endif /* __SIEVE_EXT_COPY_H */
More information about the dovecot-cvs
mailing list