NeoMutt  2022-04-29-249-gaae397
Teaching an old dog new tricks
DOXYGEN
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 -. More...
 
static int op_enter_command (int op)
 Enter a neomuttrc command - Implements global_function_t -. More...
 
static int op_redraw (int op)
 Clear and redraw the screen - Implements global_function_t -. More...
 
static int op_shell_escape (int op)
 Invoke a command in a subshell - Implements global_function_t -. More...
 
static int op_show_log_messages (int op)
 Show log (and debug) messages - Implements global_function_t -. More...
 
static int op_version (int op)
 Show the NeoMutt version number - Implements global_function_t -. More...
 
static int op_what_key (int op)
 display the keycode for a key press - Implements global_function_t - More...
 

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 49 of file global.c.

50{
53 return FR_SUCCESS;
54}
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition: index.c:618
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
Definition: mutt_mailbox.c:156
#define MUTT_MAILBOX_CHECK_FORCE_STATS
Ignore MailboxType and calculate statistics.
Definition: mxapi.h:76
#define MUTT_MAILBOX_CHECK_FORCE
Ignore MailboxTime and check for new mail.
Definition: mxapi.h:75
+ 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 59 of file global.c.

60{
62 window_redraw(NULL);
63 return FR_SUCCESS;
64}
void mutt_enter_command(void)
Enter a neomutt command.
Definition: commands.c:641
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
Definition: mutt_window.c:604
+ 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 69 of file global.c.

70{
71 clearok(stdscr, true);
74 window_redraw(NULL);
75 return FR_SUCCESS;
76}
void mutt_resize_screen(void)
Update NeoMutt's opinion about the window size (CURSES)
Definition: resize.c:73
void window_invalidate_all(void)
Mark all windows as in need of repaint.
Definition: mutt_window.c:742
+ 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 81 of file global.c.

82{
84 {
85 struct Mailbox *m_cur = get_current_mailbox();
87 }
88 return FR_SUCCESS;
89}
bool mutt_shell_escape(void)
Invoke a command in a subshell.
Definition: commands.c:599
A mailbox.
Definition: mailbox.h:79
+ 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 94 of file global.c.

95{
96 char tempfile[PATH_MAX] = { 0 };
97 mutt_mktemp(tempfile, sizeof(tempfile));
98
99 FILE *fp = mutt_file_fopen(tempfile, "a+");
100 if (!fp)
101 {
102 mutt_perror("fopen");
103 return FR_ERROR;
104 }
105
106 log_queue_save(fp);
107 mutt_file_fclose(&fp);
108
109 struct PagerData pdata = { 0 };
110 struct PagerView pview = { &pdata };
111
112 pdata.fname = tempfile;
113
114 pview.banner = "messages";
116 pview.mode = PAGER_MODE_OTHER;
117
118 mutt_do_pager(&pview, NULL);
119
120 return FR_SUCCESS;
121}
@ 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:123
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
Definition: file.c:618
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
Definition: file.c:152
#define mutt_perror(...)
Definition: logging.h:88
int log_queue_save(FILE *fp)
Save the contents of the queue to a temporary file.
Definition: logging.c:367
#define PATH_MAX
Definition: mutt.h:40
#define mutt_mktemp(buf, buflen)
Definition: muttlib.h:71
#define MUTT_PAGER_LOGS
Logview mode.
Definition: lib.h:72
#define MUTT_PAGER_BOTTOM
Start at the bottom.
Definition: lib.h:73
@ PAGER_MODE_OTHER
Pager is invoked via 3rd path. Non-email content is likely to be shown.
Definition: lib.h:139
Data to be displayed by PagerView.
Definition: lib.h:158
const char * fname
Name of the file to read.
Definition: lib.h:162
Paged view into some data.
Definition: lib.h:169
struct PagerData * pdata
Data that pager displays. NOTNULL.
Definition: lib.h:170
enum PagerMode mode
Pager mode.
Definition: lib.h:171
PagerFlags flags
Additional settings to tweak pager's function.
Definition: lib.h:172
const char * banner
Title to display in status bar.
Definition: lib.h:173
+ 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 126 of file global.c.

127{
129 return FR_SUCCESS;
130}
#define mutt_message(...)
Definition: logging.h:86
const char * mutt_make_version(void)
Generate the NeoMutt version string.
Definition: muttlib.c:1470
+ 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 135 of file global.c.

136{
138 return FR_SUCCESS;
139}
void mutt_what_key(void)
Ask the user to press a key.
Definition: keymap.c:1638
+ Here is the call graph for this function: