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
f13d2dd4
...
f13d2dd4180fb8c553808fb06bebbd1b8091695d
authored
2002-11-14 07:17:44 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(sieve_value_get, sieve_log_action, sieve_mark_deleted): New functions.
1 parent
8b018cd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
4 deletions
libsieve/util.c
libsieve/util.c
View file @
f13d2dd
...
...
@@ -144,12 +144,21 @@ sieve_value_create (sieve_data_type type, void *data)
break
;
default:
sieve_compile_error
(
sieve_filename
,
sieve_line_num
,
"Invalid data type"
);
sieve_compile_error
(
sieve_filename
,
sieve_line_num
,
"Invalid data type"
);
abort
();
}
return
val
;
}
sieve_value_t
*
sieve_value_get
(
list_t
vlist
,
size_t
index
)
{
sieve_value_t
*
val
=
NULL
;
list_get
(
vlist
,
index
,
(
void
**
)
&
val
);
return
val
;
}
void
sieve_compile_error
(
const
char
*
filename
,
int
linenum
,
const
char
*
fmt
,
...)
{
...
...
@@ -163,7 +172,7 @@ sieve_compile_error (const char *filename, int linenum, const char *fmt, ...)
}
void
sieve_error
(
sieve_machine_t
*
mach
,
const
char
*
fmt
,
...)
sieve_error
(
sieve_machine_t
mach
,
const
char
*
fmt
,
...)
{
va_list
ap
;
...
...
@@ -183,7 +192,7 @@ sieve_debug_internal (sieve_printf_t printer, void *data, const char *fmt, ...)
}
void
sieve_debug
(
sieve_machine_t
*
mach
,
const
char
*
fmt
,
...)
sieve_debug
(
sieve_machine_t
mach
,
const
char
*
fmt
,
...)
{
va_list
ap
;
...
...
@@ -192,6 +201,21 @@ sieve_debug (sieve_machine_t *mach, const char *fmt, ...)
va_end
(
ap
);
}
void
sieve_log_action
(
sieve_machine_t
mach
,
const
char
*
action
,
const
char
*
fmt
,
...)
{
va_list
ap
;
if
(
!
mach
->
logger
)
return
;
va_start
(
ap
,
fmt
);
mach
->
logger
(
mach
->
data
,
mach
->
filename
,
mach
->
msgno
,
mach
->
msg
,
action
,
fmt
,
ap
);
va_end
(
ap
);
}
int
_sieve_default_error_printer
(
void
*
unused
,
const
char
*
fmt
,
va_list
ap
)
{
...
...
@@ -202,8 +226,10 @@ int
_sieve_default_parse_error
(
void
*
unused
,
const
char
*
filename
,
int
lineno
,
const
char
*
fmt
,
va_list
ap
)
{
if
(
filename
)
fprintf
(
stderr
,
"%s:%d: "
,
filename
,
lineno
);
vfprintf
(
stderr
,
fmt
,
ap
);
fprintf
(
stderr
,
"
\n
"
);
return
0
;
}
...
...
@@ -325,3 +351,23 @@ sieve_print_tag_list (list_t list, sieve_printf_t printer, void *data)
}
int
sieve_mark_deleted
(
message_t
msg
,
int
deleted
)
{
attribute_t
attr
=
0
;
int
rc
;
rc
=
message_get_attribute
(
msg
,
&
attr
);
if
(
!
rc
)
{
if
(
deleted
)
rc
=
attribute_set_deleted
(
attr
);
else
rc
=
attribute_unset_deleted
(
attr
);
}
return
rc
;
}
...
...
Please
register
or
sign in
to post a comment