NeoMutt  2022-04-29-145-g9b6a0e
Teaching an old dog new tricks
DOXYGEN
sort.h
Go to the documentation of this file.
1 
24 #ifndef MUTT_SORT_H
25 #define MUTT_SORT_H
26 
27 #include <stdbool.h>
28 #include <sys/types.h>
29 #include "core/lib.h"
30 #include "options.h" // IWYU pragma: keep
31 
32 struct Address;
33 struct Email;
34 struct ThreadsContext;
35 
36 #define mutt_numeric_cmp(a,b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0))
37 
49 typedef int (*sort_t)(const void *a, const void *b);
50 
63 typedef int (*sort_mail_t)(const struct Email *a, const struct Email *b, bool reverse);
64 
65 int mutt_compare_emails(const struct Email *a, const struct Email *b,
66  enum MailboxType type, short sort, short sort_aux);
67 
68 void mutt_sort_headers(struct Mailbox *m, struct ThreadsContext *threads, bool init, off_t *vsize);
69 
70 const char *mutt_get_name(const struct Address *a);
71 
72 #endif /* MUTT_SORT_H */
Convenience wrapper for the core headers.
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
Handling of global boolean variables.
void mutt_sort_headers(struct Mailbox *m, struct ThreadsContext *threads, bool init, off_t *vsize)
Sort emails by their headers.
Definition: sort.c:356
int(* sort_mail_t)(const struct Email *a, const struct Email *b, bool reverse)
Definition: sort.h:63
const char * mutt_get_name(const struct Address *a)
Pick the best name to display from an address.
Definition: sort.c:136
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.
Definition: sort.c:328
int(* sort_t)(const void *a, const void *b)
Definition: sort.h:49
An email address.
Definition: address.h:36
The envelope/body of an email.
Definition: email.h:37
A mailbox.
Definition: mailbox.h:79
The "current" threading state.
Definition: mutt_thread.c:50