Andreas Krennmair:
[apps/madmutt.git] / sort.h
1 /*
2  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
3  * 
4  *     This program is free software; you can redistribute it and/or modify
5  *     it under the terms of the GNU General Public License as published by
6  *     the Free Software Foundation; either version 2 of the License, or
7  *     (at your option) any later version.
8  * 
9  *     This program is distributed in the hope that it will be useful,
10  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *     GNU General Public License for more details.
13  * 
14  *     You should have received a copy of the GNU General Public License
15  *     along with this program; if not, write to the Free Software
16  *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
17  */ 
18
19 #define SORT_DATE       1   /* the date the mail was sent. */
20 #define SORT_SIZE       2
21 #define SORT_SUBJECT    3
22 #define SORT_ALPHA      3   /* makedoc.c requires this */
23 #define SORT_FROM       4
24 #define SORT_ORDER      5   /* the order the messages appear in the mailbox. */
25 #define SORT_THREADS    6
26 #define SORT_RECEIVED   7   /* when the message were delivered locally */
27 #define SORT_TO         8
28 #define SORT_SCORE      9
29 #define SORT_ALIAS      10
30 #define SORT_ADDRESS    11
31 #define SORT_KEYID      12
32 #define SORT_TRUST      13
33 #define SORT_SPAM       14
34 /* dgc: Sort & SortAux are shorts, so I'm bumping these bitflags up from
35  * bits 4 & 5 to bits 8 & 9 to make room for more sort keys in the future. */
36 #define SORT_MASK       0xff
37 #define SORT_REVERSE    (1<<8)
38 #define SORT_LAST       (1<<9)
39
40 typedef int sort_t (const void *, const void *);
41 sort_t *mutt_get_sort_func (int);
42
43 void mutt_clear_threads (CONTEXT *);
44 void mutt_sort_headers (CONTEXT *, int);
45 void mutt_sort_threads (CONTEXT *, int);
46 int mutt_select_sort (int);
47 THREAD *mutt_sort_subthreads (THREAD *, int);
48
49 WHERE short BrowserSort INITVAL (SORT_SUBJECT);
50 WHERE short Sort INITVAL (SORT_DATE);
51 WHERE short SortAux INITVAL (SORT_DATE); /* auxiallary sorting method */
52 WHERE short SortAlias INITVAL (SORT_ALIAS);
53
54 /* FIXME: This one does not belong to here */
55 WHERE short PgpSortKeys INITVAL (SORT_ADDRESS);
56
57 #include "mapping.h"
58 extern const struct mapping_t SortMethods[];