Commit 0d359d25 0d359d2511ffe5209497963eb1a02d85e8863ac2 by Sergey Poznyakoff

New file. Documentation for the sieve library

1 parent 45424e0b
1 @c This is part of the GNU Mailutils manual.
2 @c Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc.
3 @c See file mailutils.texi for copying conditions.
4 @comment *******************************************************************
5
6 @menu
7 * Sieve Data Types::
8 * Manipulating the Sieve Machine::
9 * Logging and Diagnostic Functions::
10 * Symbol Space Functions::
11 * Memory Allocation::
12 * Compiling and Executing the Script::
13 @end menu
14
15 @node Sieve Data Types
16 @section Sieve Data Types
17
18 @deftp {Data Type} sieve_machine_t
19 @end deftp
20
21 @deftp {Enumeration} sieve_data_type
22 @end deftp
23
24 @deftp {Structure} sieve_value_t
25 @end deftp
26
27 @deftp {Structure} sieve_tag_def_t
28 @end deftp
29
30 @deftp {Structure} sieve_runtime_tag_t
31 @end deftp
32
33 @deftp {Function Type} sieve_handler_t
34 @example
35 typedef int (*sieve_handler_t) (sieve_machine_t mach,
36 list_t args, list_t tags);
37 @end example
38 @end deftp
39
40 @deftp {Function Type} sieve_printf_t
41 @example
42 typedef int (*sieve_printf_t) (void *data, const char *fmt, va_list ap);
43 @end example
44 @end deftp
45
46 @deftp {Function Type} sieve_parse_error_t
47 @example
48 typedef int (*sieve_parse_error_t) (void *data,
49 const char *filename, int lineno,
50 const char *fmt, va_list ap);
51 @end example
52 @end deftp
53
54 @deftp {Function Type} sieve_action_log_t
55 @example
56 typedef void (*sieve_action_log_t) (void *data,
57 const char *script,
58 size_t msgno, message_t msg,
59 const char *action,
60 const char *fmt, va_list ap);
61 @end example
62 @end deftp
63
64 @deftp {Function Type} sieve_comparator_t
65 @example
66 typedef int (*sieve_comparator_t) (const char *, const char *);
67 @end example
68 @end deftp
69
70 @deftp {Function Type} sieve_retrieve_t
71 @example
72 typedef int (*sieve_retrieve_t) (void *item, void *data, int idx,
73 char **pval);
74 @end example
75 @end deftp
76
77 @deftp {Function Type} sieve_destructor_t
78 @example
79 typedef void (*sieve_destructor_t) (void *data);
80 @end example
81 @end deftp
82
83 @deftp {Function Type} sieve_tag_checker_t
84 @example
85 typedef int (*sieve_tag_checker_t) (const char *name, list_t tags, list_t args)
86 @end example
87 @end deftp
88
89
90 @node Manipulating the Sieve Machine
91 @section Manipulating the Sieve Machine
92
93 @deftypefn int sieve_machine_init (sieve_machine_t *@var{mach}, void *@var{data})
94 @end deftypefn
95
96 @deftypefn void sieve_machine_destroy (sieve_machine_t *@var{pmach})
97 @end deftypefn
98
99 @deftypefn int sieve_machine_add_destructor (sieve_machine_t @var{mach}, sieve_destructor_t @var{destr}, void *@var{ptr});
100 @end deftypefn
101
102 @deftypefn void *sieve_get_data (sieve_machine_t @var{mach})
103 @end deftypefn
104
105 @deftypefn message_t sieve_get_message (sieve_machine_t @var{mach})
106 @end deftypefn
107
108 @deftypefn size_t sieve_get_message_num (sieve_machine_t @var{mach});
109 @end deftypefn
110
111 @deftypefn int sieve_get_debug_level (sieve_machine_t @var{mach})
112 @end deftypefn
113
114 @deftypefn ticket_t sieve_get_ticket (sieve_machine_t @var{mach})
115 @end deftypefn
116
117 @deftypefn mailer_t sieve_get_mailer (sieve_machine_t @var{mach})
118 @end deftypefn
119
120 @deftypefn {char *} sieve_get_daemon_email __P((sieve_machine_t @var{mach})
121 @end deftypefn
122
123
124 @deftypefn void sieve_set_error (sieve_machine_t @var{mach},
125 sieve_printf_t @var{error_printer})
126 @end deftypefn
127
128 @deftypefn void sieve_set_parse_error (sieve_machine_t @var{mach}, sieve_parse_error_t @var{p})
129 @end deftypefn
130
131 @deftypefn void sieve_set_debug (sieve_machine_t @var{mach}, sieve_printf_t @var{debug}));
132 @end deftypefn
133
134 @deftypefn void sieve_set_debug_level (sieve_machine_t @var{mach}, mu_debug_t @var{dbg}, int @var{level})
135 @end deftypefn
136
137 @deftypefn void sieve_set_logger (sieve_machine_t @var{mach}, sieve_action_log_t @var{logger})
138 @end deftypefn
139
140 @deftypefn void sieve_set_ticket (sieve_machine_t @var{mach}, ticket_t @var{ticket})
141 @end deftypefn
142
143 @deftypefn void sieve_set_mailer (sieve_machine_t @var{mach}, mailer_t @var{mailer})
144 @end deftypefn
145
146 @deftypefn void sieve_set_daemon_email (sieve_machine_t @var{mach}, const char *@var{email})
147 @end deftypefn
148
149 @deftypefn int sieve_is_dry_run (sieve_machine_t @var{mach})
150 @end deftypefn
151
152 @deftypefn {const char *} sieve_type_str (sieve_data_type @var{type})
153 @end deftypefn
154
155 @node Logging and Diagnostic Functions
156 @section Logging and Diagnostic Functions
157
158 @deftypefn void sieve_error (sieve_machine_t @var{mach}, const char *@var{fmt}, @dots{})
159 @end deftypefn
160
161 @deftypefn void sieve_debug (sieve_machine_t @var{mach}, const char *@var{fmt}, @dots{})
162 @end deftypefn
163
164 @deftypefn void sieve_log_action (sieve_machine_t @var{mach}, const char *@var{action}, const char *@var{fmt}, @dots{})
165 @end deftypefn
166
167 @deftypefn void sieve_abort (sieve_machine_t @var{mach})
168 @end deftypefn
169
170 @node Symbol Space Functions
171 @section Symbol Space Functions
172
173 @deftypefn {sieve_register_t *} sieve_test_lookup (sieve_machine_t @var{mach}, const char *@var{name})
174 @end deftypefn
175
176 @deftypefn sieve_register_t *sieve_action_lookup (sieve_machine_t @var{mach}, const char *@var{name})
177 @end deftypefn
178
179 @deftypefn int sieve_register_test (sieve_machine_t @var{mach}, const char *@var{name}, sieve_handler_t @var{handler}, sieve_data_type *@var{arg_types}, sieve_tag_group_t *@var{tags}, int @var{required})
180 @end deftypefn
181
182 @deftypefn int sieve_register_action (sieve_machine_t @var{mach}, const char *@var{name}, sieve_handler_t @var{handler}, sieve_data_type *@var{arg_types}, sieve_tag_group_t *@var{tags}, int @var{required})
183 @end deftypefn
184
185 @deftypefn int sieve_register_comparator (sieve_machine_t @var{mach}, const char *@var{name}, int @var{required}, sieve_comparator_t @var{is}, sieve_comparator_t @var{contains}, sieve_comparator_t @var{matches}, sieve_comparator_t @var{regex})
186 @end deftypefn
187
188 @deftypefn int sieve_tag_lookup (list_t @var{taglist}, char *@var{name}, sieve_value_t **@var{arg})
189 @end deftypefn
190
191 @deftypefn int sieve_load_ext (sieve_machine_t @var{mach}, const char *@var{name})
192 @end deftypefn
193
194 @node Memory Allocation
195 @section Memory Allocation
196
197 @deftypefn {void *} sieve_alloc (size_t @var{size})
198 @end deftypefn
199
200 @node Compiling and Executing the Script
201 @section Compiling and Executing the Script
202
203 @deftypefn int sieve_compile (sieve_machine_t @var{mach}, const char *@var{name})
204 @end deftypefn
205
206 @deftypefn int sieve_mailbox (sieve_machine_t @var{mach}, mailbox_t @var{mbox})
207 @end deftypefn
208
209 @deftypefn int sieve_message (sieve_machine_t @var{mach}, message_t @var{message})
210 @end deftypefn
211
212 @deftypefn int sieve_disass (sieve_machine_t @var{mach})
213 @end deftypefn
214
215
216