NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
shared.h File Reference

Maildir shared functions. More...

#include <stdbool.h>
#include <stdio.h>
#include <sys/types.h>
+ Include dependency graph for shared.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void maildir_canon_filename (struct Buffer *dest, const char *src)
 Generate the canonical filename for a Maildir folder.
 
mode_t maildir_umask (struct Mailbox *m)
 Create a umask from the mailbox directory.
 
bool maildir_update_flags (struct Mailbox *m, struct Email *e_old, struct Email *e_new)
 Update the mailbox flags.
 
struct Emailmaildir_email_new (void)
 Create a Maildir Email.
 
void maildir_gen_flags (char *dest, size_t destlen, struct Email *e)
 Generate the Maildir flags for an email.
 
bool maildir_msg_open_new (struct Mailbox *m, struct Message *msg, const struct Email *e)
 Open a new message in a Mailbox - Implements MxOps::msg_open_new() -.
 
FILE * maildir_open_find_message (const char *folder, const char *msg, char **newname)
 Find a message by name.
 
void maildir_parse_flags (struct Email *e, const char *path)
 Parse Maildir file flags.
 
bool maildir_parse_message (const char *fname, bool is_old, struct Email *e)
 Actually parse a maildir message.
 
bool maildir_parse_stream (FILE *fp, const char *fname, bool is_old, struct Email *e)
 Parse a Maildir message.
 
int maildir_path_is_empty (struct Buffer *path)
 Is the mailbox empty.
 
int maildir_rewrite_message (struct Mailbox *m, struct Email *e)
 Sync a message in an Maildir folder.
 
bool maildir_sync_mailbox_message (struct Mailbox *m, struct Email *e, struct HeaderCache *hc)
 Save changes to the mailbox.
 
void maildir_update_mtime (struct Mailbox *m)
 Update our record of the Maildir modification time.
 

Detailed Description

Maildir shared functions.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file shared.h.

Function Documentation

◆ maildir_canon_filename()

void maildir_canon_filename ( struct Buffer * dest,
const char * src )

Generate the canonical filename for a Maildir folder.

Parameters
destBuffer for the result
srcBuffer containing source filename
Note
maildir filename is defined as: <base filename>:2,<flags> but <base filename> may contain additional comma separated fields. Additionally, : may be replaced as the field delimiter by a user defined alternative.

Definition at line 72 of file shared.c.

73{
74 if (!dest || !src)
75 return;
76
77 char *t = strrchr(src, '/');
78 if (t)
79 src = t + 1;
80
81 buf_strcpy(dest, src);
82
83 const char c_maildir_field_delimiter = *cc_maildir_field_delimiter();
84
85 char searchable_bytes[8] = { 0 };
86 snprintf(searchable_bytes, sizeof(searchable_bytes), ",%c", c_maildir_field_delimiter);
87 char *u = strpbrk(dest->data, searchable_bytes);
88
89 if (u)
90 {
91 *u = '\0';
92 dest->dptr = u;
93 }
94}
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
const char * cc_maildir_field_delimiter(void)
Get the cached value of $maildir_field_delimiter.
char * dptr
Current read/write position.
Definition buffer.h:38
char * data
Pointer to data.
Definition buffer.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_umask()

mode_t maildir_umask ( struct Mailbox * m)

Create a umask from the mailbox directory.

Parameters
mMailbox
Return values
numUmask

Definition at line 46 of file shared.c.

47{
49 if (mdata && mdata->umask)
50 return mdata->umask;
51
52 struct stat st = { 0 };
53 if (stat(mailbox_path(m), &st) != 0)
54 {
55 mutt_debug(LL_DEBUG1, "stat failed on %s\n", mailbox_path(m));
56 return 077;
57 }
58
59 return 0777 & ~st.st_mode;
60}
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition mailbox.h:213
#define mutt_debug(LEVEL,...)
Definition logging2.h:91
@ LL_DEBUG1
Log at debug level 1.
Definition logging2.h:45
struct MaildirMboxData * maildir_mdata_get(struct Mailbox *m)
Get the private data for this Mailbox.
Definition mdata.c:59
void * mdata
Driver specific data.
Definition mailbox.h:131
Maildir-specific Mailbox data -.
Definition mdata.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_update_flags()

bool maildir_update_flags ( struct Mailbox * m,
struct Email * e_old,
struct Email * e_new )

Update the mailbox flags.

Parameters
mMailbox
e_oldOld Email
e_newNew Email
Return values
trueThe flags changed
falseOtherwise

Definition at line 104 of file shared.c.

105{
106 if (!m)
107 return false;
108
109 /* save the global state here so we can reset it at the
110 * end of list block if required. */
111 bool context_changed = m->changed;
112
113 /* user didn't modify this message. alter the flags to match the
114 * current state on disk. This may not actually do
115 * anything. mutt_set_flag() will just ignore the call if the status
116 * bits are already properly set, but it is still faster not to pass
117 * through it */
118 if (e_old->flagged != e_new->flagged)
119 mutt_set_flag(m, e_old, MUTT_FLAG, e_new->flagged, true);
120 if (e_old->replied != e_new->replied)
121 mutt_set_flag(m, e_old, MUTT_REPLIED, e_new->replied, true);
122 if (e_old->read != e_new->read)
123 mutt_set_flag(m, e_old, MUTT_READ, e_new->read, true);
124 if (e_old->old != e_new->old)
125 mutt_set_flag(m, e_old, MUTT_OLD, e_new->old, true);
126
127 /* mutt_set_flag() will set this, but we don't need to
128 * sync the changes we made because we just updated the
129 * context to match the current on-disk state of the
130 * message. */
131 bool header_changed = e_old->changed;
132 e_old->changed = false;
133
134 /* if the mailbox was not modified before we made these
135 * changes, unset the changed flag since nothing needs to
136 * be synchronized. */
137 if (!context_changed)
138 m->changed = false;
139
140 return header_changed;
141}
void mutt_set_flag(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
Definition flags.c:54
@ MUTT_READ
Messages that have been read.
Definition mutt.h:92
@ MUTT_OLD
Old messages.
Definition mutt.h:90
@ MUTT_FLAG
Flagged messages.
Definition mutt.h:98
@ MUTT_REPLIED
Messages that have been replied to.
Definition mutt.h:91
bool read
Email is read.
Definition email.h:50
bool old
Email is seen, but unread.
Definition email.h:49
bool changed
Email has been edited.
Definition email.h:77
bool flagged
Marked important?
Definition email.h:47
bool replied
Email has been replied to.
Definition email.h:51
bool changed
Mailbox has been modified.
Definition mailbox.h:109
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_email_new()

struct Email * maildir_email_new ( void )

Create a Maildir Email.

Return values
ptrNewly created Email

Create a new Email and attach MaildirEmailData.

Note
This should be freed using email_free()

Definition at line 68 of file mailbox.c.

69{
70 struct Email *e = email_new();
73
74 return e;
75}
struct Email * email_new(void)
Create a new Email.
Definition email.c:77
void maildir_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free() -.
Definition edata.c:38
struct MaildirEmailData * maildir_edata_new(void)
Create a new MaildirEmailData object.
Definition edata.c:53
The envelope/body of an email.
Definition email.h:39
void * edata
Driver-specific data.
Definition email.h:74
void(* edata_free)(void **ptr)
Definition email.h:90
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_gen_flags()

void maildir_gen_flags ( char * dest,
size_t destlen,
struct Email * e )

Generate the Maildir flags for an email.

Parameters
destBuffer for the result
destlenLength of buffer
eEmail

Definition at line 71 of file message.c.

72{
73 *dest = '\0';
74
75 const char *flags = NULL;
76
78 if (edata)
79 flags = edata->custom_flags;
80
81 /* The maildir specification requires that all files in the cur
82 * subdirectory have the :unique string appended, regardless of whether
83 * or not there are any flags. If .old is set, we know that this message
84 * will end up in the cur directory, so we include it in the following
85 * test even though there is no associated flag. */
86
87 if (e->flagged || e->replied || e->read || e->deleted || e->old || flags)
88 {
89 char tmp[1024] = { 0 };
90 snprintf(tmp, sizeof(tmp), "%s%s%s%s%s", e->flagged ? "F" : "", e->replied ? "R" : "",
91 e->read ? "S" : "", e->deleted ? "T" : "", NONULL(flags));
92 if (flags)
93 mutt_qsort_r(tmp, strlen(tmp), 1, maildir_sort_flags, NULL);
94
95 const char c_maildir_field_delimiter = *cc_maildir_field_delimiter();
96 snprintf(dest, destlen, "%c2,%s", c_maildir_field_delimiter, tmp);
97 }
98}
static int maildir_sort_flags(const void *a, const void *b, void *sdata)
Compare two flag characters - Implements sort_t -.
Definition message.c:60
struct MaildirEmailData * maildir_edata_get(struct Email *e)
Get the private data for this Email.
Definition edata.c:63
void mutt_qsort_r(void *base, size_t nmemb, size_t size, sort_t compar, void *sdata)
Sort an array, where the comparator has access to opaque data rather than requiring global variables.
Definition qsort_r.c:67
#define NONULL(x)
Definition string2.h:44
bool deleted
Email is deleted.
Definition email.h:78
Maildir-specific Email data -.
Definition edata.h:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_open_find_message()

FILE * maildir_open_find_message ( const char * folder,
const char * msg,
char ** newname )

Find a message by name.

Parameters
[in]folderMaildir path
[in]msgEmail path
[out]newnameNew name, if it has moved
Return values
ptrFile handle

Definition at line 168 of file message.c.

169{
170 static unsigned int new_hits = 0, cur_hits = 0; /* simple dynamic optimization */
171
172 struct Buffer *unique = buf_pool_get();
173 maildir_canon_filename(unique, msg);
174
175 /* Prevent counter saturation by halving both when either gets large */
176 if ((new_hits > (UINT_MAX / 2)) || (cur_hits > (UINT_MAX / 2)))
177 {
178 new_hits /= 2;
179 cur_hits /= 2;
180 }
181
182 FILE *fp = maildir_open_find_message_dir(folder, buf_string(unique),
183 (new_hits > cur_hits) ? "new" : "cur", newname);
184 if (fp || (errno != ENOENT))
185 {
186 if (new_hits > cur_hits)
187 new_hits++;
188 else
189 cur_hits++;
190
191 goto cleanup;
192 }
193 fp = maildir_open_find_message_dir(folder, buf_string(unique),
194 (new_hits > cur_hits) ? "cur" : "new", newname);
195 if (fp || (errno != ENOENT))
196 {
197 if (new_hits > cur_hits)
198 cur_hits++;
199 else
200 new_hits++;
201
202 goto cleanup;
203 }
204
205 fp = NULL;
206
207cleanup:
208 buf_pool_release(&unique);
209
210 return fp;
211}
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
static FILE * maildir_open_find_message_dir(const char *folder, const char *unique, const char *subfolder, char **newname)
Find a message in a maildir folder.
Definition message.c:112
void maildir_canon_filename(struct Buffer *dest, const char *src)
Generate the canonical filename for a Maildir folder.
Definition shared.c:72
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:91
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
String manipulation buffer.
Definition buffer.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_parse_flags()

void maildir_parse_flags ( struct Email * e,
const char * path )

Parse Maildir file flags.

Parameters
eEmail
pathPath to email file

Definition at line 82 of file mailbox.c.

83{
84 char *q = NULL;
85
86 e->flagged = false;
87 e->read = false;
88 e->replied = false;
89
91 if (!edata)
92 {
94 edata = e->edata;
95 }
96
97 const char c_maildir_field_delimiter = *cc_maildir_field_delimiter();
98 char *p = strrchr(path, c_maildir_field_delimiter);
99 if (p && mutt_str_startswith(p + 1, "2,"))
100 {
101 p += 3;
102
103 mutt_str_replace(&edata->custom_flags, p);
104 q = edata->custom_flags;
105
106 while (*p)
107 {
108 switch (*p)
109 {
110 case 'F': // Flagged
111 e->flagged = true;
112 break;
113
114 case 'R': // Replied
115 e->replied = true;
116 break;
117
118 case 'S': // Seen
119 e->read = true;
120 break;
121
122 case 'T': // Trashed
123 {
124 const bool c_flag_safe = cs_subset_bool(NeoMutt->sub, "flag_safe");
125 if (!e->flagged || !c_flag_safe)
126 {
127 e->trash = true;
128 e->deleted = true;
129 }
130 break;
131 }
132
133 default:
134 *q++ = *p;
135 break;
136 }
137 p++;
138 }
139 }
140
141 if (q == edata->custom_flags)
142 FREE(&edata->custom_flags);
143 else if (q)
144 *q = '\0';
145}
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition string.c:234
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition string.c:284
char * path
Path of Email (for local Mailboxes)
Definition email.h:70
bool trash
Message is marked as trashed on disk (used by the maildir_trash option)
Definition email.h:53
Container for Accounts, Notifications.
Definition neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_parse_message()

bool maildir_parse_message ( const char * fname,
bool is_old,
struct Email * e )

Actually parse a maildir message.

Parameters
fnameMessage filename
is_oldtrue, if the email is old (read)
eEmail to populate
Return values
trueSuccess

This may also be used to fill out a fake header structure generated by lazy maildir parsing.

Definition at line 195 of file mailbox.c.

196{
197 if (!fname || !e)
198 return false;
199
200 FILE *fp = mutt_file_fopen(fname, "r");
201 if (!fp)
202 return false;
203
204 bool rc = maildir_parse_stream(fp, fname, is_old, e);
205 mutt_file_fclose(&fp);
206 return rc;
207}
#define mutt_file_fclose(FP)
Definition file.h:139
#define mutt_file_fopen(PATH, MODE)
Definition file.h:138
bool maildir_parse_stream(FILE *fp, const char *fname, bool is_old, struct Email *e)
Parse a Maildir message.
Definition mailbox.c:158
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_parse_stream()

bool maildir_parse_stream ( FILE * fp,
const char * fname,
bool is_old,
struct Email * e )

Parse a Maildir message.

Parameters
fpMessage file handle
fnameMessage filename
is_oldtrue, if the email is old (read)
eEmail
Return values
trueSuccess

Actually parse a maildir message. This may also be used to fill out a fake header structure generated by lazy maildir parsing.

Definition at line 158 of file mailbox.c.

159{
160 if (!fp || !fname || !e)
161 return false;
162
163 const long size = mutt_file_get_size_fp(fp);
164 if (size == 0)
165 return false;
166
167 e->env = mutt_rfc822_read_header(fp, e, false, false);
168
169 if (e->received == 0)
170 e->received = e->date_sent;
171
172 /* always update the length since we have fresh information available. */
173 e->body->length = size - e->body->offset;
174
175 e->index = -1;
176
177 /* maildir stores its flags in the filename, so ignore the
178 * flags in the header of the message */
179 e->old = is_old;
180 maildir_parse_flags(e, fname);
181
182 return true;
183}
struct Envelope * mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed)
Parses an RFC822 header.
Definition parse.c:1210
long mutt_file_get_size_fp(FILE *fp)
Get the size of a file.
Definition file.c:1427
void maildir_parse_flags(struct Email *e, const char *path)
Parse Maildir file flags.
Definition mailbox.c:82
LOFF_T offset
offset where the actual data begins
Definition body.h:52
LOFF_T length
length (in bytes) of attachment
Definition body.h:53
struct Envelope * env
Envelope information.
Definition email.h:68
struct Body * body
List of MIME parts.
Definition email.h:69
time_t date_sent
Time when the message was sent (UTC)
Definition email.h:60
int index
The absolute (unsorted) message number.
Definition email.h:110
time_t received
Time when the message was placed in the mailbox.
Definition email.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_path_is_empty()

int maildir_path_is_empty ( struct Buffer * path)

Is the mailbox empty.

Parameters
pathMailbox to check
Return values
1Mailbox is empty
0Mailbox contains mail
-1Error

Definition at line 57 of file path.c.

58{
59 DIR *dir = NULL;
60 struct dirent *de = NULL;
61 int rc = 1; /* assume empty until we find a message */
62 char realpath[PATH_MAX] = { 0 };
63 int iter = 0;
64
65 /* Strategy here is to look for any file not beginning with a period */
66
67 do
68 {
69 /* we do "cur" on the first iteration since it's more likely that we'll
70 * find old messages without having to scan both subdirs */
71 snprintf(realpath, sizeof(realpath), "%s/%s", buf_string(path),
72 (iter == 0) ? "cur" : "new");
74 if (!dir)
75 return -1;
76 while ((de = readdir(dir)))
77 {
78 if (*de->d_name != '.')
79 {
80 rc = 0;
81 break;
82 }
83 }
84 closedir(dir);
85 iter++;
86 } while (rc && iter < 2);
87
88 return rc;
89}
DIR * mutt_file_opendir(const char *path, enum MuttOpenDirMode mode)
Open a directory.
Definition file.c:539
@ MUTT_OPENDIR_CREATE
Create the directory if it doesn't exist.
Definition file.h:64
#define PATH_MAX
Definition mutt.h:49
+ Here is the call graph for this function:

◆ maildir_rewrite_message()

int maildir_rewrite_message ( struct Mailbox * m,
struct Email * e )

Sync a message in an Maildir folder.

Parameters
mMailbox
eEmail
Return values
0Success
-1Error

Definition at line 467 of file message.c.

468{
469 if (!m || !e)
470 return -1;
471
472 bool restore = true;
473
474 long old_body_offset = e->body->offset;
475 long old_body_length = e->body->length;
476 long old_hdr_lines = e->lines;
477
478 struct Message *src = mx_msg_open(m, e);
479 struct Message *dest = mx_msg_open_new(m, e, MUTT_MSG_NO_FLAGS);
480 if (!src || !dest)
481 {
482 mx_msg_close(m, &src);
483 mx_msg_close(m, &dest);
484 return -1;
485 }
486
487 int rc = mutt_copy_message(dest->fp, e, src, MUTT_CM_UPDATE, CH_UPDATE | CH_UPDATE_LEN, 0);
488 if (rc == 0)
489 {
490 char oldpath[PATH_MAX] = { 0 };
491 char partpath[PATH_MAX] = { 0 };
492 snprintf(oldpath, sizeof(oldpath), "%s/%s", mailbox_path(m), e->path);
493 mutt_str_copy(partpath, e->path, sizeof(partpath));
494
495 rc = maildir_commit_message(m, dest, e);
496
497 if (rc == 0)
498 {
499 unlink(oldpath);
500 restore = false;
501 }
502 }
503 mx_msg_close(m, &src);
504 mx_msg_close(m, &dest);
505
506 if ((rc == -1) && restore)
507 {
508 e->body->offset = old_body_offset;
509 e->body->length = old_body_length;
510 e->lines = old_hdr_lines;
511 }
512
514 return rc;
515}
int mutt_copy_message(FILE *fp_out, struct Email *e, struct Message *msg, CopyMessageFlags cmflags, CopyHeaderFlags chflags, int wraplen)
Copy a message from a Mailbox.
Definition copy_email.c:917
#define MUTT_CM_UPDATE
Update structs on sync.
Definition copy_email.h:42
#define CH_UPDATE
Update the status and x-status fields?
Definition copy_email.h:56
#define CH_UPDATE_LEN
Update Lines: and Content-Length:
Definition copy_email.h:66
void mutt_body_free(struct Body **ptr)
Free a Body.
Definition body.c:58
static int maildir_commit_message(struct Mailbox *m, struct Message *msg, struct Email *e)
Commit a message to a maildir folder.
Definition message.c:364
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:583
int mx_msg_close(struct Mailbox *m, struct Message **ptr)
Close a message.
Definition mx.c:1182
struct Message * mx_msg_open(struct Mailbox *m, struct Email *e)
Return a stream pointer for a message.
Definition mx.c:1136
struct Message * mx_msg_open_new(struct Mailbox *m, const struct Email *e, MsgOpenFlags flags)
Open a new message.
Definition mx.c:1041
#define MUTT_MSG_NO_FLAGS
No flags are set.
Definition mx.h:38
struct Body * parts
parts of a multipart or message/rfc822
Definition body.h:73
int lines
How many lines in the body of this message?
Definition email.h:62
A local copy of an email.
Definition message.h:34
FILE * fp
pointer to the message data
Definition message.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_sync_mailbox_message()

bool maildir_sync_mailbox_message ( struct Mailbox * m,
struct Email * e,
struct HeaderCache * hc )

Save changes to the mailbox.

Parameters
mMailbox
eEmail
hcHeader cache handle
Return values
trueSuccess
falseError

Definition at line 315 of file message.c.

316{
317 if (!e)
318 return false;
319
320 const bool c_maildir_trash = cs_subset_bool(NeoMutt->sub, "maildir_trash");
321 if (e->deleted && !c_maildir_trash)
322 {
323 char path[PATH_MAX] = { 0 };
324 snprintf(path, sizeof(path), "%s/%s", mailbox_path(m), e->path);
326 unlink(path);
327 }
328 else if (e->changed || e->attach_del ||
329 ((c_maildir_trash || e->trash) && (e->deleted != e->trash)))
330 {
331 if (maildir_sync_message(m, e) == -1)
332 return false;
333 }
334
335 if (e->changed)
337
338 return true;
339}
int maildir_hcache_store(struct HeaderCache *hc, struct Email *e)
Save an Email to the Header Cache.
Definition hcache.c:163
int maildir_hcache_delete(struct HeaderCache *hc, struct Email *e)
Delete an Email from the Header Cache.
Definition hcache.c:89
static int maildir_sync_message(struct Mailbox *m, struct Email *e)
Sync an email to a Maildir folder.
Definition message.c:220
bool attach_del
Has an attachment marked for deletion.
Definition email.h:99
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_update_mtime()

void maildir_update_mtime ( struct Mailbox * m)

Update our record of the Maildir modification time.

Parameters
mMailbox

Definition at line 722 of file mailbox.c.

723{
724 char buf[PATH_MAX] = { 0 };
725 struct stat st = { 0 };
727 if (!mdata)
728 return;
729
730 snprintf(buf, sizeof(buf), "%s/%s", mailbox_path(m), "cur");
731 if (stat(buf, &st) == 0)
733
734 snprintf(buf, sizeof(buf), "%s/%s", mailbox_path(m), "new");
735 if (stat(buf, &st) == 0)
737}
void mutt_file_get_stat_timespec(struct timespec *dest, struct stat *st, enum MuttStatType type)
Read the stat() time into a time value.
Definition file.c:1469
@ MUTT_STAT_MTIME
File/dir's mtime - last modified time.
Definition file.h:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function: