NeoMutt  2022-04-29-247-gc6aae8
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...
 
int maildir_path_parent (char *buf, size_t buflen)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -. More...
 
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

Contract

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

918{
919 if (mutt_path_parent(buf))
920 return 0;
921
922 if (buf[0] == '~')
923 mutt_path_canon(buf, buflen, HomeDir, false);
924
925 if (mutt_path_parent(buf))
926 return 0;
927
928 return -1;
929}
char * HomeDir
User's home directory.
Definition: mutt_globals.h:49
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 2461 of file imap.c.

2462{
2463 char tmp[PATH_MAX] = { 0 };
2464
2465 imap_get_parent_path(buf, tmp, sizeof(tmp));
2466 mutt_str_copy(buf, tmp, buflen);
2467 return 0;
2468}
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:161
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:40
+ Here is the call graph for this function:

◆ maildir_path_parent()

int maildir_path_parent ( char *  buf,
size_t  buflen 
)

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

Definition at line 1595 of file maildir.c.

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

◆ mh_path_parent()

int mh_path_parent ( char *  buf,
size_t  buflen 
)

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

Definition at line 1183 of file mh.c.

1184{
1185 if (mutt_path_parent(buf))
1186 return 0;
1187
1188 if (buf[0] == '~')
1189 mutt_path_canon(buf, buflen, HomeDir, true);
1190
1191 if (mutt_path_parent(buf))
1192 return 0;
1193
1194 return -1;
1195}
+ 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 1730 of file mbox.c.

1731{
1732 if (mutt_path_parent(buf))
1733 return 0;
1734
1735 if (buf[0] == '~')
1736 mutt_path_canon(buf, buflen, HomeDir, false);
1737
1738 if (mutt_path_parent(buf))
1739 return 0;
1740
1741 return -1;
1742}
+ 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 2732 of file nntp.c.

2733{
2734 /* Succeed, but don't do anything, for now */
2735 return 0;
2736}

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

2462{
2463 /* Succeed, but don't do anything, for now */
2464 return 0;
2465}

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

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