[neomutt-devel] MXAPI - Path functions

Richard Russon rich at flatcap.org
Mon Aug 27 13:09:14 CEST 2018

I'm still working on my 'accounts' code, but that's meant changing a lot
of other code.  Most recently the Mailbox API.

Currently, the mailbox code knows a lot about the mailbox backends.
Also, some of the backends have references to $folder.

I've added four new functions to the Mailbox API:

    // Does this mailbox type recognise this path?
    int path_probe(const char *path, const struct stat *st);

    // Canonicalise a mailbox path
    int path_canon(char *buf, size_t buflen, const char *folder);

    // Abbreviate a mailbox path
    int path_pretty(char *buf, size_t buflen, const char *folder);

    // Find the parent of a mailbox path
    int path_parent(char *buf, size_t buflen);

This means that the backends are now responsible for managing their paths.
The common path manipulation code has been moved into `mutt/path.c`,
including new functions:

    bool mutt_path_canon(char *buf, size_t buflen, const char *homedir);
    bool mutt_path_pretty(char *buf, size_t buflen, const char *homedir);
    bool mutt_path_abbr_folder(char *buf, size_t buflen, const char *folder);

These changes are another step closer to Account-local $folder config values.

    Rich / FlatCap
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20180827/2f0bb532/attachment.sig>

More information about the neomutt-devel mailing list