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
4e162e9b
...
4e162e9bb1a48269ce57a739a07d8c933a17bd57
authored
2016-11-23 13:46:43 +0200
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Further cleanup of sieve namespace
Prefix internal function names with mu_i_
1 parent
15404d91
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
54 deletions
libmu_sieve/actions.c
libmu_sieve/comparator.c
libmu_sieve/load.c
libmu_sieve/prog.c
libmu_sieve/runtime.c
libmu_sieve/sieve-priv.h
libmu_sieve/sieve.l
libmu_sieve/sieve.y
libmu_sieve/tests.c
libmu_sieve/util.c
libmu_sieve/actions.c
View file @
4e162e9
...
...
@@ -563,7 +563,7 @@ static mu_sieve_tag_group_t fileinto_tag_groups[] = {
};
void
mu_sv_register_standard_actions
(
mu_sieve_machine_t
mach
)
mu_
i_
sv_register_standard_actions
(
mu_sieve_machine_t
mach
)
{
mu_sieve_register_action
(
mach
,
"stop"
,
sieve_action_stop
,
NULL
,
NULL
,
1
);
mu_sieve_register_action
(
mach
,
"keep"
,
sieve_action_keep
,
NULL
,
NULL
,
1
);
...
...
libmu_sieve/comparator.c
View file @
4e162e9
...
...
@@ -502,7 +502,7 @@ i_ascii_numeric_eq (const char *pattern, const char *text)
}
void
mu_sv_register_standard_comparators
(
mu_sieve_machine_t
mach
)
mu_
i_
sv_register_standard_comparators
(
mu_sieve_machine_t
mach
)
{
mu_sieve_register_comparator
(
mach
,
"i;octet"
,
...
...
libmu_sieve/load.c
View file @
4e162e9
...
...
@@ -136,7 +136,7 @@ _add_load_dir (void *item, void *unused)
}
int
mu_sv_load_add_dir
(
mu_sieve_machine_t
mach
,
const
char
*
name
)
mu_
i_
sv_load_add_dir
(
mu_sieve_machine_t
mach
,
const
char
*
name
)
{
if
(
sieve_init_load_path
())
return
1
;
...
...
@@ -155,7 +155,7 @@ mu_sieve_load_ext (mu_sieve_machine_t mach, const char *name)
}
int
mu_sv_load_add_dir
(
mu_sieve_machine_t
mach
,
const
char
*
name
)
mu_
i_
sv_load_add_dir
(
mu_sieve_machine_t
mach
,
const
char
*
name
)
{
return
1
;
}
...
...
libmu_sieve/prog.c
View file @
4e162e9
...
...
@@ -50,7 +50,7 @@ file_eq (char const *a, char const *b)
{
if
(
a
)
return
b
?
(
strcmp
(
a
,
b
)
==
0
)
:
1
;
return
b
?
-
1
:
0
;
return
b
?
0
:
1
;
}
/* FIXME: 1. Only beg is stored
...
...
@@ -61,12 +61,12 @@ mu_i_sv_locus (struct mu_sieve_machine *mach, struct mu_locus_range *lr)
{
if
(
!
file_eq
(
mach
->
locus
.
mu_file
,
lr
->
beg
.
mu_file
))
{
mu_i_sv_code
(
mach
,
(
sieve_op_t
)
_mu_sv_instr_source
);
mu_i_sv_code
(
mach
,
(
sieve_op_t
)
_mu_
i_
sv_instr_source
);
mu_i_sv_code
(
mach
,
(
sieve_op_t
)
lr
->
beg
.
mu_file
);
}
if
(
mach
->
locus
.
mu_line
!=
lr
->
beg
.
mu_line
)
{
mu_i_sv_code
(
mach
,
(
sieve_op_t
)
_mu_sv_instr_line
);
mu_i_sv_code
(
mach
,
(
sieve_op_t
)
_mu_
i_
sv_instr_line
);
mu_i_sv_code
(
mach
,
(
sieve_op_t
)
lr
->
beg
.
mu_line
);
}
...
...
@@ -339,7 +339,7 @@ int
mu_i_sv_code_action
(
struct
mu_sieve_machine
*
mach
,
mu_sieve_register_t
*
reg
,
mu_list_t
arglist
)
{
return
mu_i_sv_code
(
mach
,
(
sieve_op_t
)
_mu_sv_instr_action
)
return
mu_i_sv_code
(
mach
,
(
sieve_op_t
)
_mu_
i_
sv_instr_action
)
||
sv_code_command
(
mach
,
reg
,
arglist
);
}
...
...
@@ -347,7 +347,7 @@ int
mu_i_sv_code_test
(
struct
mu_sieve_machine
*
mach
,
mu_sieve_register_t
*
reg
,
mu_list_t
arglist
)
{
return
mu_i_sv_code
(
mach
,
(
sieve_op_t
)
_mu_sv_instr_test
)
return
mu_i_sv_code
(
mach
,
(
sieve_op_t
)
_mu_
i_
sv_instr_test
)
||
sv_code_command
(
mach
,
reg
,
arglist
);
}
...
...
libmu_sieve/runtime.c
View file @
4e162e9
...
...
@@ -32,14 +32,14 @@
#define INSTR_DISASS(m) ((m)->debug_level & MU_SIEVE_DEBUG_DISAS)
void
_mu_sv_instr_nop
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_nop
(
mu_sieve_machine_t
mach
)
{
if
(
INSTR_DEBUG
(
mach
))
mu_sieve_debug
(
mach
,
"%4lu: NOP"
,
(
unsigned
long
)
(
mach
->
pc
-
1
));
}
void
_mu_sv_instr_source
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_source
(
mu_sieve_machine_t
mach
)
{
mach
->
locus
.
mu_file
=
(
char
*
)
SIEVE_ARG
(
mach
,
0
,
string
);
mu_stream_ioctl
(
mach
->
errstream
,
MU_IOCTL_LOGSTREAM
,
...
...
@@ -53,7 +53,7 @@ _mu_sv_instr_source (mu_sieve_machine_t mach)
}
void
_mu_sv_instr_line
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_line
(
mu_sieve_machine_t
mach
)
{
mach
->
locus
.
mu_line
=
SIEVE_ARG
(
mach
,
0
,
line
);
mu_stream_ioctl
(
mach
->
errstream
,
MU_IOCTL_LOGSTREAM
,
...
...
@@ -80,9 +80,9 @@ instr_run (mu_sieve_machine_t mach)
{
mu_stream_printf
(
mach
->
errstream
,
"
\033
s<%d>Arguments: "
,
MU_LOG_DEBUG
);
mu_sv_print_value_list
(
arg_list
,
mach
->
errstream
);
mu_
i_
sv_print_value_list
(
arg_list
,
mach
->
errstream
);
mu_stream_printf
(
mach
->
errstream
,
"
\n\033
s<%d>Tags: "
,
MU_LOG_DEBUG
);
mu_sv_print_tag_list
(
tag_list
,
mach
->
errstream
);
mu_
i_
sv_print_tag_list
(
tag_list
,
mach
->
errstream
);
mu_stream_printf
(
mach
->
errstream
,
"
\n
"
);
}
...
...
@@ -92,7 +92,7 @@ instr_run (mu_sieve_machine_t mach)
}
void
_mu_sv_instr_action
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_action
(
mu_sieve_machine_t
mach
)
{
mach
->
identifier
=
SIEVE_ARG
(
mach
,
3
,
string
);
if
(
INSTR_DEBUG
(
mach
))
...
...
@@ -105,7 +105,7 @@ _mu_sv_instr_action (mu_sieve_machine_t mach)
}
void
_mu_sv_instr_test
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_test
(
mu_sieve_machine_t
mach
)
{
mach
->
identifier
=
SIEVE_ARG
(
mach
,
3
,
string
);
if
(
INSTR_DEBUG
(
mach
))
...
...
@@ -117,7 +117,7 @@ _mu_sv_instr_test (mu_sieve_machine_t mach)
}
void
_mu_sv_instr_push
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_push
(
mu_sieve_machine_t
mach
)
{
if
(
INSTR_DEBUG
(
mach
))
{
...
...
@@ -135,7 +135,7 @@ _mu_sv_instr_push (mu_sieve_machine_t mach)
}
void
_mu_sv_instr_pop
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_pop
(
mu_sieve_machine_t
mach
)
{
if
(
INSTR_DEBUG
(
mach
))
{
...
...
@@ -153,7 +153,7 @@ _mu_sv_instr_pop (mu_sieve_machine_t mach)
}
void
_mu_sv_instr_not
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_not
(
mu_sieve_machine_t
mach
)
{
if
(
INSTR_DEBUG
(
mach
))
{
...
...
@@ -165,7 +165,7 @@ _mu_sv_instr_not (mu_sieve_machine_t mach)
}
void
_mu_sv_instr_branch
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_branch
(
mu_sieve_machine_t
mach
)
{
long
num
=
SIEVE_ARG
(
mach
,
0
,
number
);
...
...
@@ -183,7 +183,7 @@ _mu_sv_instr_branch (mu_sieve_machine_t mach)
}
void
_mu_sv_instr_brz
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_brz
(
mu_sieve_machine_t
mach
)
{
long
num
=
SIEVE_ARG
(
mach
,
0
,
number
);
SIEVE_ADJUST
(
mach
,
1
);
...
...
@@ -202,7 +202,7 @@ _mu_sv_instr_brz (mu_sieve_machine_t mach)
}
void
_mu_sv_instr_brnz
(
mu_sieve_machine_t
mach
)
_mu_
i_
sv_instr_brnz
(
mu_sieve_machine_t
mach
)
{
long
num
=
SIEVE_ARG
(
mach
,
0
,
number
);
SIEVE_ADJUST
(
mach
,
1
);
...
...
libmu_sieve/sieve-priv.h
View file @
4e162e9
...
...
@@ -157,26 +157,26 @@ int mu_i_sv_code_test (struct mu_sieve_machine *mach,
mu_sieve_register_t
*
reg
,
mu_list_t
arglist
);
/* Opcodes */
void
_mu_sv_instr_action
(
mu_sieve_machine_t
mach
);
void
_mu_sv_instr_test
(
mu_sieve_machine_t
mach
);
void
_mu_sv_instr_push
(
mu_sieve_machine_t
mach
);
void
_mu_sv_instr_pop
(
mu_sieve_machine_t
mach
);
void
_mu_sv_instr_not
(
mu_sieve_machine_t
mach
);
void
_mu_sv_instr_branch
(
mu_sieve_machine_t
mach
);
void
_mu_sv_instr_brz
(
mu_sieve_machine_t
mach
);
void
_mu_sv_instr_brnz
(
mu_sieve_machine_t
mach
);
void
_mu_sv_instr_nop
(
mu_sieve_machine_t
mach
);
void
_mu_sv_instr_source
(
mu_sieve_machine_t
mach
);
void
_mu_sv_instr_line
(
mu_sieve_machine_t
mach
);
int
mu_sv_load_add_dir
(
mu_sieve_machine_t
mach
,
const
char
*
name
);
void
mu_sv_register_standard_actions
(
mu_sieve_machine_t
mach
);
void
mu_sv_register_standard_tests
(
mu_sieve_machine_t
mach
);
void
mu_sv_register_standard_comparators
(
mu_sieve_machine_t
mach
);
void
mu_sv_print_value_list
(
mu_list_t
list
,
mu_stream_t
str
);
void
mu_sv_print_tag_list
(
mu_list_t
list
,
mu_stream_t
str
);
void
_mu_
i_
sv_instr_action
(
mu_sieve_machine_t
mach
);
void
_mu_
i_
sv_instr_test
(
mu_sieve_machine_t
mach
);
void
_mu_
i_
sv_instr_push
(
mu_sieve_machine_t
mach
);
void
_mu_
i_
sv_instr_pop
(
mu_sieve_machine_t
mach
);
void
_mu_
i_
sv_instr_not
(
mu_sieve_machine_t
mach
);
void
_mu_
i_
sv_instr_branch
(
mu_sieve_machine_t
mach
);
void
_mu_
i_
sv_instr_brz
(
mu_sieve_machine_t
mach
);
void
_mu_
i_
sv_instr_brnz
(
mu_sieve_machine_t
mach
);
void
_mu_
i_
sv_instr_nop
(
mu_sieve_machine_t
mach
);
void
_mu_
i_
sv_instr_source
(
mu_sieve_machine_t
mach
);
void
_mu_
i_
sv_instr_line
(
mu_sieve_machine_t
mach
);
int
mu_
i_
sv_load_add_dir
(
mu_sieve_machine_t
mach
,
const
char
*
name
);
void
mu_
i_
sv_register_standard_actions
(
mu_sieve_machine_t
mach
);
void
mu_
i_
sv_register_standard_tests
(
mu_sieve_machine_t
mach
);
void
mu_
i_
sv_register_standard_comparators
(
mu_sieve_machine_t
mach
);
void
mu_
i_
sv_print_value_list
(
mu_list_t
list
,
mu_stream_t
str
);
void
mu_
i_
sv_print_tag_list
(
mu_list_t
list
,
mu_stream_t
str
);
void
mu_i_sv_error
(
mu_sieve_machine_t
mach
);
...
...
libmu_sieve/sieve.l
View file @
4e162e9
...
...
@@ -461,7 +461,7 @@ sieve_searchpath (void)
name = get_file_name (p, endp, NULL);
if (name)
{
mu_sv_load_add_dir (mu_sieve_machine, name);
mu_
i_
sv_load_add_dir (mu_sieve_machine, name);
free (name);
}
}
...
...
libmu_sieve/sieve.y
View file @
4e162e9
...
...
@@ -604,7 +604,7 @@ code_node_cond (struct mu_sieve_machine *mach, struct mu_sieve_node *node)
size_t br1;
tree_code (mach, node->v.cond.expr);
mu_i_sv_code (mach, (sieve_op_t) _mu_sv_instr_brz);
mu_i_sv_code (mach, (sieve_op_t) _mu_
i_
sv_instr_brz);
br1 = mach->pc;
mu_i_sv_code (mach, (sieve_op_t) 0);
tree_code (mach, node->v.cond.iftrue);
...
...
@@ -613,7 +613,7 @@ code_node_cond (struct mu_sieve_machine *mach, struct mu_sieve_node *node)
{
size_t br2;
mu_i_sv_code (mach, (sieve_op_t) _mu_sv_instr_branch);
mu_i_sv_code (mach, (sieve_op_t) _mu_
i_
sv_instr_branch);
br2 = mach->pc;
mu_i_sv_code (mach, (sieve_op_t) 0);
...
...
@@ -761,7 +761,7 @@ optimize_node_anyof (struct mu_sieve_node *node)
static int
code_node_anyof (struct mu_sieve_machine *mach, struct mu_sieve_node *node)
{
return code_node_x_of (mach, node, (sieve_op_t) _mu_sv_instr_brnz);
return code_node_x_of (mach, node, (sieve_op_t) _mu_
i_
sv_instr_brnz);
}
/* mu_sieve_node_allof */
...
...
@@ -774,7 +774,7 @@ optimize_node_allof (struct mu_sieve_node *node)
static int
code_node_allof (struct mu_sieve_machine *mach, struct mu_sieve_node *node)
{
return code_node_x_of (mach, node, (sieve_op_t) _mu_sv_instr_brz);
return code_node_x_of (mach, node, (sieve_op_t) _mu_
i_
sv_instr_brz);
}
/* mu_sieve_node_not */
...
...
@@ -809,7 +809,7 @@ static int
code_node_not (struct mu_sieve_machine *mach, struct mu_sieve_node *node)
{
node_code (mach, node->v.node);
return mu_i_sv_code (mach, (sieve_op_t) _mu_sv_instr_not);
return mu_i_sv_code (mach, (sieve_op_t) _mu_
i_
sv_instr_not);
}
static void
...
...
@@ -1230,9 +1230,9 @@ mu_sieve_machine_destroy (mu_sieve_machine_t *pmach)
static void
sieve_machine_begin (mu_sieve_machine_t mach, const char *file)
{
mu_sv_register_standard_actions (mach);
mu_sv_register_standard_tests (mach);
mu_sv_register_standard_comparators (mach);
mu_
i_
sv_register_standard_actions (mach);
mu_
i_
sv_register_standard_tests (mach);
mu_
i_
sv_register_standard_comparators (mach);
mu_sieve_machine = mach;
}
...
...
@@ -1292,6 +1292,12 @@ sieve_parse (void)
tree_dump (mu_strerr, sieve_tree, 0);
}
mu_i_sv_code (mu_sieve_machine, (sieve_op_t) 0);
/* Clear location, so that mu_i_sv_locus will do its job. */
mu_sieve_machine->locus.mu_file = NULL;
mu_sieve_machine->locus.mu_line = 0;
mu_sieve_machine->locus.mu_col = 0;
rc = tree_code (mu_sieve_machine, sieve_tree);
if (rc)
mu_i_sv_error (mu_sieve_machine);
...
...
libmu_sieve/tests.c
View file @
4e162e9
...
...
@@ -428,7 +428,7 @@ mu_sieve_tag_group_t header_tag_groups[] = {
};
void
mu_sv_register_standard_tests
(
mu_sieve_machine_t
mach
)
mu_
i_
sv_register_standard_tests
(
mu_sieve_machine_t
mach
)
{
/* true and false are built-ins */
mu_sieve_register_test
(
mach
,
"address"
,
sieve_test_address
,
...
...
libmu_sieve/util.c
View file @
4e162e9
...
...
@@ -339,7 +339,7 @@ sieve_print_value (mu_sieve_value_t *val, mu_stream_t str)
}
void
mu_sv_print_value_list
(
mu_list_t
list
,
mu_stream_t
str
)
mu_
i_
sv_print_value_list
(
mu_list_t
list
,
mu_stream_t
str
)
{
mu_sieve_value_t
val
;
...
...
@@ -366,7 +366,7 @@ tag_printer (void *item, void *data)
}
void
mu_sv_print_tag_list
(
mu_list_t
list
,
mu_stream_t
str
)
mu_
i_
sv_print_tag_list
(
mu_list_t
list
,
mu_stream_t
str
)
{
mu_list_foreach
(
list
,
tag_printer
,
str
);
}
...
...
Please
register
or
sign in
to post a comment