NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
status.c File Reference

GUI display a user-configurable status line. More...

#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "status.h"
#include "index/lib.h"
#include "menu/lib.h"
#include "context.h"
#include "format_flags.h"
#include "mutt_globals.h"
#include "mutt_mailbox.h"
#include "mutt_thread.h"
#include "muttlib.h"
#include "options.h"
#include "protos.h"
+ Include dependency graph for status.c:

Go to the source code of this file.

Data Structures

struct  MenuStatusLineData
 Data for creating a Menu line. More...
 

Functions

static char * get_sort_str (char *buf, size_t buflen, enum SortType method)
 Get the sort method as a string. More...
 
static const char * status_format_str (char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
 Create the status bar string - Implements format_t -
Expando Description
%b Number of incoming folders with unread messages
%D Description of the mailbox
%d Number of deleted messages
%f Full mailbox path
%F Number of flagged messages
%h Hostname
%l Length of mailbox (in bytes)
%L Size (in bytes) of the messages shown (or limited)
%M Number of messages shown (virtual message count when limiting)
%m Total number of messages
%n Number of new messages
%o Number of old unread messages
%p Number of postponed messages
%P Percent of way through index
%R Number of read messages
%r Readonly/wontwrite/changed flag
%S Current aux sorting method ($sort_aux)
%s Current sorting method ($sort)
%T Current threading view ($use_threads)
%t Number of tagged messages
%u Number of unread messages
%V Currently active limit pattern
%v NeoMutt version
More...
 
void menu_status_line (char *buf, size_t buflen, struct IndexSharedData *shared, struct Menu *menu, int cols, const char *fmt)
 Create the status line. More...
 

Detailed Description

GUI display a user-configurable status line.

Authors
  • Michael R. Elkins

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

Function Documentation

◆ get_sort_str()

static char* get_sort_str ( char *  buf,
size_t  buflen,
enum SortType  method 
)
static

Get the sort method as a string.

Parameters
bufBuffer for the sort string
buflenLength of the buffer
methodSort method, see SortType
Return values
ptrBuffer pointer

Definition at line 56 of file status.c.

57 {
58  snprintf(buf, buflen, "%s%s%s", (method & SORT_REVERSE) ? "reverse-" : "",
59  (method & SORT_LAST) ? "last-" : "",
61  return buf;
62 }
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Definition: mapping.c:42
const struct Mapping SortMethods[]
Sort methods for &#39;$sort&#39; for the index.
Definition: mutt_config.c:77
#define SORT_REVERSE
Reverse the order of the sort.
Definition: sort2.h:79
#define SORT_LAST
Sort thread by last-X, e.g. received date.
Definition: sort2.h:80
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:78
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_status_line()

void menu_status_line ( char *  buf,
size_t  buflen,
struct IndexSharedData shared,
struct Menu menu,
int  cols,
const char *  fmt 
)

Create the status line.

Parameters
[out]bufBuffer in which to save string
[in]buflenBuffer length
[in]sharedShared Index data
[in]menuCurrent menu
[in]colsMaximum number of columns to use
[in]fmtFormat string

Definition at line 445 of file status.c.

447 {
448  struct MenuStatusLineData data = { shared, menu };
449 
450  mutt_expando_format(buf, buflen, 0, cols, fmt, status_format_str,
451  (intptr_t) &data, MUTT_FORMAT_NO_FLAGS);
452 }
static const char * status_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
Create the status bar string - Implements format_t -Expando Description %b Number of incoming folder...
Definition: status.c:102
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string -.
Definition: muttlib.c:780
#define MUTT_FORMAT_NO_FLAGS
No flags are set.
Definition: format_flags.h:30
Data for creating a Menu line.
Definition: status.c:67
struct IndexSharedData * shared
Data shared between Index, Pager and Sidebar.
Definition: status.c:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function: