NeoMutt  2024-04-25-115-gb99441
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 (int op)
 Calculate message statistics for all mailboxes - Implements global_function_t -.
 
static int op_enter_command (int op)
 Enter a neomuttrc command - Implements global_function_t -.
 
static int op_redraw (int op)
 Clear and redraw the screen - Implements global_function_t -.
 
static int op_shell_escape (int op)
 Invoke a command in a subshell - Implements global_function_t -.
 
static int op_show_log_messages (int op)
 Show log (and debug) messages - Implements global_function_t -.
 
static int op_version (int op)
 Show the NeoMutt version number - Implements global_function_t -.
 
static int op_what_key (int op)
 display the keycode for a key press - Implements global_function_t -
 

Detailed Description

Prototype for a Global Function.

Parameters
opOperation to perform, e.g. OP_VERSION
Return values
enumFunctionRetval

Function Documentation

◆ op_check_stats()

static int op_check_stats ( int  op)
static

Calculate message statistics for all mailboxes - Implements global_function_t -.

Definition at line 51 of file global.c.

52{
54 return FR_SUCCESS;
55}
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition: index.c:715
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
Definition: mutt_mailbox.c:169
#define MUTT_MAILBOX_CHECK_STATS
Ignore mail_check_stats and calculate statistics (used by <check-stats>)
Definition: mxapi.h:55
#define MUTT_MAILBOX_CHECK_POSTPONED
Make sure the number of postponed messages is updated.
Definition: mxapi.h:54
+ Here is the call graph for this function:

◆ op_enter_command()

static int op_enter_command ( int  op)
static

Enter a neomuttrc command - Implements global_function_t -.

Definition at line 60 of file global.c.

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

◆ op_redraw()

static int op_redraw ( int  op)
static

Clear and redraw the screen - Implements global_function_t -.

Definition at line 70 of file global.c.

71{
72 clearok(stdscr, true);
75 window_redraw(NULL);
76 return FR_SUCCESS;
77}
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.
Definition: mutt_window.c:766
+ Here is the call graph for this function:

◆ op_shell_escape()

static int op_shell_escape ( int  op)
static

Invoke a command in a subshell - Implements global_function_t -.

Definition at line 82 of file global.c.

83{
85 {
86 struct Mailbox *m_cur = get_current_mailbox();
87 if (m_cur)
88 {
89 m_cur->last_checked = 0; // force a check on the next mx_mbox_check() call
91 }
92 }
93 return FR_SUCCESS;
94}
bool mutt_shell_escape(void)
Invoke a command in a subshell.
Definition: external.c:579
A mailbox.
Definition: mailbox.h:79
time_t last_checked
Last time we checked this mailbox for new mail.
Definition: mailbox.h:105
+ Here is the call graph for this function:

◆ op_show_log_messages()

static int op_show_log_messages ( int  op)
static

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

Definition at line 99 of file global.c.

100{
101 struct Buffer *tempfile = buf_pool_get();
102 buf_mktemp(tempfile);
103
104 FILE *fp = mutt_file_fopen(buf_string(tempfile), "a+");
105 if (!fp)
106 {
107 mutt_perror("fopen");
108 buf_pool_release(&tempfile);
109 return FR_ERROR;
110 }
111
112 log_queue_save(fp);
113 mutt_file_fclose(&fp);
114
115 struct PagerData pdata = { 0 };
116 struct PagerView pview = { &pdata };
117
118 pdata.fname = buf_string(tempfile);
119
120 pview.banner = "messages";
122 pview.mode = PAGER_MODE_OTHER;
123
124 mutt_do_pager(&pview, NULL);
125 buf_pool_release(&tempfile);
126
127 return FR_SUCCESS;
128}
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:38
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:138
#define mutt_file_fopen(PATH, MODE)
Definition: file.h:137
#define mutt_perror(...)
Definition: logging2.h:93
int log_queue_save(FILE *fp)
Save the contents of the queue to a temporary file.
Definition: logging.c:367
#define MUTT_PAGER_LOGS
Logview mode.
Definition: lib.h:74
#define MUTT_PAGER_BOTTOM
Start at the bottom.
Definition: lib.h:75
@ PAGER_MODE_OTHER
Pager is invoked via 3rd path. Non-email content is likely to be shown.
Definition: lib.h:142
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:81
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:94
String manipulation buffer.
Definition: buffer.h:36
Data to be displayed by PagerView.
Definition: lib.h:161
const char * fname
Name of the file to read.
Definition: lib.h:165
Paged view into some data.
Definition: lib.h:172
struct PagerData * pdata
Data that pager displays. NOTNULL.
Definition: lib.h:173
enum PagerMode mode
Pager mode.
Definition: lib.h:174
PagerFlags flags
Additional settings to tweak pager's function.
Definition: lib.h:175
const char * banner
Title to display in status bar.
Definition: lib.h:176
#define buf_mktemp(buf)
Definition: tmp.h:33
+ Here is the call graph for this function:

◆ op_version()

static int op_version ( int  op)
static

Show the NeoMutt version number - Implements global_function_t -.

Definition at line 133 of file global.c.

134{
136 return FR_SUCCESS;
137}
#define mutt_message(...)
Definition: logging2.h:91
const char * mutt_make_version(void)
Generate the NeoMutt version string.
Definition: muttlib.c:858
+ Here is the call graph for this function:

◆ op_what_key()

static int op_what_key ( int  op)
static

display the keycode for a key press - Implements global_function_t -

Definition at line 142 of file global.c.

143{
144 mw_what_key();
145 return FR_SUCCESS;
146}
void mw_what_key(void)
Display the value of a key -.
Definition: curs_lib.c:499
+ Here is the call graph for this function: