2 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #define SORT_DATE 1 /* the date the mail was sent. */
21 #define SORT_SUBJECT 3
22 #define SORT_ALPHA 3 /* makedoc.c requires this */
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 */
30 #define SORT_ADDRESS 11
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)
40 typedef int sort_t (const void *, const void *);
41 sort_t *mutt_get_sort_func (int);
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);
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);
54 /* FIXME: This one does not belong to here */
55 WHERE short PgpSortKeys INITVAL (SORT_ADDRESS);
58 extern const struct mapping_t SortMethods[];