NeoMutt  2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Global Function API

Prototype for a Global Function. More...

Collaboration diagram for Global Function API:

Functions

static int op_check_stats (struct MuttWindow *win, const struct KeyEvent *event)
 Calculate message statistics for all mailboxes - Implements global_function_t -.
static int op_enter_command (struct MuttWindow *win, const struct KeyEvent *event)
 Enter a neomuttrc command - Implements global_function_t -.
static int op_forget_passphrase (struct MuttWindow *win, const struct KeyEvent *event)
 Wipe passphrases from memory - Implements global_function_t -.
static int op_redraw (struct MuttWindow *win, const struct KeyEvent *event)
 Clear and redraw the screen - Implements global_function_t -.
static int op_shell_escape (struct MuttWindow *win, const struct KeyEvent *event)
 Invoke a command in a subshell - Implements global_function_t -.
static int op_show_log_messages (struct MuttWindow *win, const struct KeyEvent *event)
 Show log (and debug) messages - Implements global_function_t -.
static int op_version (struct MuttWindow *win, const struct KeyEvent *event)
 Show the NeoMutt version number - Implements global_function_t -.
static int op_what_key (struct MuttWindow *win, const struct KeyEvent *event)
 display the keycode for a key press - Implements global_function_t -

Detailed Description

Prototype for a Global Function.

Parameters
winFocused Window
eventEvent to process
Return values
enumFunctionRetval
Precondition
win is not NULL
event is not NULL

Function Documentation

◆ op_check_stats()

int op_check_stats ( struct MuttWindow * win,
const struct KeyEvent * event )
static

Calculate message statistics for all mailboxes - Implements global_function_t -.

Definition at line 52 of file global.c.

53{
56 return FR_SUCCESS;
57}
@ FR_SUCCESS
Valid function - successfully performed.
Definition dispatcher.h:40
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition index.c:725
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
@ MUTT_MAILBOX_CHECK_STATS
Ignore mail_check_stats and calculate statistics (used by <check-stats>).
Definition mxapi.h:60
@ MUTT_MAILBOX_CHECK_POSTPONED
Make sure the number of postponed messages is updated.
Definition mxapi.h:59
Here is the call graph for this function:

◆ op_enter_command()

int op_enter_command ( struct MuttWindow * win,
const struct KeyEvent * event )
static

Enter a neomuttrc command - Implements global_function_t -.

Definition at line 62 of file global.c.

63{
65 window_redraw(NULL);
66 return FR_SUCCESS;
67}
void mutt_enter_command(struct MuttWindow *win)
Enter a neomutt command.
Definition external.c:624
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
Here is the call graph for this function:

◆ op_forget_passphrase()

int op_forget_passphrase ( struct MuttWindow * win,
const struct KeyEvent * event )
static

Wipe passphrases from memory - Implements global_function_t -.

Definition at line 72 of file global.c.

73{
75 return FR_SUCCESS;
76}
void crypt_forget_passphrase(void)
Forget a passphrase and display a message.
Definition crypt.c:89
Here is the call graph for this function:

◆ op_redraw()

int op_redraw ( struct MuttWindow * win,
const struct KeyEvent * event )
static

Clear and redraw the screen - Implements global_function_t -.

Definition at line 81 of file global.c.

82{
83 clearok(stdscr, true);
86 window_redraw(NULL);
87 return FR_SUCCESS;
88}
void mutt_resize_screen(void)
Update NeoMutt's opinion about the window size.
Definition resize.c:76
void window_invalidate_all(void)
Mark all windows as in need of repaint.
Here is the call graph for this function:

◆ op_shell_escape()

int op_shell_escape ( struct MuttWindow * win,
const struct KeyEvent * event )
static

Invoke a command in a subshell - Implements global_function_t -.

Definition at line 93 of file global.c.

94{
96 {
97 struct Mailbox *m_cur = get_current_mailbox();
98 if (m_cur)
99 {
100 m_cur->last_checked = 0; // force a check on the next mx_mbox_check() call
102 }
103 }
104 return FR_SUCCESS;
105}
bool mutt_shell_escape(void)
Invoke a command in a subshell.
Definition external.c:581
A mailbox.
Definition mailbox.h:81
time_t last_checked
Last time we checked this mailbox for new mail.
Definition mailbox.h:107
Here is the call graph for this function:

◆ op_show_log_messages()

int op_show_log_messages ( struct MuttWindow * win,
const struct KeyEvent * event )
static

Show log (and debug) messages - Implements global_function_t -.

Definition at line 110 of file global.c.

111{
112 struct Buffer *tempfile = buf_pool_get();
113 buf_mktemp(tempfile);
114
115 FILE *fp = mutt_file_fopen(buf_string(tempfile), "a+");
116 if (!fp)
117 {
118 mutt_perror("fopen");
119 buf_pool_release(&tempfile);
120 return FR_ERROR;
121 }
122
123 char buf[32] = { 0 };
124 struct LogLine *ll = NULL;
125 const struct LogLineList lll = log_queue_get();
126 STAILQ_FOREACH(ll, &lll, entries)
127 {
128 mutt_date_localtime_format(buf, sizeof(buf), "%H:%M:%S", ll->time);
129 fprintf(fp, "[%s]<%c> %s", buf, LogLevelAbbr[ll->level + 3], ll->message);
130 if (ll->level <= LL_MESSAGE)
131 fputs("\n", fp);
132 }
133
134 mutt_file_fclose(&fp);
135
136 struct PagerData pdata = { 0 };
137 struct PagerView pview = { &pdata };
138
139 pdata.fname = buf_string(tempfile);
140
141 pview.banner = "messages";
143 pview.mode = PAGER_MODE_OTHER;
144
145 mutt_do_pager(&pview, NULL);
146 buf_pool_release(&tempfile);
147
148 return FR_SUCCESS;
149}
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
@ FR_ERROR
Valid function - error occurred.
Definition dispatcher.h:39
int mutt_do_pager(struct PagerView *pview, struct Email *e)
Display some page-able text to the user (help or attachment).
Definition do_pager.c:122
#define mutt_file_fclose(FP)
Definition file.h:144
#define mutt_file_fopen(PATH, MODE)
Definition file.h:143
#define mutt_perror(...)
Definition logging2.h:95
@ LL_MESSAGE
Log informational message.
Definition logging2.h:44
size_t mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t)
Format localtime.
Definition date.c:957
struct LogLineList log_queue_get(void)
Get the Log Queue.
Definition logging.c:368
const char * LogLevelAbbr
Abbreviations of logging level names.
Definition logging.c:47
#define MUTT_PAGER_LOGS
Logview mode.
Definition lib.h:75
#define MUTT_PAGER_BOTTOM
Start at the bottom.
Definition lib.h:76
@ PAGER_MODE_OTHER
Pager is invoked via 3rd path. Non-email content is likely to be shown.
Definition lib.h:143
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:91
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
#define STAILQ_FOREACH(var, head, field)
Definition queue.h:390
String manipulation buffer.
Definition buffer.h:36
A Log line.
Definition logging2.h:80
char * message
Message to be logged.
Definition logging2.h:86
enum LogLevel level
Log level, e.g. LL_DEBUG1.
Definition logging2.h:85
time_t time
Timestamp of the message.
Definition logging2.h:81
Data to be displayed by PagerView.
Definition lib.h:162
const char * fname
Name of the file to read.
Definition lib.h:166
Paged view into some data.
Definition lib.h:173
struct PagerData * pdata
Data that pager displays. NOTNULL.
Definition lib.h:174
enum PagerMode mode
Pager mode.
Definition lib.h:175
PagerFlags flags
Additional settings to tweak pager's function.
Definition lib.h:176
const char * banner
Title to display in status bar.
Definition lib.h:177
#define buf_mktemp(buf)
Definition tmp.h:33
Here is the call graph for this function:

◆ op_version()

int op_version ( struct MuttWindow * win,
const struct KeyEvent * event )
static

Show the NeoMutt version number - Implements global_function_t -.

Definition at line 154 of file global.c.

155{
156 mutt_message("NeoMutt %s", mutt_make_version());
157 return FR_SUCCESS;
158}
#define mutt_message(...)
Definition logging2.h:93
const char * mutt_make_version(void)
Generate the NeoMutt version string.
Definition version.c:293
Here is the call graph for this function:

◆ op_what_key()

int op_what_key ( struct MuttWindow * win,
const struct KeyEvent * event )
static

display the keycode for a key press - Implements global_function_t -

Definition at line 163 of file global.c.

164{
165 mw_what_key();
166 return FR_SUCCESS;
167}
void mw_what_key(void)
Display the value of a key -.
Definition curs_lib.c:508
Here is the call graph for this function: