NeoMutt  2022-04-29-178-g3b62e6
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:629
#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 1596 of file maildir.c.

1597{
1598 if (mutt_path_parent(buf))
1599 return 0;
1600
1601 if (buf[0] == '~')
1602 mutt_path_canon(buf, buflen, HomeDir, true);
1603
1604 if (mutt_path_parent(buf))
1605 return 0;
1606
1607 return -1;
1608}
+ 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 1735 of file mbox.c.

1736{
1737 if (mutt_path_parent(buf))
1738 return 0;
1739
1740 if (buf[0] == '~')
1741 mutt_path_canon(buf, buflen, HomeDir, false);
1742
1743 if (mutt_path_parent(buf))
1744 return 0;
1745
1746 return -1;
1747}
+ 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 2734 of file nntp.c.

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

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

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

◆ 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}