NeoMutt  2022-04-29-323-g5fcc6c
Teaching an old dog new tricks
DOXYGEN
sort.c File Reference

Browser sorting. More...

#include "config.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "lib.h"
#include "muttlib.h"
#include "options.h"
+ Include dependency graph for sort.c:

Go to the source code of this file.

Functions

static int browser_compare_subject (const void *a, const void *b)
 Compare the subject of two browser entries - Implements sort_t -. More...
 
static int browser_compare_order (const void *a, const void *b)
 Compare the order of creation of two browser entries - Implements sort_t -. More...
 
static int browser_compare_desc (const void *a, const void *b)
 Compare the descriptions of two browser entries - Implements sort_t -. More...
 
static int browser_compare_date (const void *a, const void *b)
 Compare the date of two browser entries - Implements sort_t -. More...
 
static int browser_compare_size (const void *a, const void *b)
 Compare the size of two browser entries - Implements sort_t -. More...
 
static int browser_compare_count (const void *a, const void *b)
 Compare the message count of two browser entries - Implements sort_t -. More...
 
static int browser_compare_count_new (const void *a, const void *b)
 Compare the new count of two browser entries - Implements sort_t -. More...
 
static int browser_compare (const void *a, const void *b)
 Sort the items in the browser - Implements sort_t -. More...
 
void browser_sort (struct BrowserState *state)
 Sort the entries in the browser. More...
 

Detailed Description

Browser sorting.

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 sort.c.

Function Documentation

◆ browser_sort()

void browser_sort ( struct BrowserState state)

Sort the entries in the browser.

Parameters
stateBrowser state

Call to qsort using browser_compare function. Some specific sort methods are not used via NNTP.

Definition at line 194 of file sort.c.

195{
196 const short c_sort_browser = cs_subset_sort(NeoMutt->sub, "sort_browser");
197 switch (c_sort_browser & SORT_MASK)
198 {
199#ifdef USE_NNTP
200 case SORT_SIZE:
201 case SORT_DATE:
202 if (OptNews)
203 return;
204#endif
205 default:
206 break;
207 }
208
210}
#define ARRAY_SORT(head, fn)
Sort an array.
Definition: array.h:277
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Definition: helpers.c:292
static int browser_compare(const void *a, const void *b)
Sort the items in the browser - Implements sort_t -.
Definition: sort.c:156
bool OptNews
(pseudo) used to change reader mode
Definition: options.h:50
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:78
@ SORT_SIZE
Sort by the size of the email.
Definition: sort2.h:44
@ SORT_DATE
Sort by the date the email was sent.
Definition: sort2.h:43
struct BrowserStateEntry entry
Array of files / dirs / mailboxes.
Definition: lib.h:112
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function: