Commit b49e4d91 b49e4d91a36e4e0057edd77a636c55bf343e294c by Sergey Poznyakoff

Adjust for the recent changes in symbol space functions

1 parent 315fe60c
...@@ -48,7 +48,7 @@ sieve_require (list_t slist) ...@@ -48,7 +48,7 @@ sieve_require (list_t slist)
48 48
49 if (strncmp (s, "comparator-", 11) == 0) 49 if (strncmp (s, "comparator-", 11) == 0)
50 { 50 {
51 if (sieve_require_comparator (s + 11)) 51 if (sieve_require_comparator (sieve_machine, s + 11))
52 { 52 {
53 sieve_compile_error (sieve_filename, sieve_line_num, 53 sieve_compile_error (sieve_filename, sieve_line_num,
54 "source for the required comparator %s is not available", 54 "source for the required comparator %s is not available",
...@@ -63,7 +63,7 @@ sieve_require (list_t slist) ...@@ -63,7 +63,7 @@ sieve_require (list_t slist)
63 else 63 else
64 { 64 {
65 sieve_register_t *reg; 65 sieve_register_t *reg;
66 reg = sieve_action_lookup (s); 66 reg = sieve_action_lookup (sieve_machine, s);
67 if (!reg) 67 if (!reg)
68 { 68 {
69 sieve_compile_error (sieve_filename, sieve_line_num, 69 sieve_compile_error (sieve_filename, sieve_line_num,
......
...@@ -218,7 +218,8 @@ begin : /* empty */ ...@@ -218,7 +218,8 @@ begin : /* empty */
218 218
219 test : command 219 test : command
220 { 220 {
221 sieve_register_t *reg = sieve_test_lookup ($1.ident); 221 sieve_register_t *reg = sieve_test_lookup (sieve_machine,
222 $1.ident);
222 $$ = sieve_machine->pc; 223 $$ = sieve_machine->pc;
223 224
224 if (!reg) 225 if (!reg)
...@@ -243,7 +244,8 @@ command : IDENT maybe_arglist ...@@ -243,7 +244,8 @@ command : IDENT maybe_arglist
243 244
244 action : command 245 action : command
245 { 246 {
246 sieve_register_t *reg = sieve_action_lookup ($1.ident); 247 sieve_register_t *reg = sieve_action_lookup (sieve_machine,
248 $1.ident);
247 249
248 $$ = sieve_machine->pc; 250 $$ = sieve_machine->pc;
249 if (!reg) 251 if (!reg)
...@@ -407,7 +409,12 @@ mailer_t ...@@ -407,7 +409,12 @@ mailer_t
407 sieve_get_mailer (sieve_machine_t mach) 409 sieve_get_mailer (sieve_machine_t mach)
408 { 410 {
409 if (!mach->mailer) 411 if (!mach->mailer)
412 {
410 mailer_create (&mach->mailer, NULL); 413 mailer_create (&mach->mailer, NULL);
414 if (mach->mu_debug)
415 mailer_set_debug (mach->mailer, mach->mu_debug);
416 }
417
411 return mach->mailer; 418 return mach->mailer;
412 } 419 }
413 420
...@@ -480,6 +487,9 @@ sieve_machine_destroy (sieve_machine_t *pmach) ...@@ -480,6 +487,9 @@ sieve_machine_destroy (sieve_machine_t *pmach)
480 mailer_destroy (&mach->mailer); 487 mailer_destroy (&mach->mailer);
481 list_do (mach->destr_list, _run_destructor, NULL); 488 list_do (mach->destr_list, _run_destructor, NULL);
482 list_destroy (&mach->destr_list); 489 list_destroy (&mach->destr_list);
490 list_destroy (&mach->action_list);
491 list_destroy (&mach->test_list);
492 list_destroy (&mach->comp_list);
483 sieve_slist_destroy (&mach->memory_pool); 493 sieve_slist_destroy (&mach->memory_pool);
484 free (mach); 494 free (mach);
485 *pmach = NULL; 495 *pmach = NULL;
...@@ -494,6 +504,9 @@ sieve_machine_begin (sieve_machine_t mach) ...@@ -494,6 +504,9 @@ sieve_machine_begin (sieve_machine_t mach)
494 sieve_machine = mach; 504 sieve_machine = mach;
495 sieve_error_count = 0; 505 sieve_error_count = 0;
496 sieve_code_instr (NULL); 506 sieve_code_instr (NULL);
507 sieve_register_standard_actions (mach);
508 sieve_register_standard_tests (mach);
509 sieve_register_standard_comparators (mach);
497 } 510 }
498 511
499 void 512 void
...@@ -508,9 +521,6 @@ sieve_compile (sieve_machine_t mach, const char *name) ...@@ -508,9 +521,6 @@ sieve_compile (sieve_machine_t mach, const char *name)
508 int rc; 521 int rc;
509 522
510 sieve_machine_begin (mach); 523 sieve_machine_begin (mach);
511 sieve_register_standard_actions ();
512 sieve_register_standard_tests ();
513 sieve_register_standard_comparators ();
514 524
515 if (sieve_lex_begin (name) == 0) 525 if (sieve_lex_begin (name) == 0)
516 { 526 {
......