NeoMutt  2019-12-07-168-gc45f47
Teaching an old dog new tricks
DOXYGEN
sort2.h File Reference

Type representing a sort option. More...

#include "mutt/lib.h"
+ Include dependency graph for sort2.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DT_SORT_INDEX   0x000
 Sort id for SortMethods. More...
 
#define DT_SORT_ALIAS   0x040
 Sort id for SortAliasMethods. More...
 
#define DT_SORT_BROWSER   0x080
 Sort id for SortBrowserMethods. More...
 
#define DT_SORT_KEYS   0x100
 Sort id for SortKeyMethods. More...
 
#define DT_SORT_AUX   0x200
 Sort id for SortAliasMethods. More...
 
#define DT_SORT_SIDEBAR   0x400
 Sort id for SortSidebarMethods. More...
 
#define SORT_MASK   ((1 << 8) - 1)
 Mask for the sort id. More...
 
#define SORT_REVERSE   (1 << 8)
 Reverse the order of the sort. More...
 
#define SORT_LAST   (1 << 9)
 Sort thread by last-X, e.g. received date. More...
 

Enumerations

enum  SortType {
  SORT_DATE = 1, SORT_SIZE = 2, SORT_ALPHA = 3, SORT_SUBJECT = 3,
  SORT_FROM = 4, SORT_ORDER = 5, SORT_THREADS = 6, SORT_RECEIVED = 7,
  SORT_TO = 8, SORT_SCORE = 9, SORT_ALIAS = 10, SORT_ADDRESS = 11,
  SORT_KEYID = 12, SORT_TRUST = 13, SORT_SPAM = 14, SORT_COUNT = 15,
  SORT_UNREAD = 16, SORT_FLAGGED = 17, SORT_PATH = 18, SORT_LABEL = 19,
  SORT_DESC = 20, SORT_MAX
}
 Methods for sorting. More...
 

Functions

void sort_init (struct ConfigSet *cs)
 Register the Sort config type. More...
 

Variables

const struct Mapping SortAliasMethods []
 Sort methods for email aliases. More...
 
const struct Mapping SortAuxMethods []
 Sort methods for '$sort_aux' for the index. More...
 
const struct Mapping SortBrowserMethods []
 Sort methods for the folder/dir browser. More...
 
const struct Mapping SortKeyMethods []
 Sort methods for encryption keys. More...
 
const struct Mapping SortMethods []
 Sort methods for '$sort' for the index. More...
 
const struct Mapping SortSidebarMethods []
 Sort methods for the sidebar. More...
 

Detailed Description

Type representing a sort option.

Authors
  • Richard Russon

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 sort2.h.

Macro Definition Documentation

◆ DT_SORT_INDEX

#define DT_SORT_INDEX   0x000

Sort id for SortMethods.

Definition at line 38 of file sort2.h.

◆ DT_SORT_ALIAS

#define DT_SORT_ALIAS   0x040

Sort id for SortAliasMethods.

Definition at line 39 of file sort2.h.

◆ DT_SORT_BROWSER

#define DT_SORT_BROWSER   0x080

Sort id for SortBrowserMethods.

Definition at line 40 of file sort2.h.

◆ DT_SORT_KEYS

#define DT_SORT_KEYS   0x100

Sort id for SortKeyMethods.

Definition at line 41 of file sort2.h.

◆ DT_SORT_AUX

#define DT_SORT_AUX   0x200

Sort id for SortAliasMethods.

Definition at line 42 of file sort2.h.

◆ DT_SORT_SIDEBAR

#define DT_SORT_SIDEBAR   0x400

Sort id for SortSidebarMethods.

Definition at line 43 of file sort2.h.

◆ SORT_MASK

#define SORT_MASK   ((1 << 8) - 1)

Mask for the sort id.

Definition at line 85 of file sort2.h.

◆ SORT_REVERSE

#define SORT_REVERSE   (1 << 8)

Reverse the order of the sort.

Definition at line 86 of file sort2.h.

◆ SORT_LAST

#define SORT_LAST   (1 << 9)

Sort thread by last-X, e.g. received date.

Definition at line 87 of file sort2.h.

Enumeration Type Documentation

◆ SortType

enum SortType

Methods for sorting.

Enumerator
SORT_DATE 

Sort by the date the email was sent.

SORT_SIZE 

Sort by the size of the email.

SORT_ALPHA 

Required by makedoc.c.

SORT_SUBJECT 

Sort by the email's subject.

SORT_FROM 

Sort by the email's From field.

SORT_ORDER 

Sort by the order the messages appear in the mailbox.

SORT_THREADS 

Sort by email threads.

SORT_RECEIVED 

Sort by when the message were delivered locally.

SORT_TO 

Sort by the email's To field.

SORT_SCORE 

Sort by the email's score.

SORT_ALIAS 

Sort by email alias.

SORT_ADDRESS 

Sort by email address.

SORT_KEYID 

Sort by the encryption key's ID.

SORT_TRUST 

Sort by encryption key's trust level.

SORT_SPAM 

Sort by the email's spam score.

SORT_COUNT 

Sort by number of emails in a folder.

SORT_UNREAD 

Sort by the number of unread emails.

SORT_FLAGGED 

Sort by the number of flagged emails.

SORT_PATH 

Sort by the folder's path.

SORT_LABEL 

Sort by the emails label.

SORT_DESC 

Sort by the folder's description.

SORT_MAX 

Definition at line 48 of file sort2.h.

49 {
50  SORT_DATE = 1,
51  SORT_SIZE = 2,
52  SORT_ALPHA = 3,
53  SORT_SUBJECT = 3,
54  SORT_FROM = 4,
55  SORT_ORDER = 5,
56  SORT_THREADS = 6,
57  SORT_RECEIVED = 7,
58  SORT_TO = 8,
59  SORT_SCORE = 9,
60  SORT_ALIAS = 10,
61  SORT_ADDRESS = 11,
62  SORT_KEYID = 12,
63  SORT_TRUST = 13,
64  SORT_SPAM = 14,
65  SORT_COUNT = 15,
66  SORT_UNREAD = 16,
67  SORT_FLAGGED = 17,
68  SORT_PATH = 18,
69  SORT_LABEL = 19,
70  SORT_DESC = 20,
71 
72  SORT_MAX,
73 };
Sort by the number of flagged emails.
Definition: sort2.h:67
Definition: sort2.h:72
Sort by the folder&#39;s path.
Definition: sort2.h:68
Sort by the email&#39;s From field.
Definition: sort2.h:54
Sort by email address.
Definition: sort2.h:61
Sort by the email&#39;s score.
Definition: sort2.h:59
Sort by the emails label.
Definition: sort2.h:69
Sort by the size of the email.
Definition: sort2.h:51
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:55
Sort by encryption key&#39;s trust level.
Definition: sort2.h:63
Sort by email threads.
Definition: sort2.h:56
Sort by email alias.
Definition: sort2.h:60
Sort by the email&#39;s spam score.
Definition: sort2.h:64
Sort by the email&#39;s To field.
Definition: sort2.h:58
Required by makedoc.c.
Definition: sort2.h:52
Sort by the number of unread emails.
Definition: sort2.h:66
Sort by the folder&#39;s description.
Definition: sort2.h:70
Sort by the encryption key&#39;s ID.
Definition: sort2.h:62
Sort by number of emails in a folder.
Definition: sort2.h:65
Sort by when the message were delivered locally.
Definition: sort2.h:57
Sort by the date the email was sent.
Definition: sort2.h:50
Sort by the email&#39;s subject.
Definition: sort2.h:53

Function Documentation

◆ sort_init()

void sort_init ( struct ConfigSet cs)

Register the Sort config type.

Parameters
csConfig items

Definition at line 381 of file sort.c.

382 {
383  const struct ConfigSetType cst_sort = {
384  "sort",
389  sort_reset,
390  NULL,
391  };
392  cs_register_type(cs, DT_SORT, &cst_sort);
393 }
static int sort_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Set a Sort config item by int - Implements cst_native_set()
Definition: sort.c:286
Type definition for a config item.
Definition: set.h:149
#define DT_SORT
sorting methods
Definition: types.h:39
static intptr_t sort_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Get an int from a Sort config item - Implements cst_native_get()
Definition: sort.c:344
static int sort_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
Set a Sort by string - Implements cst_string_set()
Definition: sort.c:134
static int sort_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result)
Get a Sort as a string - Implements cst_string_get()
Definition: sort.c:224
static int sort_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset a Sort to its initial value - Implements cst_reset()
Definition: sort.c:356
bool cs_register_type(struct ConfigSet *cs, unsigned int type, const struct ConfigSetType *cst)
Register a type of config item.
Definition: set.c:248
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ SortAliasMethods

const struct Mapping SortAliasMethods[]

Sort methods for email aliases.

Definition at line 42 of file sort.c.

◆ SortAuxMethods

const struct Mapping SortAuxMethods[]

Sort methods for '$sort_aux' for the index.

Definition at line 52 of file sort.c.

◆ SortBrowserMethods

const struct Mapping SortBrowserMethods[]

Sort methods for the folder/dir browser.

Definition at line 71 of file sort.c.

◆ SortKeyMethods

const struct Mapping SortKeyMethods[]

Sort methods for encryption keys.

Definition at line 86 of file sort.c.

◆ SortMethods

const struct Mapping SortMethods[]

Sort methods for '$sort' for the index.

Definition at line 97 of file sort.c.

◆ SortSidebarMethods

const struct Mapping SortSidebarMethods[]

Sort methods for the sidebar.

Definition at line 116 of file sort.c.