NeoMutt  2021-02-05-666-ge300cd
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 911 of file compress.c.

912 {
913  if (mutt_path_parent(buf, buflen))
914  return 0;
915 
916  if (buf[0] == '~')
917  mutt_path_canon(buf, buflen, HomeDir, false);
918 
919  if (mutt_path_parent(buf, buflen))
920  return 0;
921 
922  return -1;
923 }
bool mutt_path_parent(char *buf, size_t buflen)
Find the parent of a path.
Definition: path.c:459
char * HomeDir
User's home directory.
Definition: mutt_globals.h:45
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
+ 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 2463 of file imap.c.

2464 {
2465  char tmp[PATH_MAX] = { 0 };
2466 
2467  imap_get_parent_path(buf, tmp, sizeof(tmp));
2468  mutt_str_copy(buf, tmp, buflen);
2469  return 0;
2470 }
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:161
#define PATH_MAX
Definition: mutt.h:40
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:749
+ 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 1598 of file maildir.c.

1599 {
1600  if (mutt_path_parent(buf, buflen))
1601  return 0;
1602 
1603  if (buf[0] == '~')
1604  mutt_path_canon(buf, buflen, HomeDir, true);
1605 
1606  if (mutt_path_parent(buf, buflen))
1607  return 0;
1608 
1609  return -1;
1610 }
bool mutt_path_parent(char *buf, size_t buflen)
Find the parent of a path.
Definition: path.c:459
char * HomeDir
User's home directory.
Definition: mutt_globals.h:45
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
+ 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 1176 of file mh.c.

1177 {
1178  if (mutt_path_parent(buf, buflen))
1179  return 0;
1180 
1181  if (buf[0] == '~')
1182  mutt_path_canon(buf, buflen, HomeDir, true);
1183 
1184  if (mutt_path_parent(buf, buflen))
1185  return 0;
1186 
1187  return -1;
1188 }
bool mutt_path_parent(char *buf, size_t buflen)
Find the parent of a path.
Definition: path.c:459
char * HomeDir
User's home directory.
Definition: mutt_globals.h:45
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
+ 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 1721 of file mbox.c.

1722 {
1723  if (mutt_path_parent(buf, buflen))
1724  return 0;
1725 
1726  if (buf[0] == '~')
1727  mutt_path_canon(buf, buflen, HomeDir, false);
1728 
1729  if (mutt_path_parent(buf, buflen))
1730  return 0;
1731 
1732  return -1;
1733 }
bool mutt_path_parent(char *buf, size_t buflen)
Find the parent of a path.
Definition: path.c:459
char * HomeDir
User's home directory.
Definition: mutt_globals.h:45
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
+ 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 2740 of file nntp.c.

2741 {
2742  /* Succeed, but don't do anything, for now */
2743  return 0;
2744 }

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

2487 {
2488  /* Succeed, but don't do anything, for now */
2489  return 0;
2490 }

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

1197 {
1198  /* Succeed, but don't do anything, for now */
1199  return 0;
1200 }