NeoMutt
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
path_parent()

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

+ Collaboration diagram for path_parent():

Functions

static int comp_path_parent (struct Buffer *path)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -.
 
static int imap_path_parent (struct Buffer *path)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -.
 
static int maildir_path_parent (struct Buffer *path)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -.
 
static int mh_path_parent (struct Buffer *path)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -.
 
static int mbox_path_parent (struct Buffer *path)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -.
 
static int nntp_path_parent (struct Buffer *path)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -.
 
static int nm_path_parent (struct Buffer *path)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -.
 
static int pop_path_parent (struct Buffer *path)
 Find the parent of a Mailbox path - Implements MxOps::path_parent() -.
 

Detailed Description

Find the parent of a Mailbox path.

Parameters
pathPath to modify
Return values
0Success
-1Failure
Precondition
path is not NULL

Function Documentation

◆ comp_path_parent()

static int comp_path_parent ( struct Buffer path)
static

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

Definition at line 932 of file compress.c.

933{
934 if (mutt_path_parent(path))
935 return 0;
936
937 if (buf_at(path, 0) == '~')
938 mutt_path_canon(path, HomeDir, false);
939
940 if (mutt_path_parent(path))
941 return 0;
942
943 return -1;
944}
char buf_at(const struct Buffer *buf, size_t offset)
Return the character at the given offset.
Definition: buffer.c:638
char * HomeDir
User's home directory.
Definition: globals.c:39
bool mutt_path_canon(struct Buffer *path, const char *homedir, bool is_dir)
Create the canonical version of a path.
Definition: path.c:280
bool mutt_path_parent(struct Buffer *path)
Find the parent of a path.
Definition: path.c:461
+ Here is the call graph for this function:

◆ imap_path_parent()

static int imap_path_parent ( struct Buffer path)
static

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

Definition at line 2390 of file imap.c.

2391{
2392 char tmp[PATH_MAX] = { 0 };
2393
2394 imap_get_parent_path(buf_string(path), tmp, sizeof(tmp));
2395 buf_strcpy(path, tmp);
2396 return 0;
2397}
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:407
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:93
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:160
#define PATH_MAX
Definition: mutt.h:41
+ Here is the call graph for this function:

◆ maildir_path_parent()

static int maildir_path_parent ( struct Buffer path)
static

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

Definition at line 1633 of file maildir.c.

1634{
1635 if (mutt_path_parent(path))
1636 return 0;
1637
1638 if (buf_at(path, 0) == '~')
1639 mutt_path_canon(path, HomeDir, true);
1640
1641 if (mutt_path_parent(path))
1642 return 0;
1643
1644 return -1;
1645}
+ Here is the call graph for this function:

◆ mh_path_parent()

static int mh_path_parent ( struct Buffer path)
static

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

Definition at line 1175 of file mh.c.

1176{
1177 if (mutt_path_parent(path))
1178 return 0;
1179
1180 if (buf_at(path, 0) == '~')
1181 mutt_path_canon(path, HomeDir, true);
1182
1183 if (mutt_path_parent(path))
1184 return 0;
1185
1186 return -1;
1187}
+ Here is the call graph for this function:

◆ mbox_path_parent()

static int mbox_path_parent ( struct Buffer path)
static

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

Definition at line 1636 of file mbox.c.

1637{
1638 if (mutt_path_parent(path))
1639 return 0;
1640
1641 if (buf_at(path, 0) == '~')
1642 mutt_path_canon(path, HomeDir, false);
1643
1644 if (mutt_path_parent(path))
1645 return 0;
1646
1647 return -1;
1648}
+ Here is the call graph for this function:

◆ nntp_path_parent()

static int nntp_path_parent ( struct Buffer path)
static

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

Definition at line 2765 of file nntp.c.

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

◆ nm_path_parent()

static int nm_path_parent ( struct Buffer path)
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 ( struct Buffer path)
static

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

Definition at line 1185 of file pop.c.

1186{
1187 /* Succeed, but don't do anything, for now */
1188 return 0;
1189}