NeoMutt  2023-03-22
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...
 
static int maildir_path_canon (char *buf, size_t buflen)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -. More...
 
static 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
Precondition
buf is not NULL

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 896 of file compress.c.

897{
898 mutt_path_canon(buf, buflen, HomeDir, false);
899 return 0;
900}
char * HomeDir
User's home directory.
Definition: globals.c:38
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 2415 of file imap.c.

2416{
2417 struct Url *url = url_parse(buf);
2418 if (!url)
2419 return 0;
2420
2421 char tmp[PATH_MAX] = { 0 };
2422 char tmp2[PATH_MAX];
2423
2424 imap_fix_path('\0', url->path, tmp, sizeof(tmp));
2425 url->path = tmp;
2426 url_tostring(url, tmp2, sizeof(tmp2), U_NO_FLAGS);
2427 mutt_str_copy(buf, tmp2, buflen);
2428 url_free(&url);
2429
2430 return 0;
2431}
char * imap_fix_path(char delim, const char *mailbox, char *path, size_t plen)
Fix up the imap path.
Definition: util.c:677
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:652
#define PATH_MAX
Definition: mutt.h:41
A parsed URL proto://user:password@host:port/path?a=1&b=2
Definition: url.h:69
char * path
Path.
Definition: url.h:75
struct Url * url_parse(const char *src)
Fill in Url.
Definition: url.c:234
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
void url_free(struct Url **ptr)
Free the contents of a URL.
Definition: url.c:123
#define U_NO_FLAGS
Definition: url.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_path_canon()

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

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

Definition at line 1588 of file maildir.c.

1589{
1590 mutt_path_canon(buf, buflen, HomeDir, true);
1591 return 0;
1592}
+ Here is the call graph for this function:

◆ mh_path_canon()

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

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

Definition at line 1175 of file mh.c.

1176{
1177 mutt_path_canon(buf, buflen, HomeDir, true);
1178 return 0;
1179}
+ 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 1707 of file mbox.c.

1708{
1709 mutt_path_canon(buf, buflen, HomeDir, false);
1710 return 0;
1711}
+ 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 2715 of file nntp.c.

2716{
2717 return 0;
2718}

◆ 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 2446 of file notmuch.c.

2447{
2448 return 0;
2449}

◆ 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 1172 of file pop.c.

1173{
1174 return 0;
1175}