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
584aa9d7
...
584aa9d7a066294d58071e57e91dd1cb37d87b7c
authored
2003-07-26 11:21:30 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(instr_nop): New function
(instr_allof, instr_anyof): Removed
1 parent
beea043b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
46 deletions
libsieve/runtime.c
libsieve/runtime.c
View file @
584aa9d
...
...
@@ -31,6 +31,14 @@
&& (m)->debug_printer)
#define INSTR_DISASS(m) ((m)->debug_level & MU_SIEVE_DEBUG_DISAS)
void
instr_nop
(
sieve_machine_t
mach
)
{
if
(
INSTR_DEBUG
(
mach
))
sieve_debug
(
mach
,
"%4lu: NOP
\n
"
,
(
unsigned
long
)
(
mach
->
pc
-
1
));
}
static
int
instr_run
(
sieve_machine_t
mach
)
{
...
...
@@ -113,99 +121,70 @@ instr_pop (sieve_machine_t mach)
}
void
instr_
allof
(
sieve_machine_t
mach
)
instr_
not
(
sieve_machine_t
mach
)
{
int
num
=
SIEVE_ARG
(
mach
,
0
,
number
);
int
val
=
1
;
SIEVE_ADJUST
(
mach
,
1
);
if
(
INSTR_DEBUG
(
mach
))
{
sieve_debug
(
mach
,
"%4lu: ALLOF %d
\n
"
,
(
unsigned
long
)(
mach
->
pc
-
2
),
num
);
sieve_debug
(
mach
,
"%4lu: NOT
\n
"
,
(
unsigned
long
)(
mach
->
pc
-
1
));
if
(
INSTR_DISASS
(
mach
))
return
;
}
while
(
num
--
>
0
)
{
instr_pop
(
mach
);
val
&=
mach
->
reg
;
}
mach
->
reg
=
val
;
mach
->
reg
=
!
mach
->
reg
;
}
void
instr_
anyof
(
sieve_machine_t
mach
)
instr_
branch
(
sieve_machine_t
mach
)
{
int
num
=
SIEVE_ARG
(
mach
,
0
,
number
);
int
val
=
0
;
SIEVE_ADJUST
(
mach
,
1
);
long
num
=
SIEVE_ARG
(
mach
,
0
,
number
);
SIEVE_ADJUST
(
mach
,
1
);
if
(
INSTR_DEBUG
(
mach
))
{
sieve_debug
(
mach
,
"%4lu: ANYOF %d
\n
"
,
(
unsigned
long
)(
mach
->
pc
-
2
),
num
);
sieve_debug
(
mach
,
"%4lu: BRANCH %lu
\n
"
,
(
unsigned
long
)(
mach
->
pc
-
2
),
(
unsigned
long
)(
mach
->
pc
+
num
));
if
(
INSTR_DISASS
(
mach
))
return
;
}
while
(
num
--
>
0
)
{
instr_pop
(
mach
);
val
|=
mach
->
reg
;
}
mach
->
reg
=
val
;
}
void
instr_not
(
sieve_machine_t
mach
)
{
if
(
INSTR_DEBUG
(
mach
))
{
sieve_debug
(
mach
,
"%4lu: NOT
\n
"
,
(
unsigned
long
)(
mach
->
pc
-
1
));
if
(
INSTR_DISASS
(
mach
))
return
;
}
mach
->
reg
=
!
mach
->
reg
;
mach
->
pc
+=
num
;
}
void
instr_br
anch
(
sieve_machine_t
mach
)
instr_br
z
(
sieve_machine_t
mach
)
{
long
num
=
SIEVE_ARG
(
mach
,
0
,
number
);
SIEVE_ADJUST
(
mach
,
1
);
if
(
INSTR_DEBUG
(
mach
))
{
sieve_debug
(
mach
,
"%4lu: BR
ANCH
%lu
\n
"
,
sieve_debug
(
mach
,
"%4lu: BR
Z
%lu
\n
"
,
(
unsigned
long
)(
mach
->
pc
-
2
),
(
unsigned
long
)(
mach
->
pc
+
num
));
if
(
INSTR_DISASS
(
mach
))
return
;
}
if
(
!
mach
->
reg
)
mach
->
pc
+=
num
;
}
void
instr_brz
(
sieve_machine_t
mach
)
instr_br
n
z
(
sieve_machine_t
mach
)
{
long
num
=
SIEVE_ARG
(
mach
,
0
,
number
);
SIEVE_ADJUST
(
mach
,
1
);
if
(
INSTR_DEBUG
(
mach
))
{
sieve_debug
(
mach
,
"%4lu: BRZ %lu
\n
"
,
sieve_debug
(
mach
,
"%4lu: BR
N
Z %lu
\n
"
,
(
unsigned
long
)(
mach
->
pc
-
2
),
(
unsigned
long
)(
mach
->
pc
+
num
));
if
(
INSTR_DISASS
(
mach
))
return
;
}
if
(
!
mach
->
reg
)
if
(
mach
->
reg
)
mach
->
pc
+=
num
;
}
...
...
Please
register
or
sign in
to post a comment