~ubuntu-branches/ubuntu/quantal/dovecot/quantal

« back to all changes in this revision

Viewing changes to sieve/src/lib-sieve/tst-allof.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short, Scott Kitterman
  • Date: 2010-06-22 10:33:51 UTC
  • mfrom: (1.13.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100622103351-ifbmnklp8kxrhb30
Tags: 1:1.2.12-0ubuntu1
* New upstream release:
  - deliver: Don't crash when a message with Auto-submitted: header gets
   rejected.
  - lib-storage: Fixed header searches to work correctly when there are
    multiple headers with same name.
  - dict client: Disconnect from dict server after 1 second of idling.
  - dict: If process crashed, it wasn't automatically restarted
  - dict file: If dict file's group permissions equal world permissions,
    don't try to change its gid.
  - maildir: Fixed a memory leak when copying with hardlinks.
  - maildir: Expunging last messages may have assert-crashed if their
    filenames had just changed.
 * Update sieve patch to 0.1.17
 * debian/dovecot-common.postinst: Add warning about expired certificate.
   (Debian Bug: #576455)
 * Silence lintian warnings.

 [Scott Kitterman]
 * Rename dovecot-postfix to mail-stack-delivery per server-maverick-mail-
   integration spec.
   - Update debian/rules
   - Convert existing package to a dummy package and add new binary in debian/control
   - Update maintainer scripts.
   - Move previously installed backups and config files to new package name
     space in preinst
   - Add new debian/mail-stack-delivery.prerm to handle downgrades
   - Rename debian/dovecot-postfix.* to debian/mail-stack-delivery.*

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
#include "sieve-code.h"
10
10
#include "sieve-binary.h"
11
11
 
12
 
/*
13
 
 * Allof test
14
 
 *
15
 
 * Syntax
16
 
 *   allof <tests: test-list>
 
12
/* 
 
13
 * Allof test 
 
14
 * 
 
15
 * Syntax 
 
16
 *   allof <tests: test-list>   
17
17
 */
18
18
 
19
19
static bool tst_allof_generate
20
20
        (const struct sieve_codegen_env *cgenv, struct sieve_command *ctx,
21
21
                struct sieve_jumplist *jumps, bool jump_true);
22
22
 
23
 
const struct sieve_command_def tst_allof = {
24
 
        "allof",
25
 
        SCT_TEST,
 
23
const struct sieve_command_def tst_allof = { 
 
24
        "allof", 
 
25
        SCT_TEST, 
26
26
        0, 2, FALSE, FALSE,
27
 
        NULL, NULL, NULL, NULL,
28
 
        tst_allof_generate
 
27
        NULL, NULL, NULL, NULL, 
 
28
        tst_allof_generate 
29
29
};
30
30
 
31
 
/*
32
 
 * Code generation
 
31
/* 
 
32
 * Code generation 
33
33
 */
34
34
 
35
35
static bool tst_allof_generate
40
40
        struct sieve_ast_node *test;
41
41
        struct sieve_jumplist false_jumps;
42
42
 
43
 
        if ( sieve_ast_test_count(ctx->ast_node) > 1 ) {
 
43
        if ( sieve_ast_test_count(ctx->ast_node) > 1 ) {        
44
44
                if ( jump_true ) {
45
45
                        /* Prepare jumplist */
46
46
                        sieve_jumplist_init_temp(&false_jumps, sbin);
47
47
                }
48
 
 
 
48
        
49
49
                test = sieve_ast_test_first(ctx->ast_node);
50
 
                while ( test != NULL ) {
51
 
                        bool result;
 
50
                while ( test != NULL ) {        
 
51
                        bool result; 
52
52
 
53
53
                        /* If this test list must jump on false, all sub-tests can simply add their jumps
54
 
                         * to the caller's jump list, otherwise this test redirects all false jumps to the
 
54
                         * to the caller's jump list, otherwise this test redirects all false jumps to the 
55
55
                         * end of the currently generated code. This is just after a final jump to the true
56
 
                         * case
 
56
                         * case 
57
57
                         */
58
 
                        if ( jump_true )
 
58
                        if ( jump_true ) 
59
59
                                result = sieve_generate_test(cgenv, test, &false_jumps, FALSE);
60
60
                        else
61
61
                                result = sieve_generate_test(cgenv, test, jumps, FALSE);
62
 
 
 
62
                
63
63
                        if ( !result ) return FALSE;
64
64
 
65
65
                        test = sieve_ast_test_next(test);
66
 
                }
67
 
 
 
66
                }       
 
67
        
68
68
                if ( jump_true ) {
69
69
                        /* All tests succeeded, jump to case TRUE */
70
70
                        sieve_operation_emit(cgenv->sbin, NULL, &sieve_jmp_operation);
71
71
                        sieve_jumplist_add(jumps, sieve_binary_emit_offset(sbin, 0));
72
 
 
 
72
                        
73
73
                        /* All false exits jump here */
74
74
                        sieve_jumplist_resolve(&false_jumps);
75
75
                }
78
78
                test = sieve_ast_test_first(ctx->ast_node);
79
79
                sieve_generate_test(cgenv, test, jumps, jump_true);
80
80
        }
81
 
 
 
81
                
82
82
        return TRUE;
83
83
}
84
84