NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
path_canon()

Canonicalise a Mailbox path. More...

+ Collaboration diagram for path_canon():

Functions

static int comp_path_canon (char *buf, size_t buflen)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -. More...
 
int imap_path_canon (char *buf, size_t buflen)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -. More...
 
int maildir_path_canon (char *buf, size_t buflen)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -. More...
 
int mh_path_canon (char *buf, size_t buflen)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -. More...
 
static int mbox_path_canon (char *buf, size_t buflen)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -. More...
 
static int nntp_path_canon (char *buf, size_t buflen)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -. More...
 
static int nm_path_canon (char *buf, size_t buflen)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -. More...
 
static int pop_path_canon (char *buf, size_t buflen)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -. More...
 

Detailed Description

Canonicalise a Mailbox path.

Parameters
bufPath to modify
buflenLength of buffer
Return values
0Success
-1Failure

Contract

Function Documentation

◆ comp_path_canon()

static int comp_path_canon ( char *  buf,
size_t  buflen 
)
static

Canonicalise a Mailbox path - Implements MxOps::path_canon() -.

Definition at line 888 of file compress.c.

889 {
890  mutt_path_canon(buf, buflen, HomeDir, false);
891  return 0;
892 }
char * HomeDir
User's home directory.
Definition: mutt_globals.h:45
bool mutt_path_canon(char *buf, size_t buflen, const char *homedir, bool is_dir)
Create the canonical version of a path.
Definition: path.c:285
+ Here is the call graph for this function:

◆ imap_path_canon()

int imap_path_canon ( char *  buf,
size_t  buflen 
)

Canonicalise a Mailbox path - Implements MxOps::path_canon() -.

Definition at line 2416 of file imap.c.

2417 {
2418  struct Url *url = url_parse(buf);
2419  if (!url)
2420  return 0;
2421 
2422  char tmp[PATH_MAX];
2423  char tmp2[PATH_MAX];
2424 
2425  imap_fix_path('\0', url->path, tmp, sizeof(tmp));
2426  url->path = tmp;
2427  url_tostring(url, tmp2, sizeof(tmp2), U_NO_FLAGS);
2428  mutt_str_copy(buf, tmp2, buflen);
2429  url_free(&url);
2430 
2431  return 0;
2432 }
A parsed URL proto://user:password@host:port/path?a=1&b=2
Definition: url.h:68
#define U_NO_FLAGS
Definition: url.h:49
void url_free(struct Url **ptr)
Free the contents of a URL.
Definition: url.c:123
#define PATH_MAX
Definition: mutt.h:40
int url_tostring(struct Url *url, char *dest, size_t len, uint8_t flags)
Output the URL string for a given Url object.
Definition: url.c:418
char * path
Path.
Definition: url.h:75
char * imap_fix_path(char delim, const char *mailbox, char *path, size_t plen)
Fix up the imap path.
Definition: util.c:687
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:749
struct Url * url_parse(const char *src)
Fill in Url.
Definition: url.c:234
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_path_canon()

int maildir_path_canon ( char *  buf,
size_t  buflen 
)

Canonicalise a Mailbox path - Implements MxOps::path_canon() -.

Definition at line 1589 of file maildir.c.

1590 {
1591  mutt_path_canon(buf, buflen, HomeDir, true);
1592  return 0;
1593 }
char * HomeDir
User's home directory.
Definition: mutt_globals.h:45
bool mutt_path_canon(char *buf, size_t buflen, const char *homedir, bool is_dir)
Create the canonical version of a path.
Definition: path.c:285
+ Here is the call graph for this function:

◆ mh_path_canon()

int mh_path_canon ( char *  buf,
size_t  buflen 
)

Canonicalise a Mailbox path - Implements MxOps::path_canon() -.

Definition at line 1167 of file mh.c.

1168 {
1169  mutt_path_canon(buf, buflen, HomeDir, true);
1170  return 0;
1171 }
char * HomeDir
User's home directory.
Definition: mutt_globals.h:45
bool mutt_path_canon(char *buf, size_t buflen, const char *homedir, bool is_dir)
Create the canonical version of a path.
Definition: path.c:285
+ Here is the call graph for this function:

◆ mbox_path_canon()

static int mbox_path_canon ( char *  buf,
size_t  buflen 
)
static

Canonicalise a Mailbox path - Implements MxOps::path_canon() -.

Definition at line 1698 of file mbox.c.

1699 {
1700  mutt_path_canon(buf, buflen, HomeDir, false);
1701  return 0;
1702 }
char * HomeDir
User's home directory.
Definition: mutt_globals.h:45
bool mutt_path_canon(char *buf, size_t buflen, const char *homedir, bool is_dir)
Create the canonical version of a path.
Definition: path.c:285
+ Here is the call graph for this function:

◆ nntp_path_canon()

static int nntp_path_canon ( char *  buf,
size_t  buflen 
)
static

Canonicalise a Mailbox path - Implements MxOps::path_canon() -.

Definition at line 2723 of file nntp.c.

2724 {
2725  return 0;
2726 }

◆ nm_path_canon()

static int nm_path_canon ( char *  buf,
size_t  buflen 
)
static

Canonicalise a Mailbox path - Implements MxOps::path_canon() -.

Definition at line 2469 of file notmuch.c.

2470 {
2471  return 0;
2472 }

◆ pop_path_canon()

static int pop_path_canon ( char *  buf,
size_t  buflen 
)
static

Canonicalise a Mailbox path - Implements MxOps::path_canon() -.

Definition at line 1179 of file pop.c.

1180 {
1181  return 0;
1182 }