Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
ebc5307d
...
ebc5307dba077c2fb4ef5d79f793d3ec6758f342
authored
2002-11-22 14:53:10 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(sieve_require_action, sieve_require_test): New functions.
1 parent
d92cbeef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
include/mailutils/libsieve.h
libsieve/register.c
include/mailutils/libsieve.h
View file @
ebc5307
...
...
@@ -26,6 +26,9 @@
extern
"C"
{
#endif
#define __s_cat3__(a,b,c) a ## b ## c
#define SIEVE_EXPORT(module,name) __s_cat3__(module,_LTX_,name)
typedef
struct
sieve_machine
*
sieve_machine_t
;
typedef
int
(
*
sieve_handler_t
)
__PMT
((
sieve_machine_t
mach
,
...
...
@@ -137,6 +140,8 @@ int sieve_register_comparator __P((sieve_machine_t mach,
sieve_comparator_t
contains
,
sieve_comparator_t
matches
,
sieve_comparator_t
regex
));
int
sieve_require_action
__P
((
sieve_machine_t
mach
,
const
char
*
name
));
int
sieve_require_test
__P
((
sieve_machine_t
mach
,
const
char
*
name
));
int
sieve_require_comparator
__P
((
sieve_machine_t
mach
,
const
char
*
name
));
sieve_comparator_t
sieve_comparator_lookup
__P
((
sieve_machine_t
mach
,
...
...
@@ -148,6 +153,7 @@ sieve_comparator_t sieve_get_comparator __P((sieve_machine_t mach,
void
sieve_require
__P
((
list_t
slist
));
int
sieve_tag_lookup
__P
((
list_t
taglist
,
char
*
name
,
sieve_value_t
**
arg
));
int
sieve_load_ext
__P
((
sieve_machine_t
mach
,
const
char
*
name
));
/* Operations in value lists */
sieve_value_t
*
sieve_value_get
__P
((
list_t
vlist
,
size_t
index
));
...
...
@@ -201,6 +207,7 @@ int sieve_mailbox __P((sieve_machine_t mach, mailbox_t mbox));
int
sieve_message
__P
((
sieve_machine_t
mach
,
message_t
message
));
int
sieve_disass
__P
((
sieve_machine_t
mach
));
#ifdef __cplusplus
}
#endif
...
...
libsieve/register.c
View file @
ebc5307
...
...
@@ -26,7 +26,7 @@
#include <sieve.h>
static
sieve_register_t
*
sieve
_lookup
(
list_t
list
,
const
char
*
name
)
reg
_lookup
(
list_t
list
,
const
char
*
name
)
{
iterator_t
itr
;
sieve_register_t
*
reg
;
...
...
@@ -49,15 +49,42 @@ sieve_lookup (list_t list, const char *name)
sieve_register_t
*
sieve_test_lookup
(
sieve_machine_t
mach
,
const
char
*
name
)
{
return
sieve
_lookup
(
mach
->
test_list
,
name
);
return
reg
_lookup
(
mach
->
test_list
,
name
);
}
sieve_register_t
*
sieve_action_lookup
(
sieve_machine_t
mach
,
const
char
*
name
)
{
return
sieve
_lookup
(
mach
->
action_list
,
name
);
return
reg
_lookup
(
mach
->
action_list
,
name
);
}
static
int
reg_require
(
sieve_machine_t
mach
,
list_t
list
,
const
char
*
name
)
{
sieve_register_t
*
reg
=
reg_lookup
(
list
,
name
);
if
(
!
reg
)
{
if
(
!
(
sieve_load_ext
(
mach
,
name
)
==
0
&&
(
reg
=
reg_lookup
(
list
,
name
))
!=
NULL
))
return
1
;
}
reg
->
required
=
1
;
return
0
;
}
int
sieve_require_action
(
sieve_machine_t
mach
,
const
char
*
name
)
{
return
reg_require
(
mach
,
mach
->
action_list
,
name
);
}
int
sieve_require_test
(
sieve_machine_t
mach
,
const
char
*
name
)
{
return
reg_require
(
mach
,
mach
->
test_list
,
name
);
}
static
int
sieve_register
(
list_t
*
pool
,
list_t
*
list
,
...
...
Please
register
or
sign in
to post a comment