Revert changes to msgset test utility.
The changes would be nice, if it weren't for the fact that libproto is not yet built by the time libmailutils/tests are compiled.
Showing
2 changed files
with
7 additions
and
20 deletions
... | @@ -69,12 +69,6 @@ noinst_PROGRAMS = \ | ... | @@ -69,12 +69,6 @@ noinst_PROGRAMS = \ |
69 | 69 | ||
70 | LDADD = ${MU_LIB_MAILUTILS} | 70 | LDADD = ${MU_LIB_MAILUTILS} |
71 | 71 | ||
72 | msgset_LDADD = \ | ||
73 | ${MU_LIB_MBOX}\ | ||
74 | ${MU_LIB_MH}\ | ||
75 | ${MU_LIB_MAILDIR}\ | ||
76 | ${MU_LIB_MAILUTILS} | ||
77 | |||
78 | EXTRA_DIST += Encode Decode Wicketfile | 72 | EXTRA_DIST += Encode Decode Wicketfile |
79 | 73 | ||
80 | ## ------------ ## | 74 | ## ------------ ## | ... | ... |
... | @@ -53,16 +53,16 @@ parse_msgrange (char *arg, struct mu_msgrange *range) | ... | @@ -53,16 +53,16 @@ parse_msgrange (char *arg, struct mu_msgrange *range) |
53 | } | 53 | } |
54 | 54 | ||
55 | mu_msgset_t | 55 | mu_msgset_t |
56 | parse_msgset (mu_mailbox_t mbox, const char *arg) | 56 | parse_msgset (const char *arg) |
57 | { | 57 | { |
58 | int rc; | 58 | int rc; |
59 | mu_msgset_t msgset; | 59 | mu_msgset_t msgset; |
60 | char *end; | 60 | char *end; |
61 | 61 | ||
62 | MU_ASSERT (mu_msgset_create (&msgset, mbox, MU_MSGSET_NUM)); | 62 | MU_ASSERT (mu_msgset_create (&msgset, NULL, MU_MSGSET_NUM)); |
63 | if (arg) | 63 | if (arg) |
64 | { | 64 | { |
65 | rc = mu_msgset_parse_imap (msgset, MU_MSGSET_UID, arg, &end); | 65 | rc = mu_msgset_parse_imap (msgset, MU_MSGSET_NUM, arg, &end); |
66 | if (rc) | 66 | if (rc) |
67 | { | 67 | { |
68 | mu_error ("mu_msgset_parse_imap: %s near %s", | 68 | mu_error ("mu_msgset_parse_imap: %s near %s", |
... | @@ -79,33 +79,26 @@ main (int argc, char **argv) | ... | @@ -79,33 +79,26 @@ main (int argc, char **argv) |
79 | int i; | 79 | int i; |
80 | char *msgset_string = NULL; | 80 | char *msgset_string = NULL; |
81 | mu_msgset_t msgset; | 81 | mu_msgset_t msgset; |
82 | mu_mailbox_t mbox = NULL; | ||
83 | 82 | ||
84 | mu_set_program_name (argv[0]); | 83 | mu_set_program_name (argv[0]); |
85 | mu_register_local_mbox_formats (); | ||
86 | for (i = 1; i < argc; i++) | 84 | for (i = 1; i < argc; i++) |
87 | { | 85 | { |
88 | char *arg = argv[i]; | 86 | char *arg = argv[i]; |
89 | 87 | ||
90 | if (strcmp (arg, "-h") == 0 || strcmp (arg, "-help") == 0) | 88 | if (strcmp (arg, "-h") == 0 || strcmp (arg, "-help") == 0) |
91 | { | 89 | { |
92 | mu_printf ("usage: %s [-mailbox=PATH] [-msgset=SET] [-add=X[:Y]] [-del=X[:Y]] " | 90 | mu_printf ("usage: %s [-msgset=SET] [-add=X[:Y]] [-del=X[:Y]] " |
93 | "[-addset=SET] [-delset=SET] ...\n", | 91 | "[-addset=SET] [-delset=SET] ...\n", |
94 | mu_program_name); | 92 | mu_program_name); |
95 | return 0; | 93 | return 0; |
96 | } | 94 | } |
97 | else if (strncmp (arg, "-msgset=", 8) == 0) | 95 | else if (strncmp (arg, "-msgset=", 8) == 0) |
98 | msgset_string = arg + 8; | 96 | msgset_string = arg + 8; |
99 | else if (strncmp (arg, "-mailbox=", 9) == 0) | ||
100 | { | ||
101 | MU_ASSERT (mu_mailbox_create_default (&mbox, arg + 9)); | ||
102 | MU_ASSERT (mu_mailbox_open (mbox, MU_STREAM_READ)); | ||
103 | } | ||
104 | else | 97 | else |
105 | break; | 98 | break; |
106 | } | 99 | } |
107 | 100 | ||
108 | msgset = parse_msgset (mbox, msgset_string); | 101 | msgset = parse_msgset (msgset_string); |
109 | 102 | ||
110 | for (; i < argc; i++) | 103 | for (; i < argc; i++) |
111 | { | 104 | { |
... | @@ -126,7 +119,7 @@ main (int argc, char **argv) | ... | @@ -126,7 +119,7 @@ main (int argc, char **argv) |
126 | } | 119 | } |
127 | else if (strncmp (arg, "-addset=", 8) == 0) | 120 | else if (strncmp (arg, "-addset=", 8) == 0) |
128 | { | 121 | { |
129 | mu_msgset_t tset = parse_msgset (mbox, arg + 8); | 122 | mu_msgset_t tset = parse_msgset (arg + 8); |
130 | if (!msgset) | 123 | if (!msgset) |
131 | msgset = tset; | 124 | msgset = tset; |
132 | else | 125 | else |
... | @@ -137,7 +130,7 @@ main (int argc, char **argv) | ... | @@ -137,7 +130,7 @@ main (int argc, char **argv) |
137 | } | 130 | } |
138 | else if (strncmp (arg, "-subset=", 8) == 0) | 131 | else if (strncmp (arg, "-subset=", 8) == 0) |
139 | { | 132 | { |
140 | mu_msgset_t tset = parse_msgset (mbox, arg + 8); | 133 | mu_msgset_t tset = parse_msgset (arg + 8); |
141 | if (!msgset) | 134 | if (!msgset) |
142 | { | 135 | { |
143 | mu_error ("no initial message set"); | 136 | mu_error ("no initial message set"); | ... | ... |
-
Please register or sign in to post a comment