This patchset allows to open a mailbox without relying on ctx->magic. The different parts of the codebase are very tightly coupled. The goal of this patchset is to start decoupling maiboxes of the rest of the application. To do so, a new structure mx_ops is introduced to define operations that a mailbox should implement in order to work with the rest of mutt.
For now, it has 3 callbacks: probe, open, and close. Open and close are pretty self-explanatory. The probe callback takes a path as parameter and return true if its mx_ops can handle this kind of mailbox. This way, mutt can maintain a list of mx_ops and probe each of them when opening a mailbox, until it finds the right one (or fails). Then, it can call other callbacks and do operations on the mailbox. The patchset is pretty big in term of commits, but I wanted to demonstrate the result that could be achieved. Nevertheless, I tried to keep commits as small as possible, for easier reviewing and the beauty of atomic changes. I would appreciate your feedback on this serie! Thanks, -- Damien