replace the pathetic mutt_parse_rfc822_line function with a really better
[apps/madmutt.git] / sort.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9
10 #define SORT_DATE       1       /* the date the mail was sent. */
11 #define SORT_SIZE       2
12 #define SORT_SUBJECT    3
13 #define SORT_ALPHA      3       /* makedoc.c requires this */
14 #define SORT_FROM       4
15 #define SORT_ORDER      5       /* the order the messages appear in the mailbox. */
16 #define SORT_THREADS    6
17 #define SORT_RECEIVED   7       /* when the message were delivered locally */
18 #define SORT_TO         8
19 #define SORT_SCORE      9
20 #define SORT_ALIAS      10
21 #define SORT_ADDRESS    11
22 #define SORT_KEYID      12
23 #define SORT_TRUST      13
24 #define SORT_SPAM       14
25 /* dgc: Sort & SortAux are shorts, so I'm bumping these bitflags up from
26  * bits 4 & 5 to bits 8 & 9 to make room for more sort keys in the future. */
27 #define SORT_MASK       0xff
28 #define SORT_REVERSE    (1<<8)
29 #define SORT_LAST       (1<<9)
30
31 typedef int sort_t (const void *, const void *);
32 sort_t *mutt_get_sort_func (int);
33
34 void mutt_sort_headers (CONTEXT *, int);
35 int mutt_select_sort (int);
36
37 WHERE short BrowserSort INITVAL (SORT_SUBJECT);
38 WHERE short Sort INITVAL (SORT_DATE);
39 WHERE short SortAux INITVAL (SORT_DATE);        /* auxiallary sorting method */
40 WHERE short SortAlias INITVAL (SORT_ALIAS);
41
42 /* FIXME: This one does not belong to here */
43 WHERE short PgpSortKeys INITVAL (SORT_ADDRESS);
44
45 #include <lib-lib/mapping.h>
46 extern const struct mapping_t SortMethods[];