NeoMutt  2025-09-05-7-geaa2bd
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() -.
 
int maildir_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 mh_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 872 of file compress.c.

873{
874 mutt_path_canon(path, NeoMutt->home_dir, false);
875 return 0;
876}
bool mutt_path_canon(struct Buffer *path, const char *homedir, bool is_dir)
Create the canonical version of a path.
Definition: path.c:248
Container for Accounts, Notifications.
Definition: neomutt.h:43
char * home_dir
User's home directory.
Definition: neomutt.h:53
+ 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 2363 of file imap.c.

2364{
2365 struct Url *url = url_parse(buf_string(path));
2366 if (!url)
2367 return 0;
2368
2369 char tmp[PATH_MAX] = { 0 };
2370 char tmp2[PATH_MAX] = { 0 };
2371 if (url->path)
2372 {
2373 struct ImapAccountData *adata = NULL;
2374 if (imap_adata_find(buf_string(path), &adata, NULL) == 0)
2375 {
2376 imap_fix_path_with_delim(adata->delim, url->path, tmp, sizeof(tmp));
2377 }
2378 else
2379 {
2380 imap_fix_path(url->path, tmp, sizeof(tmp));
2381 }
2382 url->path = tmp;
2383 }
2384 url_tostring(url, tmp2, sizeof(tmp2), U_NO_FLAGS);
2385 buf_strcpy(path, tmp2);
2386 url_free(&url);
2387
2388 return 0;
2389}
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:395
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:96
char * imap_fix_path(const char *mailbox, char *path, size_t plen)
Fix up the imap path.
Definition: util.c:680
char * imap_fix_path_with_delim(char delim, const char *mailbox, char *path, size_t plen)
Fix up the imap path.
Definition: util.c:712
int imap_adata_find(const char *path, struct ImapAccountData **adata, struct ImapMboxData **mdata)
Find the Account data for this path.
Definition: util.c:71
#define PATH_MAX
Definition: mutt.h:42
void * adata
Private data (for Mailbox backends)
Definition: account.h:42
IMAP-specific Account data -.
Definition: adata.h:40
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
void url_free(struct Url **ptr)
Free the contents of a URL.
Definition: url.c:123
int url_tostring(const struct Url *url, char *dest, size_t len, uint8_t flags)
Output the URL string for a given Url object.
Definition: url.c:422
#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()

int maildir_path_canon ( struct Buffer path)

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

Definition at line 43 of file path.c.

44{
45 mutt_path_canon(path, NeoMutt->home_dir, true);
46 return 0;
47}
+ 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 1606 of file mbox.c.

1607{
1608 mutt_path_canon(path, NeoMutt->home_dir, false);
1609 return 0;
1610}
+ 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 1188 of file mh.c.

1189{
1190 mutt_path_canon(path, NeoMutt->home_dir, true);
1191 return 0;
1192}
+ 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 2799 of file nntp.c.

2800{
2801 return 0;
2802}

◆ nm_path_canon()

static int nm_path_canon ( struct Buffer path)
static

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

Definition at line 2490 of file notmuch.c.

2491{
2492 return 0;
2493}

◆ pop_path_canon()

static int pop_path_canon ( struct Buffer path)
static

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

Definition at line 1170 of file pop.c.

1171{
1172 return 0;
1173}