NeoMutt  2023-03-22-27-g3cb248
Teaching an old dog new tricks
DOXYGEN
path_parent()

Find the parent of a Mailbox path. More...

+ Collaboration diagram for path_parent():

Functions

static int comp_path_parent (char *buf, size_t buflen)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -. More...
 
static int imap_path_parent (char *buf, size_t buflen)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -. More...
 
static int maildir_path_parent (char *buf, size_t buflen)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -. More...
 
static int mh_path_parent (char *buf, size_t buflen)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -. More...
 
static int mbox_path_parent (char *buf, size_t buflen)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -. More...
 
static int nntp_path_parent (char *buf, size_t buflen)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -. More...
 
static int nm_path_parent (char *buf, size_t buflen)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -. More...
 
static int pop_path_parent (char *buf, size_t buflen)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -. More...
 

Detailed Description

Find the parent of a Mailbox path.

Parameters
bufPath to modify
buflenLength of buffer
Return values
0Success
-1Failure
Precondition
buf is not NULL

Function Documentation

◆ comp_path_parent()

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

Find the parent of a Mailbox path - Implements MxOps::path_parent() -.

Definition at line 923 of file compress.c.

924{
925 if (mutt_path_parent(buf))
926 return 0;
927
928 if (buf[0] == '~')
929 mutt_path_canon(buf, buflen, HomeDir, false);
930
931 if (mutt_path_parent(buf))
932 return 0;
933
934 return -1;
935}
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
bool mutt_path_parent(char *buf)
Find the parent of a path.
Definition: path.c:458
+ Here is the call graph for this function:

◆ imap_path_parent()

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

Find the parent of a Mailbox path - Implements MxOps::path_parent() -.

Definition at line 2486 of file imap.c.

2487{
2488 char tmp[PATH_MAX] = { 0 };
2489
2490 imap_get_parent_path(buf, tmp, sizeof(tmp));
2491 mutt_str_copy(buf, tmp, buflen);
2492 return 0;
2493}
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:160
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
+ Here is the call graph for this function:

◆ maildir_path_parent()

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

Find the parent of a Mailbox path - Implements MxOps::path_parent() -.

Definition at line 1599 of file maildir.c.

1600{
1601 if (mutt_path_parent(buf))
1602 return 0;
1603
1604 if (buf[0] == '~')
1605 mutt_path_canon(buf, buflen, HomeDir, true);
1606
1607 if (mutt_path_parent(buf))
1608 return 0;
1609
1610 return -1;
1611}
+ Here is the call graph for this function:

◆ mh_path_parent()

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

Find the parent of a Mailbox path - Implements MxOps::path_parent() -.

Definition at line 1186 of file mh.c.

1187{
1188 if (mutt_path_parent(buf))
1189 return 0;
1190
1191 if (buf[0] == '~')
1192 mutt_path_canon(buf, buflen, HomeDir, true);
1193
1194 if (mutt_path_parent(buf))
1195 return 0;
1196
1197 return -1;
1198}
+ Here is the call graph for this function:

◆ mbox_path_parent()

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

Find the parent of a Mailbox path - Implements MxOps::path_parent() -.

Definition at line 1742 of file mbox.c.

1743{
1744 if (mutt_path_parent(buf))
1745 return 0;
1746
1747 if (buf[0] == '~')
1748 mutt_path_canon(buf, buflen, HomeDir, false);
1749
1750 if (mutt_path_parent(buf))
1751 return 0;
1752
1753 return -1;
1754}
+ Here is the call graph for this function:

◆ nntp_path_parent()

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

Find the parent of a Mailbox path - Implements MxOps::path_parent() -.

Definition at line 2764 of file nntp.c.

2765{
2766 /* Succeed, but don't do anything, for now */
2767 return 0;
2768}

◆ nm_path_parent()

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

Find the parent of a Mailbox path - Implements MxOps::path_parent() -.

Definition at line 2471 of file notmuch.c.

2472{
2473 /* Succeed, but don't do anything, for now */
2474 return 0;
2475}

◆ pop_path_parent()

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

Find the parent of a Mailbox path - Implements MxOps::path_parent() -.

Definition at line 1190 of file pop.c.

1191{
1192 /* Succeed, but don't do anything, for now */
1193 return 0;
1194}