Rearranged functions to let implicit prototyping work.
Showing
1 changed file
with
40 additions
and
40 deletions
... | @@ -149,46 +149,6 @@ notify_uid (size_t uid) | ... | @@ -149,46 +149,6 @@ notify_uid (size_t uid) |
149 | } | 149 | } |
150 | 150 | ||
151 | static void | 151 | static void |
152 | notify (void) | ||
153 | { | ||
154 | size_t total = 0; | ||
155 | int reset = 0; | ||
156 | |||
157 | mailbox_messages_count (mbox, &total); | ||
158 | |||
159 | if (!uid_table) | ||
160 | { | ||
161 | reset = 1; | ||
162 | reset_uids (); | ||
163 | } | ||
164 | |||
165 | if (uid_table) | ||
166 | { | ||
167 | size_t i; | ||
168 | size_t recent = 0; | ||
169 | |||
170 | for (i = 1; i <= total; i++) | ||
171 | { | ||
172 | message_t msg = NULL; | ||
173 | size_t uid = 0; | ||
174 | mailbox_get_message (mbox, i, &msg); | ||
175 | message_get_uid (msg, &uid); | ||
176 | if (!notify_uid (uid)) | ||
177 | recent++; | ||
178 | } | ||
179 | notify_deleted (); | ||
180 | util_out (RESP_NONE, "%d EXISTS", total); | ||
181 | if (recent) | ||
182 | util_out (RESP_NONE, "%d RECENT", recent); | ||
183 | } | ||
184 | |||
185 | if (!reset) | ||
186 | reset_uids (); | ||
187 | else | ||
188 | reset_notify (); | ||
189 | } | ||
190 | |||
191 | static void | ||
192 | free_uids (void) | 152 | free_uids (void) |
193 | { | 153 | { |
194 | if (uid_table) | 154 | if (uid_table) |
... | @@ -241,6 +201,46 @@ reset_uids (void) | ... | @@ -241,6 +201,46 @@ reset_uids (void) |
241 | } | 201 | } |
242 | } | 202 | } |
243 | 203 | ||
204 | static void | ||
205 | notify (void) | ||
206 | { | ||
207 | size_t total = 0; | ||
208 | int reset = 0; | ||
209 | |||
210 | mailbox_messages_count (mbox, &total); | ||
211 | |||
212 | if (!uid_table) | ||
213 | { | ||
214 | reset = 1; | ||
215 | reset_uids (); | ||
216 | } | ||
217 | |||
218 | if (uid_table) | ||
219 | { | ||
220 | size_t i; | ||
221 | size_t recent = 0; | ||
222 | |||
223 | for (i = 1; i <= total; i++) | ||
224 | { | ||
225 | message_t msg = NULL; | ||
226 | size_t uid = 0; | ||
227 | mailbox_get_message (mbox, i, &msg); | ||
228 | message_get_uid (msg, &uid); | ||
229 | if (!notify_uid (uid)) | ||
230 | recent++; | ||
231 | } | ||
232 | notify_deleted (); | ||
233 | util_out (RESP_NONE, "%d EXISTS", total); | ||
234 | if (recent) | ||
235 | util_out (RESP_NONE, "%d RECENT", recent); | ||
236 | } | ||
237 | |||
238 | if (!reset) | ||
239 | reset_uids (); | ||
240 | else | ||
241 | reset_notify (); | ||
242 | } | ||
243 | |||
244 | size_t | 244 | size_t |
245 | uid_to_msgno (size_t uid) | 245 | uid_to_msgno (size_t uid) |
246 | { | 246 | { | ... | ... |
-
Please register or sign in to post a comment