56 snprintf(buf, buflen,
"%s%s%s", (method &
SORT_REVERSE) ?
"reverse-" :
"",
101 char op,
const char *src,
const char *prec,
102 const char *if_str,
const char *else_str,
105 char fmt[128], tmp[128];
121 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
122 snprintf(buf, buflen, fmt, num);
136 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
137 snprintf(buf, buflen, fmt, num);
151 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
152 snprintf(buf, buflen, fmt, tmp);
179 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
180 snprintf(buf, buflen, fmt, tmp);
187 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
188 snprintf(buf, buflen, fmt, num);
198 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
204 const off_t num = m ? m->
size : 0;
207 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
209 snprintf(buf, buflen, fmt, tmp);
221 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
223 snprintf(buf, buflen, fmt, tmp);
236 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
237 snprintf(buf, buflen, fmt, num);
249 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
250 snprintf(buf, buflen, fmt, m ? m->
vcount : 0);
260 const int num = m ? m->
msg_new : 0;
263 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
264 snprintf(buf, buflen, fmt, num);
278 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
279 snprintf(buf, buflen, fmt, num);
293 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
294 snprintf(buf, buflen, fmt, count);
322 snprintf(tmp,
sizeof(tmp),
_(
"%d%%"), count);
325 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
326 snprintf(buf, buflen, fmt, cp);
346 if (!c_status_chars || !c_status_chars->
len)
348 else if (i >= c_status_chars->
len)
349 snprintf(buf, buflen,
"%s", c_status_chars->
chars[0]);
351 snprintf(buf, buflen,
"%s", c_status_chars->
chars[i]);
360 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
361 snprintf(buf, buflen, fmt, read);
372 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
374 snprintf(buf, buflen, fmt,
get_sort_str(tmp,
sizeof(tmp), c_sort));
380 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
382 snprintf(buf, buflen, fmt,
get_sort_str(tmp,
sizeof(tmp), c_sort_aux));
391 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
392 snprintf(buf, buflen, fmt, num);
406 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
409 else if (c_use_threads ==
UT_FLAT)
419 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
420 snprintf(buf, buflen, fmt, m ? m->
msg_unread : 0);
435 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
449 snprintf(buf, buflen,
"%%%s%c", prec, op);
480 struct Menu *menu,
int cols,
const char *fmt)
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
void mutt_pretty_mailbox(char *buf, size_t buflen)
Shorten a mailbox path using '~' or '='.
struct MbTable * cs_subset_mbtable(const struct ConfigSubset *sub, const char *name)
Get a Multibyte table config item by name.
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
char * ShortHostname
Short version of the hostname.
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 -.
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 -.
GUI manage the main index (list of emails)
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
@ MUTT_IMAP
'IMAP' Mailbox type
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Convenience wrapper for the library headers.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
Mailbox helper functions.
const char * get_use_threads_str(enum UseThreads value)
Convert UseThreads enum to string.
enum UseThreads mutt_thread_style(void)
Which threading style is active?
Create/manipulate threading in emails.
UseThreads
Which threading style is active, $use_threads.
const char * mutt_make_version(void)
Generate the NeoMutt version string.
void mutt_str_pretty_size(char *buf, size_t buflen, size_t num)
Display an abbreviated size, like 3.4K.
Some miscellaneous functions.
bool mview_has_limit(const struct MailboxView *mv)
Is a limit active?
#define MUTT_MAILBOX_CHECK_NO_FLAGS
No flags are set.
int mutt_num_postponed(struct Mailbox *m, bool force)
Return the number of postponed messages.
const struct Mapping SortMethods[]
Sort methods for '$sort' for the index.
#define SORT_MASK
Mask for the sort id.
#define SORT_LAST
Sort thread by last-X, e.g. received date.
SortType
Methods for sorting.
#define SORT_REVERSE
Reverse the order of the sort.
void menu_status_line(char *buf, size_t buflen, struct IndexSharedData *shared, struct Menu *menu, int cols, const char *fmt)
Create the status line.
static char * get_sort_str(char *buf, size_t buflen, enum SortType method)
Get the sort method as a string.
GUI display a user-configurable status line.
Data shared between Index, Pager and Sidebar.
struct Mailbox * mailbox
Current Mailbox.
bool attach_msg
Are we in "attach message" mode?
struct MailboxView * mailbox_view
Current Mailbox view.
off_t vsize
Size (in bytes) of the messages shown.
char * pattern
Limit pattern string.
int vcount
The number of virtual messages.
bool changed
Mailbox has been modified.
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
int msg_new
Number of new messages.
int msg_count
Total number of messages.
enum MailboxType type
Mailbox type.
char * name
A short name for the Mailbox.
struct Buffer pathbuf
Path of the Mailbox.
int msg_deleted
Number of deleted messages.
bool dontwrite
Don't write the mailbox on close.
off_t size
Size of the Mailbox.
int msg_flagged
Number of flagged messages.
void * compress_info
Compressed mbox module private data.
bool readonly
Don't allow changes to the mailbox.
int msg_tagged
How many messages are tagged?
int msg_unread
Number of unread messages.
Multibyte character table.
int len
Number of characters.
char ** chars
The array of multibyte character strings.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.