Commit 98011160 98011160928d6891abb5af1d67ebf2a6124e558b by Sergey Poznyakoff

New sieve machine accessor functions

* include/mailutils/sieve.h (mu_sieve_get_mailbox)
(mu_sieve_get_argc): New protos.
* libmu_sieve/runtime.c: New functions.
1 parent 151eb4b9
......@@ -279,9 +279,13 @@ void mu_sieve_set_data (mu_sieve_machine_t mach, void *);
mu_message_t mu_sieve_get_message (mu_sieve_machine_t mach);
size_t mu_sieve_get_message_num (mu_sieve_machine_t mach);
mu_mailbox_t mu_sieve_get_mailbox (mu_sieve_machine_t mach);
int mu_sieve_is_dry_run (mu_sieve_machine_t mach);
int mu_sieve_set_dry_run (mu_sieve_machine_t mach, int val);
void mu_sieve_get_argc (mu_sieve_machine_t mach, size_t *args, size_t *tags);
mu_mailer_t mu_sieve_get_mailer (mu_sieve_machine_t mach);
int mu_sieve_get_locus (mu_sieve_machine_t mach, struct mu_locus *);
char *mu_sieve_get_daemon_email (mu_sieve_machine_t mach);
......
......@@ -183,6 +183,12 @@ mu_sieve_get_locus (mu_sieve_machine_t mach, struct mu_locus *loc)
return 1;
}
mu_mailbox_t
mu_sieve_get_mailbox (mu_sieve_machine_t mach)
{
return mach->mailbox;
}
mu_message_t
mu_sieve_get_message (mu_sieve_machine_t mach)
{
......@@ -203,6 +209,15 @@ mu_sieve_get_identifier (mu_sieve_machine_t mach)
return mach->identifier;
}
void
mu_sieve_get_argc (mu_sieve_machine_t mach, size_t *args, size_t *tags)
{
if (args)
*args = mach->argcount;
if (tags)
*tags = mach->tagcount;
}
int
mu_sieve_is_dry_run (mu_sieve_machine_t mach)
{
......