-int mutt_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data,
- BUFFER * err)
+/* func to free buffy for list_del() */
+static inline void buffy_free (BUFFY** p) {
+ p_delete(&(*p)->path);
+ p_delete(p);
+}
+
+/* Return the index number of path in Incoming list */
+int buffy_lookup (const char* path) {
+ int i = 0;
+
+ if (list_empty(Incoming) || !path || !*path)
+ return (-1);
+
+ for (i = 0; i < Incoming->length; i++) {
+ if (!m_strcmp(((BUFFY *)Incoming->data[i])->path, path))
+ return (i);
+ }
+
+ return (-1);
+}
+
+int buffy_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data,
+ BUFFER * err __attribute__ ((unused)))