]> granicus.if.org Git - neomutt/commitdiff
stubs for mx_path_{canon,pretty}
authorRichard Russon <rich@flatcap.org>
Thu, 23 Aug 2018 17:10:06 +0000 (18:10 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 25 Aug 2018 10:51:56 +0000 (11:51 +0100)
compress.c
imap/imap.c
maildir/mh.c
mbox/mbox.c
mx.c
mx.h
nntp/nntp.c
notmuch/mutt_notmuch.c
pop/pop.c

index 6f9c302a7cf5d19e580ba651b7892b99b2c4ecdf..69f02f3dae2e00cefbcc67a73047208d2aa14594 100644 (file)
@@ -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
index ce98e12a4e5894378b8b24ed535bacf642357232..d0de7dcb9b08e08647b258c26788ad896441f6d6 100644 (file)
@@ -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
index 0053d3f329adca5d0daf262ff58c0e7e7156a1d3..ac2f31dea5242ea0cade36fe98583db5be797a34 100644 (file)
@@ -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
index cf9729326fc09416144d14177d0b98e1c41b7621..c4c5c860e1d8ec31c1f96500534e795dd71b6487 100644 (file)
@@ -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 3be2051c6559531797279b7d1aa61d5f36d97fad..16f257f546f3ae2ff6986d422c326ee5dcf5092e 100644 (file)
--- 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 deb6ba4a897a3e854ff71abe955ecc08c0b99961..1b7babfff4921defd9a01298c63785176334dbe0 100644 (file)
--- 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);
 
index f9059ba85868bb96bf3679d404514751e8ad072f..75f879ae4eabb528a93b021c357594e40db36433 100644 (file)
@@ -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
index 623aaea648acbc6e2c92a7fdcec958d9da4713ab..5b5acf88e3ce4c1ecb56f7a5939368756cc92606 100644 (file)
@@ -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
index 9e9959c29a590673574a673c67a5f05dbcbe5bdb..9caf4a76c666bc289af0ffbf25b8f3727e588edb 100644 (file)
--- 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