Node:Sieve Data Types, Next:Manipulating the Sieve Machine, Up:Library Description
sieve_machine_t | Data Type |
This is an opaque data type representing a pointer to an instance of
sieve machine. The sieve_machine_t keeps all information necessary
for compiling and executing the script.
It is created by |
sieve_data_type | Data Type |
This enumeration keeps the possible types of sieve data. These are:
|
sieve_value_t | Data Type |
The 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
|
sieve_tag_def_t | Data Type |
This structure represents a definition of a tagged (optional) argument
to a sieve action or test. It is defined as follows:
typedef struct { char *name; /* Tag name */ sieve_data_type argtype; /* Type of tag argument. */ } sieve_tag_def_t; The |
sieve_runtime_tag_t | Data Type |
This structure represents the tagged (optional) argument at a runtime.
It is defined as:
struct sieve_runtime_tag { char *tag; /* Tag name */ sieve_value_t *arg; /* Tag argument (if any) */ }; The |
sieve_handler_t | Data Type |
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:
sieve_printf_t | Data Type |
A pointer to a diagnostic output function. It is defined as follows:
typedef int (*sieve_printf_t) (void *data, const char *fmt, va_list ap); |
sieve_machine_init()
.
sieve_parse_error_t | Data Type |
This data type is declared as follows:
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.
sieve_action_log_t | Data Type |
A pointer to the application-specific logging function:
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.
sieve_comparator_t | Data Type |
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 |
sieve_retrieve_t | Data Type |
typedef int (*sieve_retrieve_t) (void *item, void *data, int idx, char **pval); A pointer to generic retriever function. See description of
|
sieve_destructor_t | Data Type |
typedef void (*sieve_destructor_t) (void *data); A pointer to destructor function. The function frees any resources
associated with |
sieve_tag_checker_t | Data Type |
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:
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] |