72 const struct Email *ea = *(
struct Email const *
const *) a;
73 const struct Email *eb = *(
struct Email const *
const *) b;
84 return reverse ? -result : result;
93 return reverse ? -result : result;
102 return reverse ? -result : result;
123 return reverse ? -rc : rc;
159 char fa[128] = { 0 };
164 return reverse ? -result : result;
172 char fa[128] = { 0 };
177 return reverse ? -result : result;
186 return reverse ? -result : result;
195 return reverse ? -result : result;
203 char *aptr = NULL, *bptr = NULL;
215 return reverse ? -1 : 1;
217 return reverse ? 1 : -1;
229 result = ((difference < 0.0) ? -1 : (difference > 0.0) ? 1 : 0);
235 result = strcmp(aptr, bptr);
236 return reverse ? -result : result;
243 result = strcmp(aptr, bptr);
244 return reverse ? -result : result;
252 int ahas, bhas, result = 0;
262 return reverse ? 1 : -1;
264 return reverse ? -1 : 1;
272 return reverse ? -result : result;
311 mutt_error(
_(
"Could not find sorting function [report this bug]"));
344 retval = func(a, b,
false);
357 bool init, off_t *vsize)
const char * mutt_addr_for_display(const struct Address *a)
Convert an Address for display purposes.
struct Address * alias_reverse_lookup(const struct Address *addr)
Does the user have an alias for the given address.
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
Structs that make up an email.
bool OptNeedRescore
(pseudo) set when the 'score' command is used
bool OptResortInit
(pseudo) used to force the next resort to be from scratch
bool OptNeedResort
(pseudo) used to force a re-sort
#define mutt_message(...)
static int compare_to(const struct Email *a, const struct Email *b, bool reverse)
Compare the 'to' fields of two emails - Implements sort_mail_t -.
int nntp_compare_order(const struct Email *a, const struct Email *b, bool reverse)
Sort to mailbox order - Implements sort_mail_t -.
static int compare_label(const struct Email *a, const struct Email *b, bool reverse)
Compare the labels of two emails - Implements sort_mail_t -.
static int compare_spam(const struct Email *a, const struct Email *b, bool reverse)
Compare the spam values of two emails - Implements sort_mail_t -.
static int compare_order(const struct Email *a, const struct Email *b, bool reverse)
Restore the 'unsorted' order of emails - Implements sort_mail_t -.
static int compare_date_sent(const struct Email *a, const struct Email *b, bool reverse)
Compare the sent date of two emails - Implements sort_mail_t -.
static int compare_subject(const struct Email *a, const struct Email *b, bool reverse)
Compare the subject of two emails - Implements sort_mail_t -.
static int compare_score(const struct Email *a, const struct Email *b, bool reverse)
Compare two emails using their scores - Implements sort_mail_t -.
static int compare_from(const struct Email *a, const struct Email *b, bool reverse)
Compare the 'from' fields of two emails - Implements sort_mail_t -.
static int compare_size(const struct Email *a, const struct Email *b, bool reverse)
Compare the size of two emails - Implements sort_mail_t -.
static int compare_date_received(const struct Email *a, const struct Email *b, bool reverse)
Compare the date received of two emails - Implements sort_mail_t -.
MailboxType
Supported mailbox formats.
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
Convenience wrapper for the library headers.
int mutt_istrn_cmp(const char *a, const char *b, size_t num)
Compare two strings ignoring case (to a maximum), safely.
int mutt_istr_cmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
void mutt_clear_threads(struct ThreadsContext *tctx)
Clear the threading of message in a mailbox.
void mutt_thread_collapse_collapsed(struct ThreadsContext *tctx)
Re-collapse threads marked as collapsed.
void mutt_sort_threads(struct ThreadsContext *tctx, bool init)
Sort email threads.
off_t mutt_set_vnum(struct Mailbox *m)
Set the virtual index number of all the messages in a mailbox.
Create/manipulate threading in emails.
#define mutt_using_threads()
enum MailboxType mx_type(struct Mailbox *m)
Return the type of the Mailbox.
Usenet network mailbox type; talk to an NNTP server.
void mutt_qsort_r(void *base, size_t nmemb, size_t size, qsort_r_compar_t compar, void *arg)
Sort an array, where the comparator has access to opaque data rather than requiring global variables.
#define TAILQ_FIRST(head)
void mutt_score_message(struct Mailbox *m, struct Email *e, bool upd_mbox)
Apply scoring to an email.
Routines for adding user scores to emails.
#define SORT_MASK
Mask for the sort id.
SortType
Methods for sorting.
@ SORT_SUBJECT
Sort by the email's subject.
@ SORT_ORDER
Sort by the order the messages appear in the mailbox.
@ SORT_SPAM
Sort by the email's spam score.
@ SORT_LABEL
Sort by the emails label.
@ SORT_FROM
Sort by the email's From field.
@ SORT_SIZE
Sort by the size of the email.
@ SORT_RECEIVED
Sort by when the message were delivered locally.
@ SORT_TO
Sort by the email's To field.
@ SORT_DATE
Sort by the date the email was sent.
@ SORT_SCORE
Sort by the email's score.
#define SORT_REVERSE
Reverse the order of the sort.
void mutt_sort_headers(struct Mailbox *m, struct ThreadsContext *threads, bool init, off_t *vsize)
Sort emails by their headers.
const char * mutt_get_name(const struct Address *a)
Pick the best name to display from an address.
static sort_mail_t get_sort_func(enum SortType method, enum MailboxType type)
Get the sort function for a given sort id.
int mutt_compare_emails(const struct Email *a, const struct Email *b, enum MailboxType type, short sort, short sort_aux)
Compare two emails using up to two sort methods.
static int compare_email_shim(const void *a, const void *b, void *arg)
qsort_r() comparator to drive mutt_compare_emails
Assorted sorting methods.
int(* sort_mail_t)(const struct Email *a, const struct Email *b, bool reverse)
#define mutt_numeric_cmp(a, b)
char * mailbox
Mailbox and host address.
char * personal
Real name of address.
LOFF_T length
length (in bytes) of attachment
char * data
Pointer to data.
Context for compare_email_shim()
short sort_aux
Secondary sort.
enum MailboxType type
Current mailbox type.
The envelope/body of an email.
bool visible
Is this message part of the view?
struct Envelope * env
Envelope information.
bool collapsed
Is this message part of a collapsed thread?
struct Body * body
List of MIME parts.
bool threaded
Used for threading.
time_t date_sent
Time when the message was sent (UTC)
int vnum
Virtual message number.
int msgno
Number displayed to the user.
int index
The absolute (unsorted) message number.
time_t received
Time when the message was placed in the mailbox.
struct AddressList to
Email's 'To' list.
struct Buffer spam
Spam header.
char * real_subj
Offset of the real subject.
struct AddressList from
Email's 'From' list.
int vcount
The number of virtual messages.
int * v2r
Mapping from virtual to real msgno.
int msg_count
Total number of messages.
struct Email ** emails
Array of Emails.
bool verbose
Display status messages?
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
The "current" threading state.