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
67432176
...
6743217693a0d837a62b364209c1a6a1edbc2de0
authored
2002-11-14 14:50:48 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(sieve_vlist_do, sieve_vlist_compare): New functions.
1 parent
a5be4691
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
libsieve/util.c
libsieve/util.c
View file @
6743217
...
...
@@ -338,6 +338,7 @@ tag_printer (sieve_runtime_tag_t *val, struct debug_data *dbg)
sieve_debug_internal
(
dbg
->
printer
,
dbg
->
data
,
")"
);
}
sieve_debug_internal
(
dbg
->
printer
,
dbg
->
data
,
" "
);
return
0
;
}
void
...
...
@@ -370,4 +371,64 @@ sieve_mark_deleted (message_t msg, int deleted)
return
rc
;
}
int
sieve_vlist_do
(
sieve_value_t
*
val
,
list_action_t
*
ac
,
void
*
data
)
{
switch
(
val
->
type
)
{
case
SVT_VALUE_LIST
:
case
SVT_STRING_LIST
:
return
list_do
(
val
->
v
.
list
,
ac
,
data
);
default:
return
-
1
;
}
}
struct
comp_data
{
sieve_value_t
*
val
;
sieve_comparator_t
comp
;
sieve_retrieve_t
retr
;
void
*
data
;
};
struct
comp_data2
{
char
*
sample
;
sieve_comparator_t
comp
;
};
int
_comp_action2
(
void
*
item
,
void
*
data
)
{
struct
comp_data2
*
cp
=
data
;
return
cp
->
comp
(
item
,
cp
->
sample
);
}
int
_comp_action
(
void
*
item
,
void
*
data
)
{
struct
comp_data
*
cp
=
data
;
struct
comp_data2
d
;
int
rc
;
if
(
cp
->
retr
(
item
,
cp
->
data
,
&
d
.
sample
))
return
0
;
d
.
comp
=
cp
->
comp
;
rc
=
sieve_vlist_do
(
cp
->
val
,
_comp_action2
,
&
d
);
free
(
d
.
sample
);
return
rc
;
}
int
sieve_vlist_compare
(
sieve_value_t
*
a
,
sieve_value_t
*
b
,
sieve_comparator_t
comp
,
sieve_retrieve_t
retr
,
void
*
data
)
{
struct
comp_data
d
;
d
.
comp
=
comp
;
d
.
retr
=
retr
;
d
.
data
=
data
;
d
.
val
=
b
;
return
sieve_vlist_do
(
a
,
_comp_action
,
&
d
);
}
...
...
Please
register
or
sign in
to post a comment