From: Richard Russon Date: Thu, 23 Aug 2018 17:10:06 +0000 (+0100) Subject: stubs for mx_path_{canon,pretty} X-Git-Tag: 2019-10-25~682^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=325ba456b3ab29eec610ba305384bd5c51b56150;p=neomutt stubs for mx_path_{canon,pretty} --- diff --git a/compress.c b/compress.c index 6f9c302a7..69f02f3da 100644 --- a/compress.c +++ b/compress.c @@ -931,5 +931,7 @@ struct MxOps mx_comp_ops = { .tags_edit = NULL, .tags_commit = NULL, .path_probe = comp_path_probe, + .path_canon = NULL, + .path_pretty = NULL, }; // clang-format on diff --git a/imap/imap.c b/imap/imap.c index ce98e12a4..d0de7dcb9 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -2753,5 +2753,7 @@ struct MxOps mx_imap_ops = { .tags_edit = imap_tags_edit, .tags_commit = imap_tags_commit, .path_probe = imap_path_probe, + .path_canon = NULL, + .path_pretty = NULL, }; // clang-format on diff --git a/maildir/mh.c b/maildir/mh.c index 0053d3f32..ac2f31dea 100644 --- a/maildir/mh.c +++ b/maildir/mh.c @@ -2970,6 +2970,8 @@ struct MxOps mx_maildir_ops = { .tags_edit = NULL, .tags_commit = NULL, .path_probe = maildir_path_probe, + .path_canon = NULL, + .path_pretty = NULL, }; /** @@ -2990,5 +2992,7 @@ struct MxOps mx_mh_ops = { .tags_edit = NULL, .tags_commit = NULL, .path_probe = mh_path_probe, + .path_canon = NULL, + .path_pretty = NULL, }; // clang-format on diff --git a/mbox/mbox.c b/mbox/mbox.c index cf9729326..c4c5c860e 100644 --- a/mbox/mbox.c +++ b/mbox/mbox.c @@ -1395,6 +1395,8 @@ struct MxOps mx_mbox_ops = { .tags_edit = NULL, .tags_commit = NULL, .path_probe = mbox_path_probe, + .path_canon = NULL, + .path_pretty = NULL, }; /** @@ -1415,5 +1417,7 @@ struct MxOps mx_mmdf_ops = { .tags_edit = NULL, .tags_commit = NULL, .path_probe = mbox_path_probe, + .path_canon = NULL, + .path_pretty = NULL, }; // clang-format on diff --git a/mx.c b/mx.c index 3be2051c6..16f257f54 100644 --- a/mx.c +++ b/mx.c @@ -1560,3 +1560,19 @@ int mx_path_probe(const char *path, const struct stat *st) return rc; } + +/** + * mx_path_canon - Canonicalise a mailbox path - Wrapper for MxOps::path_canon + */ +int mx_path_canon(char *buf, size_t buflen, const char *folder) +{ + return -1; +} + +/** + * mx_path_pretty - Abbreviate a mailbox path - Wrapper for MxOps::path_pretty + */ +int mx_path_pretty(char *buf, size_t buflen, const char *folder) +{ + return -1; +} diff --git a/mx.h b/mx.h index deb6ba4a8..1b7babfff 100644 --- a/mx.h +++ b/mx.h @@ -152,6 +152,24 @@ struct MxOps * @retval num Type, e.g. #MUTT_IMAP */ int (*path_probe) (const char *path, const struct stat *st); + /** + * path_canon - Canonicalise a mailbox path + * @param buf Path to modify + * @param buflen Length of buffer + * @param folder Base path for '=' substitution + * @retval 0 Success + * @retval -1 Failure + */ + int (*path_canon) (char *buf, size_t buflen, const char *folder); + /** + * path_pretty - Abbreviate a mailbox path + * @param buf Path to modify + * @param buflen Length of buffer + * @param folder Base path for '=' substitution + * @retval 0 Success + * @retval -1 Failure + */ + int (*path_pretty) (char *buf, size_t buflen, const char *folder); }; #ifdef USE_NOTMUCH @@ -227,6 +245,8 @@ int mx_msg_close (struct Context *ctx, struct Message **msg); int mx_tags_edit (struct Context *ctx, const char *tags, char *buf, size_t buflen); int mx_tags_commit (struct Context *ctx, struct Header *hdr, char *tags); int mx_path_probe (const char *path, const struct stat *st); +int mx_path_canon (char *buf, size_t buflen, const char *folder); +int mx_path_pretty (char *buf, size_t buflen, const char *folder); void mx_fastclose_mailbox(struct Context *ctx); diff --git a/nntp/nntp.c b/nntp/nntp.c index f9059ba85..75f879ae4 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -2659,5 +2659,7 @@ struct MxOps mx_nntp_ops = { .tags_edit = NULL, .tags_commit = NULL, .path_probe = nntp_path_probe, + .path_canon = NULL, + .path_pretty = NULL, }; // clang-format on diff --git a/notmuch/mutt_notmuch.c b/notmuch/mutt_notmuch.c index 623aaea64..5b5acf88e 100644 --- a/notmuch/mutt_notmuch.c +++ b/notmuch/mutt_notmuch.c @@ -2794,5 +2794,7 @@ struct MxOps mx_notmuch_ops = { .tags_edit = nm_tags_edit, .tags_commit = nm_tags_commit, .path_probe = nm_path_probe, + .path_canon = NULL, + .path_pretty = NULL, }; // clang-format on diff --git a/pop/pop.c b/pop/pop.c index 9e9959c29..9caf4a76c 100644 --- a/pop/pop.c +++ b/pop/pop.c @@ -1090,5 +1090,7 @@ struct MxOps mx_pop_ops = { .tags_edit = NULL, .tags_commit = NULL, .path_probe = pop_path_probe, + .path_canon = NULL, + .path_pretty = NULL, }; // clang-format on