summaryrefslogtreecommitdiffstats
path: root/pigeonhole/src/lib-sieve/sieve-code-dumper.h
diff options
context:
space:
mode:
Diffstat (limited to 'pigeonhole/src/lib-sieve/sieve-code-dumper.h')
-rw-r--r--pigeonhole/src/lib-sieve/sieve-code-dumper.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/pigeonhole/src/lib-sieve/sieve-code-dumper.h b/pigeonhole/src/lib-sieve/sieve-code-dumper.h
new file mode 100644
index 0000000..651bd11
--- /dev/null
+++ b/pigeonhole/src/lib-sieve/sieve-code-dumper.h
@@ -0,0 +1,55 @@
+#ifndef SIEVE_CODE_DUMPER_H
+#define SIEVE_CODE_DUMPER_H
+
+#include "sieve-common.h"
+
+struct sieve_code_dumper;
+
+struct sieve_code_dumper *sieve_code_dumper_create
+ (struct sieve_dumptime_env *denv);
+void sieve_code_dumper_free
+ (struct sieve_code_dumper **_dumper);
+pool_t sieve_code_dumper_pool
+ (struct sieve_code_dumper *dumper);
+
+/*
+ * Extension support
+ */
+
+struct sieve_code_dumper_extension {
+ const struct sieve_extension_def *ext;
+
+ void (*free)(struct sieve_code_dumper *dumper, void *context);
+};
+
+void sieve_dump_extension_register
+(struct sieve_code_dumper *dumper, const struct sieve_extension *ext,
+ const struct sieve_code_dumper_extension *dump_ext, void *context);
+void sieve_dump_extension_set_context
+ (struct sieve_code_dumper *dumper, const struct sieve_extension *ext,
+ void *context);
+void *sieve_dump_extension_get_context
+ (struct sieve_code_dumper *dumper, const struct sieve_extension *ext);
+
+/* Dump functions */
+
+void sieve_code_dumpf
+ (const struct sieve_dumptime_env *denv, const char *fmt, ...)
+ ATTR_FORMAT(2, 3);
+
+void sieve_code_mark(const struct sieve_dumptime_env *denv);
+void sieve_code_mark_specific
+ (const struct sieve_dumptime_env *denv, sieve_size_t location);
+void sieve_code_descend(const struct sieve_dumptime_env *denv);
+void sieve_code_ascend(const struct sieve_dumptime_env *denv);
+
+/* Operations and operands */
+
+bool sieve_code_dumper_print_optional_operands
+ (const struct sieve_dumptime_env *denv, sieve_size_t *address);
+
+/* Code dump (debugging purposes) */
+
+void sieve_code_dumper_run(struct sieve_code_dumper *dumper);
+
+#endif