NeoMutt  2025-09-05-55-g97fc89
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
dlg_verifycert.c File Reference

Certificate Verification Dialog. More...

#include "config.h"
#include <stdbool.h>
#include <string.h>
#include "mutt/lib.h"
#include "gui/lib.h"
#include "color/lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "ssl.h"
+ Include dependency graph for dlg_verifycert.c:

Go to the source code of this file.

Functions

static int menu_dialog_dokey (struct Menu *menu, int *id)
 Check if there are any menu key events to process.
 
static int menu_dialog_translate_op (int op)
 Convert menubar movement to scrolling.
 
static int cert_make_entry (struct Menu *menu, int line, int max_cols, struct Buffer *buf)
 Create a Certificate for the Menu - Implements Menu::make_entry() -.
 
int dlg_certificate (const char *title, struct StringArray *carr, bool allow_always, bool allow_skip)
 Ask the user to validate the certificate -.
 

Variables

static const struct Mapping VerifyHelp []
 Help Bar for the Certificate Verification dialog.
 

Detailed Description

Certificate Verification Dialog.

Authors
  • Richard Russon
  • Pietro Cerutti

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file dlg_verifycert.c.

Function Documentation

◆ menu_dialog_dokey()

static int menu_dialog_dokey ( struct Menu * menu,
int * id )
static

Check if there are any menu key events to process.

Parameters
menuCurrent Menu
idKeyEvent ID
Return values
0An event occurred for the menu, or a timeout
-1There was an event, but not for menu

Definition at line 80 of file dlg_verifycert.c.

81{
83
84 if ((event.op == OP_TIMEOUT) || (event.op == OP_ABORT))
85 {
86 *id = event.op;
87 return 0;
88 }
89
90 struct CertMenuData *mdata = menu->mdata;
91 char *p = NULL;
92 if ((event.ch != 0) && (p = strchr(mdata->keys, event.ch)))
93 {
94 *id = OP_MAX + (p - mdata->keys + 1);
95 return 0;
96 }
97
98 if (event.op == OP_NULL)
99 mutt_unget_ch(event.ch);
100 else
101 mutt_unget_op(event.op);
102 return -1;
103}
struct KeyEvent mutt_getch(GetChFlags flags)
Read a character from the input buffer.
Definition get.c:210
void mutt_unget_op(int op)
Return an operation to the input buffer.
Definition get.c:126
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
Definition get.c:115
#define GETCH_IGNORE_MACRO
Don't use MacroEvents.
Definition lib.h:54
#define OP_TIMEOUT
1 second with no events
Definition opcodes.h:35
#define OP_ABORT
$abort_key pressed (Ctrl-G)
Definition opcodes.h:36
@ OP_MAX
Definition opcodes.h:1003
Certificate data to use in the Menu.
Definition ssl.h:37
char * keys
Keys used in the prompt.
Definition ssl.h:40
An event such as a keypress.
Definition lib.h:82
int op
Function opcode, e.g. OP_HELP.
Definition lib.h:84
int ch
Raw key pressed.
Definition lib.h:83
void * mdata
Private data.
Definition lib.h:147
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_dialog_translate_op()

static int menu_dialog_translate_op ( int op)
static

Convert menubar movement to scrolling.

Parameters
opAction requested, e.g. OP_NEXT_ENTRY
Return values
numAction to perform, e.g. OP_NEXT_LINE

Definition at line 110 of file dlg_verifycert.c.

111{
112 switch (op)
113 {
114 case OP_NEXT_ENTRY:
115 return OP_NEXT_LINE;
116 case OP_PREV_ENTRY:
117 return OP_PREV_LINE;
118 case OP_CURRENT_TOP:
119 return OP_TOP_PAGE;
120 case OP_CURRENT_BOTTOM:
121 return OP_BOTTOM_PAGE;
122 case OP_CURRENT_MIDDLE:
123 return OP_MIDDLE_PAGE;
124 }
125
126 return op;
127}
+ Here is the caller graph for this function:

Variable Documentation

◆ VerifyHelp

const struct Mapping VerifyHelp[]
static
Initial value:
= {
{ N_("Exit"), OP_EXIT },
{ N_("Help"), OP_HELP },
{ NULL, 0 },
}
#define N_(a)
Definition message.h:32

Help Bar for the Certificate Verification dialog.

Definition at line 65 of file dlg_verifycert.c.

65 {
66 // clang-format off
67 { N_("Exit"), OP_EXIT },
68 { N_("Help"), OP_HELP },
69 { NULL, 0 },
70 // clang-format on
71};