Assorted sorting methods. More...
Go to the source code of this file.
Macros | |
#define | mutt_numeric_cmp(a, b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0)) |
Typedefs | |
typedef int(* | sort_t) (const void *a, const void *b) |
typedef int(* | sort_mail_t) (const struct Email *a, const struct Email *b, bool reverse) |
Functions | |
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. More... | |
void | mutt_sort_headers (struct Mailbox *m, struct ThreadsContext *threads, bool init, off_t *vsize) |
Sort emails by their headers. More... | |
const char * | mutt_get_name (const struct Address *a) |
Pick the best name to display from an address. More... | |
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.h.
#define mutt_numeric_cmp | ( | a, | |
b | |||
) | ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0)) |
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.
a | First email |
b | Second email |
type | Mailbox type |
sort | Primary sort to use (generally $sort) |
sort_aux | Secondary sort (generally $sort_aux or SORT_ORDER) |
<0 | a precedes b |
0 | a and b are identical (should not happen in practice) |
>0 | b precedes a |
Definition at line 328 of file sort.c.
void mutt_sort_headers | ( | struct Mailbox * | m, |
struct ThreadsContext * | threads, | ||
bool | init, | ||
off_t * | vsize | ||
) |
Sort emails by their headers.
m | Mailbox | |
threads | Threads context | |
init | If true, rebuild the thread | |
[out] | vsize | Size in bytes of the messages in view |
Definition at line 356 of 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 136 of file sort.c.