Commit 8d06ba0d 8d06ba0dd41beb6e36576a426fc8228f75a3aaff by Sergey Poznyakoff

(instr_source,instr_line,sieve_get_locus): New functions

1 parent 027cbe88
......@@ -39,6 +39,28 @@ instr_nop (sieve_machine_t mach)
(unsigned long) (mach->pc - 1));
}
void
instr_source (sieve_machine_t mach)
{
mach->locus.source_file = SIEVE_ARG (mach, 0, string);
if (INSTR_DEBUG (mach))
sieve_debug (mach, "%4lu: SOURCE %s\n",
(unsigned long) (mach->pc - 1),
mach->locus.source_file);
SIEVE_ADJUST (mach, 1);
}
void
instr_line (sieve_machine_t mach)
{
mach->locus.source_line = SIEVE_ARG (mach, 0, line);
if (INSTR_DEBUG (mach))
sieve_debug (mach, "%4lu: LINE %lu\n",
(unsigned long) (mach->pc - 1),
(unsigned long) mach->locus.source_line);
SIEVE_ADJUST (mach, 1);
}
static int
instr_run (sieve_machine_t mach)
{
......@@ -200,6 +222,17 @@ sieve_get_data (sieve_machine_t mach)
return mach->data;
}
int
sieve_get_locus (sieve_machine_t mach, sieve_locus_t *loc)
{
if (mach->source_list)
{
*loc = mach->locus;
return 0;
}
return 1;
}
message_t
sieve_get_message (sieve_machine_t mach)
{
......