diff options
Diffstat (limited to 'include/mailutils/sys/amd.h')
-rw-r--r-- | include/mailutils/sys/amd.h | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/include/mailutils/sys/amd.h b/include/mailutils/sys/amd.h index 383e2434a..b8f821259 100644 --- a/include/mailutils/sys/amd.h +++ b/include/mailutils/sys/amd.h @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999-2019 Free Software Foundation, Inc. + Copyright (C) 1999-2024 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -43,7 +43,7 @@ } while (0); #define _MU_AMD_PROP_UIDVALIDITY "uid-validity" -#define _MU_AMD_PROP_NEXT_UID "next-uid" +#define _MU_AMD_PROP_UIDNEXT "uidnext" #define _MU_AMD_PROP_SIZE "size" #define _MU_AMD_PROP_FILE_NAME ".mu-prop" @@ -55,11 +55,12 @@ struct _amd_message mu_off_t body_start; /* Offset of body start in the message file */ mu_off_t body_end; /* Offset of body end (size of file, effectively)*/ - int orig_flags; /* Original attribute flags */ int attr_flags; /* Current attribute flags */ - time_t mtime; /* Time of last modification */ + size_t header_size; /* Number of bytes in the header part. Unless + multi-dash delimiter is used, it equals + body_start. */ size_t header_lines; /* Number of lines in the header part */ size_t body_lines; /* Number of lines in the body */ @@ -68,18 +69,31 @@ struct _amd_message }; /* AMD capabilities */ -#define MU_AMD_STATUS 0x01 /* format keeps status flags */ -#define MU_AMD_IMAPBASE 0x02 /* format keeps IMAP base */ +#define MU_AMD_STATUS 0x01 /* format keeps status flags */ +#define MU_AMD_VOLATILE_UIDNEXT 0x02 /* Reset UIDNEXT and UIDVALIDITY + when the last message is removed. This helps implement the traditional + MH behavior: sequence number for the new message is computed as that of + the last message incremented by one. Normally this behavior is enabled + by setting the 'Volatile-uidnext' parameter in mh_profile to 'true'. + See _mailbox_mh_init in libproto/mh/mh.c. +*/ +#define MU_AMD_DASHDELIM 0x04 /* A sequence of '-' may be used + to end message headers, instead of + the '\n' */ + +#define MU_AMD_F_INIT_SCAN 0x01 /* Done initial scanning */ +#define MU_AMD_F_PROP 0x02 /* prop file existed */ struct _amd_data { + int flags; /* MU_AMD_F_ bits above */ size_t msg_size; /* Size of struct _amd_message */ int (*create) (struct _amd_data *, int flags); int (*msg_init_delivery) (struct _amd_data *, struct _amd_message *); int (*msg_finish_delivery) (struct _amd_data *, struct _amd_message *, - const mu_message_t); + const mu_message_t, mu_attribute_t atr); void (*msg_free) (struct _amd_message *); - int (*cur_msg_file_name) (struct _amd_message *, char **); + int (*cur_msg_file_name) (struct _amd_message *, int, char **); int (*new_msg_file_name) (struct _amd_message *, int, int, char **); int (*scan0) (mu_mailbox_t mailbox, size_t msgno, size_t *pcount, int do_notify); @@ -87,7 +101,6 @@ struct _amd_data int (*qfetch) (struct _amd_data *, mu_message_qid_t qid); int (*msg_cmp) (struct _amd_message *, struct _amd_message *); int (*message_uid) (mu_message_t msg, size_t *puid); - size_t (*next_uid) (struct _amd_data *mhd); int (*remove) (struct _amd_data *); int (*delete_msg) (struct _amd_data *, struct _amd_message *); int (*chattr_msg) (struct _amd_message *, int); @@ -101,7 +114,7 @@ struct _amd_data int has_new_msg; /* New messages have been appended */ char *name; /* Directory name */ - mu_property_t prop; /* Properties: uidvalidity, nextuid, etc. */ + mu_property_t prop; /* Properties: uidvalidity, uidnext, etc. */ /* Pool of open message streams */ struct _amd_message *msg_pool[MAX_OPEN_STREAMS]; @@ -129,5 +142,8 @@ struct _amd_message *_amd_get_message (struct _amd_data *amd, size_t msgno); int amd_msg_lookup (struct _amd_data *amd, struct _amd_message *msg, size_t *pret); int amd_remove_dir (const char *name); +int amd_reset_uidvalidity (struct _amd_data *amd); +int amd_update_uidnext (struct _amd_data *amd, size_t *newval); +int amd_alloc_uid (struct _amd_data *amd, size_t *newval); #endif |