Commit 027cbe88 027cbe8852675b47f629be971f46df21ad4e311b by Sergey Poznyakoff

(sieve_code_source,sieve_code_line): New

functions.
(sieve_code_action,sieve_code_test): Include line info before
coding the instruction.
1 parent 0c4f6a69
...@@ -304,16 +304,43 @@ sieve_code_command (sieve_register_t *reg, list_t arglist) ...@@ -304,16 +304,43 @@ sieve_code_command (sieve_register_t *reg, list_t arglist)
304 } 304 }
305 305
306 int 306 int
307 sieve_code_source (const char *name)
308 {
309 char *s;
310
311 if (list_locate (sieve_machine->source_list, (void*) name, (void **) &s))
312 {
313 s = sieve_mstrdup (sieve_machine, name);
314 list_append (sieve_machine->source_list, s);
315 }
316
317 return sieve_code_instr (instr_source)
318 || sieve_code_string (s);
319 }
320
321 int
322 sieve_code_line (size_t line)
323 {
324 sieve_op_t op;
325
326 op.line = line;
327 return sieve_code_instr (instr_line)
328 || sieve_code (&op);
329 }
330
331 int
307 sieve_code_action (sieve_register_t *reg, list_t arglist) 332 sieve_code_action (sieve_register_t *reg, list_t arglist)
308 { 333 {
309 return sieve_code_instr (instr_action) 334 return sieve_code_line (sieve_line_num)
335 || sieve_code_instr (instr_action)
310 || sieve_code_command (reg, arglist); 336 || sieve_code_command (reg, arglist);
311 } 337 }
312 338
313 int 339 int
314 sieve_code_test (sieve_register_t *reg, list_t arglist) 340 sieve_code_test (sieve_register_t *reg, list_t arglist)
315 { 341 {
316 return sieve_code_instr (instr_test) 342 return sieve_code_line (sieve_line_num)
343 || sieve_code_instr (instr_test)
317 || sieve_code_command (reg, arglist); 344 || sieve_code_command (reg, arglist);
318 } 345 }
319 346
......