Maildir shared functions. More...
#include <stdbool.h>
#include <stdio.h>
#include <sys/types.h>
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 Email * | maildir_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. | |
Maildir shared functions.
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.
void maildir_canon_filename | ( | struct Buffer * | dest, |
const char * | src | ||
) |
Generate the canonical filename for a Maildir folder.
:
may be replaced as the field delimiter by a user defined alternative. Definition at line 73 of file shared.c.
mode_t maildir_umask | ( | struct Mailbox * | m | ) |
Create a umask from the mailbox directory.
m | Mailbox |
num | Umask |
Definition at line 47 of file shared.c.
Update the mailbox flags.
true | The flags changed |
false | Otherwise |
Definition at line 105 of file shared.c.
struct Email * maildir_email_new | ( | void | ) |
Create a Maildir Email.
ptr | Newly created Email |
Create a new Email and attach MaildirEmailData.
Definition at line 68 of file mailbox.c.
void maildir_gen_flags | ( | char * | dest, |
size_t | destlen, | ||
struct Email * | e | ||
) |
Generate the Maildir flags for an email.
Definition at line 73 of file message.c.
FILE * maildir_open_find_message | ( | const char * | folder, |
const char * | msg, | ||
char ** | newname | ||
) |
Find a message by name.
[in] | folder | Maildir path |
[in] | msg | Email path |
[out] | newname | New name, if it has moved |
ptr | File handle |
Definition at line 170 of file message.c.
void maildir_parse_flags | ( | struct Email * | e, |
const char * | path | ||
) |
Parse Maildir file flags.
e | |
path | Path to email file |
Definition at line 82 of file mailbox.c.
bool maildir_parse_message | ( | const char * | fname, |
bool | is_old, | ||
struct Email * | e | ||
) |
Actually parse a maildir message.
true | Success |
This may also be used to fill out a fake header structure generated by lazy maildir parsing.
Definition at line 190 of file mailbox.c.
bool maildir_parse_stream | ( | FILE * | fp, |
const char * | fname, | ||
bool | is_old, | ||
struct Email * | e | ||
) |
Parse a Maildir message.
fp | Message file handle |
fname | Message filename |
is_old | true, if the email is old (read) |
e |
true | Success |
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 153 of file mailbox.c.
int maildir_path_is_empty | ( | struct Buffer * | path | ) |
Is the mailbox empty.
path | Mailbox to check |
Definition at line 57 of file path.c.
Sync a message in an Maildir folder.
0 | Success |
-1 | Error |
Definition at line 454 of file message.c.
bool maildir_sync_mailbox_message | ( | struct Mailbox * | m, |
struct Email * | e, | ||
struct HeaderCache * | hc | ||
) |
Save changes to the mailbox.
true | Success |
false | Error |
Definition at line 312 of file message.c.
void maildir_update_mtime | ( | struct Mailbox * | m | ) |
Update our record of the Maildir modification time.
m | Mailbox |
Definition at line 716 of file mailbox.c.