| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sieve_machine_t keeps all information necessary
for compiling and executing the script.
It is created by sieve_machine_create() and destroyed by
sieve_machine_destroy(). The functions for manipulating this data
type are described in 4.4.2 Manipulating the Sieve Machine.
SVT_VOID
SVT_NUMBER
SVT_STRING
SVT_STRING_LIST
list_t. Each item in this list represents a character string.
SVT_TAG
sieve_runtime_tag_t below.
SVT_IDENT
SVT_VALUE_LIST
list_t. Each item in this list is of sieve_value_t.
SVT_POINTER
sieve_value_t keeps an instance of sieve data. It is defined
as follows:
typedef struct {
sieve_data_type type; /* Type of the data */
union {
char *string; /* String value or identifier */
size_t number; /* Numeric value */
list_t list; /* List value */
sieve_runtime_tag_t *tag; /* Tag value */
void *ptr; /* Pointer value */
} v;
} sieve_value_t;
|
Depending on the value of type member, following members of the
union v keep the actual value:
SVT_VOID
SVT_NUMBER
number member.
SVT_STRING
string member.
SVT_STRING_LIST
SVT_VALUE_LIST
list member
SVT_TAG
tag member.
SVT_IDENT
string member points to the identifier name.
SVT_POINTER
ptr member.
typedef struct {
char *name; /* Tag name */
sieve_data_type argtype; /* Type of tag argument. */
} sieve_tag_def_t;
|
The name member points to the tag's name without leading
colon. The argtype is set to SVT_VOID if the tag does
not take argument, or to the type of the argument otherwise.
struct sieve_runtime_tag {
char *tag; /* Tag name */
sieve_value_t *arg; /* Tag argument (if any) */
};
|
The arg member is NULL if the tag does not take an argument.
This is a pointer to function handler for a sieve action or test. It is defined as follows:
typedef int (*sieve_handler_t) (sieve_machine_t mach,
list_t args, list_t tags);
|
The arguments to the handler have the following meaning:
typedef int (*sieve_printf_t) (void *data, const char *fmt, va_list ap); |
sieve_machine_init().
typedef int (*sieve_parse_error_t) (void *data,
const char *filename, int lineno,
const char *fmt, va_list ap);
|
It is used to declare error handlers for parsing errors. The application-specific data are passed in the data argument. Arguments filename and line indicate the location of the error in the source text, while fmt and ap give verbose description of the error.
typedef void (*sieve_action_log_t) (void *data,
const char *script,
size_t msgno, message_t msg,
const char *action,
const char *fmt, va_list ap);
|
sieve_message(), this argument is zero.
typedef int (*sieve_relcmp_t) (int, int); typedef int (*sieve_relcmpn_t) (size_t, size_t); |
typedef int (*sieve_comparator_t) (const char *, const char *); |
A pointer to the comparator handler function. The function compares
its two operands and returns 1 if they are equal, and 0 otherwise.
Notice, that the sense of the return value is inverted
in comparison with most standard libc functions like stcmp(), etc.
typedef int (*sieve_retrieve_t) (void *item, void *data, int idx,
char **pval);
|
A pointer to generic retriever function. See description of
sieve_vlist_compare() for details of its usage.
typedef void (*sieve_destructor_t) (void *data); |
A pointer to destructor function. The function frees any resources
associated with data. See the description of
sieve_machine_add_destructor() for more information.
typedef int (*sieve_tag_checker_t) (const char *name,
list_t tags,
list_t args)
|
A pointer to tag checker function. The purpose of the function is to perform compilation-time consistency test on tags. Its arguments are:
sieve_runtime_tag_t representing tags.
sieve_value_t representing required arguments to
name.
The function is allowed to make any changes in tags and args. It should return 0 if the syntax is correct and non-zero otherwise. It is responsible for issuing the diagnostics in the latter case. [FIXME: describe how to do that]
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |