NeoMutt
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
path_canon()

Canonicalise a Mailbox path. More...

+ Collaboration diagram for path_canon():

Functions

static int comp_path_canon (struct Buffer *path)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
 
int imap_path_canon (struct Buffer *path)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
 
static int maildir_path_canon (struct Buffer *path)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
 
static int mh_path_canon (struct Buffer *path)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
 
static int mbox_path_canon (struct Buffer *path)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
 
static int nntp_path_canon (struct Buffer *path)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
 
static int nm_path_canon (struct Buffer *path)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
 
static int pop_path_canon (struct Buffer *path)
 Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
 

Detailed Description

Canonicalise a Mailbox path.

Parameters
pathPath to modify
Return values
0Success
-1Failure
Precondition
path is not NULL

Function Documentation

◆ comp_path_canon()

static int comp_path_canon ( struct Buffer path)
static

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

Definition at line 909 of file compress.c.

910{
911 mutt_path_canon(path, HomeDir, false);
912 return 0;
913}
char * HomeDir
User's home directory.
Definition: globals.c:39
bool mutt_path_canon(struct Buffer *path, const char *homedir, bool is_dir)
Create the canonical version of a path.
Definition: path.c:280
+ Here is the call graph for this function:

◆ imap_path_canon()

int imap_path_canon ( struct Buffer path)

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

Definition at line 2343 of file imap.c.

2344{
2345 struct Url *url = url_parse(buf_string(path));
2346 if (!url)
2347 return 0;
2348
2349 char tmp[PATH_MAX] = { 0 };
2350 char tmp2[PATH_MAX];
2351
2352 imap_fix_path('\0', url->path, tmp, sizeof(tmp));
2353 url->path = tmp;
2354 url_tostring(url, tmp2, sizeof(tmp2), U_NO_FLAGS);
2355 buf_strcpy(path, tmp2);
2356 url_free(&url);
2357
2358 return 0;
2359}
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:407
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:93
char * imap_fix_path(char delim, const char *mailbox, char *path, size_t plen)
Fix up the imap path.
Definition: util.c:676
#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:238
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:422
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 ( struct Buffer path)
static

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

Definition at line 1624 of file maildir.c.

1625{
1626 mutt_path_canon(path, HomeDir, true);
1627 return 0;
1628}
+ Here is the call graph for this function:

◆ mh_path_canon()

static int mh_path_canon ( struct Buffer path)
static

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

Definition at line 1166 of file mh.c.

1167{
1168 mutt_path_canon(path, HomeDir, true);
1169 return 0;
1170}
+ Here is the call graph for this function:

◆ mbox_path_canon()

static int mbox_path_canon ( struct Buffer path)
static

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

Definition at line 1613 of file mbox.c.

1614{
1615 mutt_path_canon(path, HomeDir, false);
1616 return 0;
1617}
+ Here is the call graph for this function:

◆ nntp_path_canon()

static int nntp_path_canon ( struct Buffer path)
static

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

Definition at line 2748 of file nntp.c.

2749{
2750 return 0;
2751}

◆ nm_path_canon()

static int nm_path_canon ( struct Buffer path)
static

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

Definition at line 2454 of file notmuch.c.

2455{
2456 return 0;
2457}

◆ pop_path_canon()

static int pop_path_canon ( struct Buffer path)
static

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

Definition at line 1168 of file pop.c.

1169{
1170 return 0;
1171}