61 snprintf(buf, buflen,
"%s%s%s", (method &
SORT_REVERSE) ?
"reverse-" :
"",
106 char op,
const char *src,
const char *prec,
107 const char *if_str,
const char *else_str,
110 char fmt[128] = { 0 };
111 char tmp[128] = { 0 };
127 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
128 snprintf(buf, buflen, fmt, num);
142 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
143 snprintf(buf, buflen, fmt, num);
157 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
158 snprintf(buf, buflen, fmt, tmp);
183 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
184 snprintf(buf, buflen, fmt, tmp);
191 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
192 snprintf(buf, buflen, fmt, num);
202 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
208 const off_t num = m ? m->
size : 0;
211 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
213 snprintf(buf, buflen, fmt, tmp);
225 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
227 snprintf(buf, buflen, fmt, tmp);
240 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
241 snprintf(buf, buflen, fmt, num);
253 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
254 snprintf(buf, buflen, fmt, m ? m->
vcount : 0);
264 const int num = m ? m->
msg_new : 0;
267 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
268 snprintf(buf, buflen, fmt, num);
282 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
283 snprintf(buf, buflen, fmt, num);
297 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
298 snprintf(buf, buflen, fmt, count);
326 snprintf(tmp,
sizeof(tmp),
_(
"%d%%"), count);
329 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
330 snprintf(buf, buflen, fmt, cp);
350 if (!c_status_chars || !c_status_chars->
len)
352 else if (i >= c_status_chars->
len)
353 snprintf(buf, buflen,
"%s", c_status_chars->
chars[0]);
355 snprintf(buf, buflen,
"%s", c_status_chars->
chars[i]);
364 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
365 snprintf(buf, buflen, fmt, read);
376 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
378 snprintf(buf, buflen, fmt,
get_sort_str(tmp,
sizeof(tmp), c_sort));
384 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
386 snprintf(buf, buflen, fmt,
get_sort_str(tmp,
sizeof(tmp), c_sort_aux));
395 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
396 snprintf(buf, buflen, fmt, num);
410 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
413 else if (c_use_threads ==
UT_FLAT)
423 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
424 snprintf(buf, buflen, fmt, m ? m->
msg_unread : 0);
439 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
453 snprintf(buf, buflen,
"%%%s%c", prec, op);
483 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.
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
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)
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.
static char * get_sort_str(char *buf, size_t buflen, enum SortType method)
Get the sort method as a string.
void menu_status_line(struct Buffer *buf, struct IndexSharedData *shared, struct Menu *menu, int cols, const char *fmt)
Create the status line.
GUI display a user-configurable status line.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
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.