NeoMutt  2024-11-14-151-g38259e
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
expando_status.c File Reference

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

#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include <sys/types.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "expando_status.h"
#include "expando/lib.h"
#include "menu/lib.h"
#include "postpone/lib.h"
#include "globals.h"
#include "init.h"
#include "mutt_mailbox.h"
#include "mutt_thread.h"
#include "muttlib.h"
#include "mview.h"
#include "shared_data.h"
+ Include dependency graph for expando_status.c:

Go to the source code of this file.

Functions

static void index_mailbox_path (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: pathname of the mailbox - Implements get_string_t -.
 
static char * get_sort_str (char *buf, size_t buflen, enum EmailSortType method)
 Get the sort method as a string.
 
static void global_config_sort (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Sorting mode - Implements get_string_t -.
 
static void global_config_sort_aux (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Aux sorting method - Implements get_string_t -.
 
static void global_config_use_threads (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Current threading mode - Implements get_string_t -.
 
static void global_hostname (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Local hostname - Implements get_string_t -.
 
static void global_version (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Version string - Implements get_string_t -.
 
static long index_deleted_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of deleted messages - Implements get_number_t -.
 
static void index_description (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Description of the mailbox - Implements get_string_t -.
 
static long index_flagged_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of flagged messages - Implements get_number_t -.
 
static long index_limit_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of messages - Implements get_number_t -.
 
static void index_limit_pattern (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Active limit pattern - Implements get_string_t -.
 
static void index_limit_size (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Size of the messages - Implements get_string_t -.
 
static long index_limit_size_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Size of the messages - Implements get_number_t -.
 
static void index_mailbox_size (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Size of the current mailbox - Implements get_string_t -.
 
static long index_mailbox_size_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Size of the current mailbox - Implements get_number_t -.
 
static long index_message_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of messages in the mailbox - Implements get_number_t -.
 
static long index_new_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of new messages - Implements get_number_t -.
 
static long index_old_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of old messages - Implements get_number_t -.
 
static long index_postponed_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of postponed messages - Implements get_number_t -.
 
static void index_readonly (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Modified/read-only flag - Implements get_string_t -.
 
static long index_read_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of read messages - Implements get_number_t -.
 
static long index_tagged_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of tagged messages - Implements get_number_t -.
 
static long index_unread_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of unread messages - Implements get_number_t -.
 
static long index_unread_mailboxes_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of mailboxes with new mail - Implements get_number_t -.
 
static void menu_percentage (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Percentage through index - Implements get_string_t -.
 
static long menu_percentage_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Percentage through index - Implements get_number_t -.
 

Variables

const struct ExpandoRenderCallback StatusRenderCallbacks []
 Callbacks for Status Expandos.
 

Detailed Description

GUI display a user-configurable status line.

Authors
  • Michael R. Elkins
  • Richard Russon
  • Austin Ray
  • Pietro Cerutti
  • Eric Blake
  • Dennis Schön
  • Tóth János

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

Function Documentation

◆ get_sort_str()

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

Get the sort method as a string.

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

Definition at line 65 of file expando_status.c.

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

◆ global_hostname()

static void global_hostname ( const struct ExpandoNode node,
void *  data,
MuttFormatFlags  flags,
struct Buffer buf 
)
static

Status: Local hostname - Implements get_string_t -.

Definition at line 113 of file expando_status.c.

115{
116 const char *s = ShortHostname;
117 buf_strcpy(buf, s);
118}
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:395
char * ShortHostname
Short version of the hostname.
Definition: globals.c:38
+ Here is the call graph for this function:

◆ global_version()

static void global_version ( const struct ExpandoNode node,
void *  data,
MuttFormatFlags  flags,
struct Buffer buf 
)
static

Status: Version string - Implements get_string_t -.

Definition at line 123 of file expando_status.c.

125{
126 const char *s = mutt_make_version();
127 buf_strcpy(buf, s);
128}
const char * mutt_make_version(void)
Generate the NeoMutt version string.
Definition: muttlib.c:858
+ Here is the call graph for this function:

Variable Documentation

◆ StatusRenderCallbacks

const struct ExpandoRenderCallback StatusRenderCallbacks[]
Initial value:
= {
{ -1, -1, NULL, NULL },
}
@ ED_MENU
Menu ED_MEN_ ExpandoDataMenu.
Definition: domain.h:48
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
@ ED_INDEX
Index ED_IND_ ExpandoDataIndex.
Definition: domain.h:46
static void global_hostname(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Local hostname - Implements get_string_t -.
static void global_version(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Version string - Implements get_string_t -.
static long index_deleted_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of deleted messages - Implements get_number_t -.
static long index_tagged_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of tagged messages - Implements get_number_t -.
static long index_limit_size_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Size of the messages - Implements get_number_t -.
static long index_old_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of old messages - Implements get_number_t -.
static long index_limit_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of messages - Implements get_number_t -.
static long index_new_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of new messages - Implements get_number_t -.
static long index_mailbox_size_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Size of the current mailbox - Implements get_number_t -.
static long index_postponed_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of postponed messages - Implements get_number_t -.
static long index_unread_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of unread messages - Implements get_number_t -.
static long index_unread_mailboxes_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of mailboxes with new mail - Implements get_number_t -.
static long index_flagged_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of flagged messages - Implements get_number_t -.
static long menu_percentage_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Percentage through index - Implements get_number_t -.
static long index_message_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of messages in the mailbox - Implements get_number_t -.
static long index_read_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of read messages - Implements get_number_t -.
static void global_config_sort(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Sorting mode - Implements get_string_t -.
static void global_config_sort_aux(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Aux sorting method - Implements get_string_t -.
static void index_limit_size(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Size of the messages - Implements get_string_t -.
static void index_mailbox_path(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: pathname of the mailbox - Implements get_string_t -.
static void menu_percentage(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Percentage through index - Implements get_string_t -.
static void index_description(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Description of the mailbox - Implements get_string_t -.
static void index_readonly(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Modified/read-only flag - Implements get_string_t -.
static void index_mailbox_size(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Size of the current mailbox - Implements get_string_t -.
static void index_limit_pattern(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Active limit pattern - Implements get_string_t -.
static void global_config_use_threads(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Current threading mode - Implements get_string_t -.
@ ED_IND_LIMIT_COUNT
Mailbox.vcount.
Definition: shared_data.h:59
@ ED_IND_MAILBOX_PATH
Mailbox.pathbuf, Mailbox.name.
Definition: shared_data.h:62
@ ED_IND_DELETED_COUNT
Mailbox.msg_deleted.
Definition: shared_data.h:56
@ ED_IND_NEW_COUNT
Mailbox.msg_new.
Definition: shared_data.h:65
@ ED_IND_MAILBOX_SIZE
Mailbox.size.
Definition: shared_data.h:63
@ ED_IND_LIMIT_PATTERN
MailboxView.pattern.
Definition: shared_data.h:60
@ ED_IND_READ_COUNT
Mailbox.msg_count, Mailbox.msg_unread.
Definition: shared_data.h:69
@ ED_IND_POSTPONED_COUNT
mutt_num_postponed()
Definition: shared_data.h:67
@ ED_IND_FLAGGED_COUNT
Mailbox.msg_flagged.
Definition: shared_data.h:58
@ ED_IND_MESSAGE_COUNT
Mailbox.msg_count.
Definition: shared_data.h:64
@ ED_IND_OLD_COUNT
Mailbox.msg_unread, Mailbox.msg_new.
Definition: shared_data.h:66
@ ED_IND_READONLY
Mailbox.readonly, Mailbox.dontwrite.
Definition: shared_data.h:68
@ ED_IND_UNREAD_COUNT
Mailbox.msg_unread.
Definition: shared_data.h:71
@ ED_IND_TAGGED_COUNT
Mailbox.msg_tagged.
Definition: shared_data.h:70
@ ED_IND_LIMIT_SIZE
MailboxView.vsize.
Definition: shared_data.h:61
@ ED_IND_DESCRIPTION
Mailbox.name.
Definition: shared_data.h:57
@ ED_IND_UNREAD_MAILBOXES
Mailbox, mutt_mailbox_check()
Definition: shared_data.h:72
@ ED_MEN_PERCENTAGE
Menu.top, ...
Definition: lib.h:68
@ ED_GLO_CONFIG_USE_THREADS
Value of $use_threads.
Definition: uid.h:36
@ ED_GLO_CONFIG_SORT
Value of $sort.
Definition: uid.h:34
@ ED_GLO_VERSION
NeoMutt version.
Definition: uid.h:42
@ ED_GLO_CONFIG_SORT_AUX
Value of $sort_aux.
Definition: uid.h:35
@ ED_GLO_HOSTNAME
Local hostname.
Definition: uid.h:37

Callbacks for Status Expandos.

See also
StatusFormatDef, ExpandoDataGlobal, ExpandoDataIndex, ExpandoDataMenu

Definition at line 487 of file expando_status.c.