Assorted sorting methods. More...
#include "config.h"
#include <stdbool.h>
#include <stdlib.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "alias/lib.h"
#include "sort.h"
#include "nntp/lib.h"
#include "globals.h"
#include "mutt_logging.h"
#include "mutt_thread.h"
#include "mview.h"
#include "mx.h"
#include "score.h"
Go to the source code of this file.
Data Structures | |
struct | EmailCompare |
Context for compare_email_shim() More... | |
Functions | |
static int | compare_email_shim (const void *a, const void *b, void *sdata) |
Helper to sort emails - Implements sort_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_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_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 -. | |
const char * | mutt_get_name (const struct Address *a) |
Pick the best name to display from an address. | |
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 -. | |
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_date_received (const struct Email *a, const struct Email *b, bool reverse) |
Compare the date received 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_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_label (const struct Email *a, const struct Email *b, bool reverse) |
Compare the labels of two emails - Implements sort_mail_t -. | |
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 -. | |
void | mutt_sort_headers (struct MailboxView *mv, bool init) |
Sort emails by their headers. | |
void | mutt_sort_order (struct Mailbox *m) |
Sort emails by their disk order. | |
Assorted sorting methods.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file sort.c.
const char * mutt_get_name | ( | const struct Address * | a | ) |
Pick the best name to display from an address.
a | Address to use |
ptr | Display name |
This function uses:
Definition at line 134 of file sort.c.
|
static |
Get the sort function for a given sort id.
ptr | sort function - Implements sort_mail_t |
Definition at line 279 of file sort.c.
void mutt_sort_headers | ( | struct MailboxView * | mv, |
bool | init | ||
) |
Sort emails by their headers.
mv | Mailbox View |
init | If true, rebuild the thread |
Definition at line 350 of file sort.c.
void mutt_sort_order | ( | struct Mailbox * | m | ) |
Sort emails by their disk order.
m | Mailbox |
Definition at line 444 of file sort.c.