NeoMutt  2023-11-03-107-g582dc1
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
dlg_pgp.c
Go to the documentation of this file.
1
68#include "config.h"
69#include <ctype.h>
70#include <locale.h>
71#include <stdbool.h>
72#include <stdint.h>
73#include <stdio.h>
74#include "private.h"
75#include "mutt/lib.h"
76#include "address/lib.h"
77#include "config/lib.h"
78#include "core/lib.h"
79#include "gui/lib.h"
80#include "lib.h"
81#include "key/lib.h"
82#include "menu/lib.h"
83#include "format_flags.h"
84#include "mutt_logging.h"
85#include "muttlib.h"
86#include "pgp.h"
87#include "pgp_functions.h"
88#include "pgpkey.h"
89#include "pgplib.h"
90#include "sort.h"
91
93static const struct Mapping PgpHelp[] = {
94 // clang-format off
95 { N_("Exit"), OP_EXIT },
96 { N_("Select"), OP_GENERIC_SELECT_ENTRY },
97 { N_("Check key"), OP_VERIFY_KEY },
98 { N_("Help"), OP_HELP },
99 { NULL, 0 },
100 // clang-format on
101};
102
104static const char TrustFlags[] = "?- +";
105
109static int pgp_sort_address(const void *a, const void *b, void *sdata)
110{
111 struct PgpUid const *s = *(struct PgpUid const *const *) a;
112 struct PgpUid const *t = *(struct PgpUid const *const *) b;
113 const bool sort_reverse = *(bool *) sdata;
114
115 int rc = mutt_istr_cmp(s->addr, t->addr);
116 if (rc != 0)
117 goto done;
118
120
121done:
122 return sort_reverse ? -rc : rc;
123}
124
128static int pgp_sort_date(const void *a, const void *b, void *sdata)
129{
130 struct PgpUid const *s = *(struct PgpUid const *const *) a;
131 struct PgpUid const *t = *(struct PgpUid const *const *) b;
132 const bool sort_reverse = *(bool *) sdata;
133
135 if (rc != 0)
136 goto done;
137
138 rc = mutt_istr_cmp(s->addr, t->addr);
139
140done:
141 return sort_reverse ? -rc : rc;
142}
143
147static int pgp_sort_keyid(const void *a, const void *b, void *sdata)
148{
149 struct PgpUid const *s = *(struct PgpUid const *const *) a;
150 struct PgpUid const *t = *(struct PgpUid const *const *) b;
151 const bool sort_reverse = *(bool *) sdata;
152
154 if (rc != 0)
155 goto done;
156
157 rc = mutt_istr_cmp(s->addr, t->addr);
158
159done:
160 return sort_reverse ? -rc : rc;
161}
162
166static int pgp_sort_trust(const void *a, const void *b, void *sdata)
167{
168 struct PgpUid const *s = *(struct PgpUid const *const *) a;
169 struct PgpUid const *t = *(struct PgpUid const *const *) b;
170 const bool sort_reverse = *(bool *) sdata;
171
174 if (rc != 0)
175 goto done;
176
177 // Note: reversed
178 rc = mutt_numeric_cmp(t->trust, s->trust);
179 if (rc != 0)
180 goto done;
181
182 // Note: reversed
184 if (rc != 0)
185 goto done;
186
187 // Note: reversed
189 if (rc != 0)
190 goto done;
191
192 rc = mutt_istr_cmp(s->addr, t->addr);
193 if (rc != 0)
194 goto done;
195
197
198done:
199 return sort_reverse ? -rc : rc;
200}
201
210{
211 static char buf[3];
212
213 if (!(flags & KEYFLAG_CANENCRYPT))
214 buf[0] = '-';
215 else if (flags & KEYFLAG_PREFER_SIGNING)
216 buf[0] = '.';
217 else
218 buf[0] = 'e';
219
220 if (!(flags & KEYFLAG_CANSIGN))
221 buf[1] = '-';
223 buf[1] = '.';
224 else
225 buf[1] = 's';
226
227 buf[2] = '\0';
228
229 return buf;
230}
231
238{
240 return 'R';
242 return 'X';
244 return 'd';
246 return 'c';
247
248 return ' ';
249}
250
273static const char *pgp_entry_format_str(char *buf, size_t buflen, size_t col, int cols,
274 char op, const char *src, const char *prec,
275 const char *if_str, const char *else_str,
276 intptr_t data, MuttFormatFlags flags)
277{
278 char fmt[128] = { 0 };
279 bool optional = (flags & MUTT_FORMAT_OPTIONAL);
280
281 struct PgpEntry *entry = (struct PgpEntry *) data;
282 struct PgpUid *uid = entry->uid;
283 struct PgpKeyInfo *key = uid->parent;
284 struct PgpKeyInfo *pkey = pgp_principal_key(key);
285
286 if (isupper((unsigned char) op))
287 key = pkey;
288
289 KeyFlags kflags = key->flags | (pkey->flags & KEYFLAG_RESTRICTIONS) | uid->flags;
290
291 switch (tolower(op))
292 {
293 case 'a':
294 if (!optional)
295 {
296 snprintf(fmt, sizeof(fmt), "%%%ss", prec);
297 snprintf(buf, buflen, fmt, key->algorithm);
298 }
299 break;
300 case 'c':
301 if (!optional)
302 {
303 snprintf(fmt, sizeof(fmt), "%%%ss", prec);
304 snprintf(buf, buflen, fmt, pgp_key_abilities(kflags));
305 }
306 else if (!(kflags & KEYFLAG_ABILITIES))
307 {
308 optional = false;
309 }
310 break;
311 case 'f':
312 if (!optional)
313 {
314 snprintf(fmt, sizeof(fmt), "%%%sc", prec);
315 snprintf(buf, buflen, fmt, pgp_flags(kflags));
316 }
317 else if (!(kflags & KEYFLAG_RESTRICTIONS))
318 {
319 optional = false;
320 }
321 break;
322 case 'k':
323 if (!optional)
324 {
325 snprintf(fmt, sizeof(fmt), "%%%ss", prec);
326 snprintf(buf, buflen, fmt, pgp_this_keyid(key));
327 }
328 break;
329 case 'l':
330 if (!optional)
331 {
332 snprintf(fmt, sizeof(fmt), "%%%sd", prec);
333 snprintf(buf, buflen, fmt, key->keylen);
334 }
335 break;
336 case 'n':
337 if (!optional)
338 {
339 snprintf(fmt, sizeof(fmt), "%%%sd", prec);
340 snprintf(buf, buflen, fmt, entry->num);
341 }
342 break;
343 case 't':
344 if (!optional)
345 {
346 snprintf(fmt, sizeof(fmt), "%%%sc", prec);
347 snprintf(buf, buflen, fmt, TrustFlags[uid->trust & 0x03]);
348 }
349 else if (!(uid->trust & 0x03))
350 {
351 /* undefined trust */
352 optional = false;
353 }
354 break;
355 case 'u':
356 if (!optional)
357 {
358 snprintf(fmt, sizeof(fmt), "%%%ss", prec);
359 snprintf(buf, buflen, fmt, NONULL(uid->addr));
360 }
361 break;
362 case '[':
363 {
364 char buf2[128];
365 bool use_c_locale = false;
366 size_t len;
367
368 char *p = buf;
369
370 const char *cp = src;
371 if (*cp == '!')
372 {
373 use_c_locale = true;
374 cp++;
375 }
376
377 len = buflen - 1;
378 while ((len > 0) && (*cp != ']'))
379 {
380 if (*cp == '%')
381 {
382 cp++;
383 if (len >= 2)
384 {
385 *p++ = '%';
386 *p++ = *cp;
387 len -= 2;
388 }
389 else
390 {
391 break; /* not enough space */
392 }
393 cp++;
394 }
395 else
396 {
397 *p++ = *cp++;
398 len--;
399 }
400 }
401 *p = '\0';
402
403 if (use_c_locale)
404 {
405 mutt_date_localtime_format_locale(buf2, sizeof(buf2), buf,
407 }
408 else
409 {
410 mutt_date_localtime_format(buf2, sizeof(buf2), buf, key->gen_time);
411 }
412
413 snprintf(fmt, sizeof(fmt), "%%%ss", prec);
414 snprintf(buf, buflen, fmt, buf2);
415 if (len > 0)
416 src = cp + 1;
417 break;
418 }
419 default:
420 *buf = '\0';
421 }
422
423 if (optional)
424 {
425 mutt_expando_format(buf, buflen, col, cols, if_str, pgp_entry_format_str,
427 }
428 else if (flags & MUTT_FORMAT_OPTIONAL)
429 {
430 mutt_expando_format(buf, buflen, col, cols, else_str, pgp_entry_format_str,
432 }
433
434 /* We return the format string, unchanged */
435 return src;
436}
437
443static void pgp_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
444{
445 struct PgpUid **key_table = menu->mdata;
446
447 struct PgpEntry entry = { 0 };
448 entry.uid = key_table[line];
449 entry.num = line + 1;
450
451 const char *const c_pgp_entry_format = cs_subset_string(NeoMutt->sub, "pgp_entry_format");
452 mutt_expando_format(buf, buflen, 0, menu->win->state.cols,
453 NONULL(c_pgp_entry_format), pgp_entry_format_str,
454 (intptr_t) &entry, MUTT_FORMAT_ARROWCURSOR);
455}
456
462static void pgp_key_table_free(struct Menu *menu, void **ptr)
463{
464 FREE(ptr);
465}
466
471{
472 if (nc->event_type != NT_CONFIG)
473 return 0;
474 if (!nc->global_data || !nc->event_data)
475 return -1;
476
477 struct EventConfig *ev_c = nc->event_data;
478
479 if (!mutt_str_equal(ev_c->name, "pgp_entry_format") &&
480 !mutt_str_equal(ev_c->name, "pgp_sort_keys"))
481 {
482 return 0;
483 }
484
485 struct Menu *menu = nc->global_data;
487 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC, MENU_REDRAW_FULL\n");
488
489 return 0;
490}
491
500{
501 if (nc->event_type != NT_WINDOW)
502 return 0;
503 if (!nc->global_data || !nc->event_data)
504 return -1;
506 return 0;
507
508 struct MuttWindow *win_menu = nc->global_data;
509 struct EventWindow *ev_w = nc->event_data;
510 if (ev_w->win != win_menu)
511 return 0;
512
513 struct Menu *menu = win_menu->wdata;
514
517
518 mutt_debug(LL_DEBUG5, "window delete done\n");
519 return 0;
520}
521
531struct PgpKeyInfo *dlg_pgp(struct PgpKeyInfo *keys, struct Address *p, const char *s)
532{
533 struct PgpUid **key_table = NULL;
534 struct Menu *menu = NULL;
535 char buf[1024] = { 0 };
536 struct PgpUid *a = NULL;
537 bool unusable = false;
538 int keymax = 0;
539
540 const bool c_pgp_show_unusable = cs_subset_bool(NeoMutt->sub, "pgp_show_unusable");
541 int i = 0;
542 for (struct PgpKeyInfo *kp = keys; kp; kp = kp->next)
543 {
544 if (!c_pgp_show_unusable && (kp->flags & KEYFLAG_CANTUSE))
545 {
546 unusable = true;
547 continue;
548 }
549
550 for (a = kp->address; a; a = a->next)
551 {
552 if (!c_pgp_show_unusable && (a->flags & KEYFLAG_CANTUSE))
553 {
554 unusable = true;
555 continue;
556 }
557
558 if (i == keymax)
559 {
560 keymax += 5;
561 mutt_mem_realloc(&key_table, sizeof(struct PgpUid *) * keymax);
562 }
563
564 key_table[i++] = a;
565 }
566 }
567
568 if ((i == 0) && unusable)
569 {
570 mutt_error(_("All matching keys are expired, revoked, or disabled"));
571 return NULL;
572 }
573
574 sort_t f = NULL;
575 short c_pgp_sort_keys = cs_subset_sort(NeoMutt->sub, "pgp_sort_keys");
576 switch (c_pgp_sort_keys & SORT_MASK)
577 {
578 case SORT_ADDRESS:
580 break;
581 case SORT_DATE:
582 f = pgp_sort_date;
583 break;
584 case SORT_KEYID:
585 f = pgp_sort_keyid;
586 break;
587 case SORT_TRUST:
588 default:
589 f = pgp_sort_trust;
590 break;
591 }
592
593 if (key_table)
594 {
595 bool sort_reverse = c_pgp_sort_keys & SORT_REVERSE;
596 mutt_qsort_r(key_table, i, sizeof(struct PgpUid *), f, &sort_reverse);
597 }
598
600
601 menu = dlg->wdata;
602 menu->max = i;
604 menu->mdata = key_table;
606
607 struct PgpData pd = { false, menu, key_table, NULL };
608 dlg->wdata = &pd;
609
610 // NT_COLOR is handled by the SimpleDialog
613
614 if (p)
615 snprintf(buf, sizeof(buf), _("PGP keys matching <%s>"), buf_string(p->mailbox));
616 else
617 snprintf(buf, sizeof(buf), _("PGP keys matching \"%s\""), s);
618
619 struct MuttWindow *sbar = window_find_child(dlg, WT_STATUS_BAR);
620 sbar_set_title(sbar, buf);
621
623
624 struct MuttWindow *old_focus = window_set_focus(menu->win);
625 // ---------------------------------------------------------------------------
626 // Event Loop
627 int op = OP_NULL;
628 do
629 {
630 menu_tagging_dispatcher(menu->win, op);
631 window_redraw(NULL);
632
634 mutt_debug(LL_DEBUG1, "Got op %s (%d)\n", opcodes_get_name(op), op);
635 if (op < 0)
636 continue;
637 if (op == OP_NULL)
638 {
640 continue;
641 }
643
644 int rc = pgp_function_dispatcher(dlg, op);
645
646 if (rc == FR_UNKNOWN)
647 rc = menu_function_dispatcher(menu->win, op);
648 if (rc == FR_UNKNOWN)
649 rc = global_function_dispatcher(NULL, op);
650 } while (!pd.done);
651 // ---------------------------------------------------------------------------
652
653 window_set_focus(old_focus);
654 simple_dialog_free(&dlg);
655 return pd.key;
656}
Email Address Handling.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:93
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:292
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:48
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Definition: helpers.c:267
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
@ FR_UNKNOWN
Unknown function.
Definition: dispatcher.h:33
static char pgp_flags(KeyFlags flags)
Turn PGP key flags into a string.
Definition: dlg_pgp.c:237
static const struct Mapping PgpHelp[]
Help Bar for the PGP key selection dialog.
Definition: dlg_pgp.c:93
static const char TrustFlags[]
Characters used to show the trust level for PGP keys.
Definition: dlg_pgp.c:104
static char * pgp_key_abilities(KeyFlags flags)
Turn PGP key abilities into a string.
Definition: dlg_pgp.c:209
Flags to control mutt_expando_format()
#define MUTT_FORMAT_NO_FLAGS
No flags are set.
Definition: format_flags.h:30
#define MUTT_FORMAT_OPTIONAL
Allow optional field processing.
Definition: format_flags.h:33
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
uint8_t MuttFormatFlags
Flags for mutt_expando_format(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: format_flags.h:29
int km_dokey(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
Definition: get.c:463
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
Definition: get.c:293
int menu_tagging_dispatcher(struct MuttWindow *win, int op)
Perform tagging operations on the Menu - Implements function_dispatcher_t -.
Definition: tagging.c:230
int pgp_function_dispatcher(struct MuttWindow *win, int op)
Perform a Pgp function - Implements function_dispatcher_t -.
int global_function_dispatcher(struct MuttWindow *win, int op)
Perform a Global function - Implements function_dispatcher_t -.
Definition: global.c:169
int menu_function_dispatcher(struct MuttWindow *win, int op)
Perform a Menu function - Implements function_dispatcher_t -.
Definition: functions.c:317
static const char * pgp_entry_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)
Format an entry on the PGP key selection menu - Implements format_t -.
Definition: dlg_pgp.c:273
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 -.
Definition: muttlib.c:739
struct PgpKeyInfo * dlg_pgp(struct PgpKeyInfo *keys, struct Address *p, const char *s)
Let the user select a key to use -.
Definition: dlg_pgp.c:531
#define mutt_error(...)
Definition: logging2.h:92
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
static void pgp_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a PGP Key for the Menu - Implements Menu::make_entry() -.
Definition: dlg_pgp.c:443
static void pgp_key_table_free(struct Menu *menu, void **ptr)
Free the key table - Implements Menu::mdata_free() -.
Definition: dlg_pgp.c:462
static int pgp_key_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: dlg_pgp.c:499
static int pgp_key_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: dlg_pgp.c:470
static int pgp_sort_trust(const void *a, const void *b, void *sdata)
Compare two keys by their trust levels - Implements sort_t -.
Definition: dlg_pgp.c:166
static int pgp_sort_keyid(const void *a, const void *b, void *sdata)
Compare two keys by their IDs - Implements sort_t -.
Definition: dlg_pgp.c:147
static int pgp_sort_date(const void *a, const void *b, void *sdata)
Compare two keys by their dates - Implements sort_t -.
Definition: dlg_pgp.c:128
static int pgp_sort_address(const void *a, const void *b, void *sdata)
Compare two keys by their addresses - Implements sort_t -.
Definition: dlg_pgp.c:109
Convenience wrapper for the gui headers.
void simple_dialog_free(struct MuttWindow **ptr)
Destroy a simple index Dialog.
Definition: simple.c:168
struct MuttWindow * simple_dialog_new(enum MenuType mtype, enum WindowType wtype, const struct Mapping *help_data)
Create a simple index Dialog.
Definition: simple.c:132
Manage keymappings.
#define GETCH_NO_FLAGS
No flags are set.
Definition: lib.h:52
@ LL_DEBUG5
Log at debug level 5.
Definition: logging2.h:47
@ LL_DEBUG1
Log at debug level 1.
Definition: logging2.h:43
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:114
#define FREE(x)
Definition: memory.h:45
GUI present the user with a selectable list.
#define MENU_REDRAW_FULL
Redraw everything.
Definition: lib.h:60
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition: menu.c:180
size_t mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t)
Format localtime.
Definition: date.c:924
size_t mutt_date_localtime_format_locale(char *buf, size_t buflen, const char *format, time_t t, locale_t loc)
Format localtime using a given locale.
Definition: date.c:942
Convenience wrapper for the library headers.
#define N_(a)
Definition: message.h:32
#define _(a)
Definition: message.h:28
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition: notify.c:230
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:191
int mutt_istr_cmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
Definition: string.c:484
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:763
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:73
NeoMutt Logging.
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
Definition: mutt_window.c:634
struct MuttWindow * window_set_focus(struct MuttWindow *win)
Set the Window focus.
Definition: mutt_window.c:684
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
Definition: mutt_window.c:533
@ WT_DLG_PGP
Pgp Dialog, dlg_pgp()
Definition: mutt_window.h:88
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
Definition: mutt_window.h:102
@ NT_WINDOW_DELETE
Window is about to be deleted.
Definition: mutt_window.h:229
Some miscellaneous functions.
#define KEYFLAG_EXPIRED
Key is expired.
Definition: lib.h:132
uint16_t KeyFlags
Flags describing PGP/SMIME keys, e.g. KEYFLAG_CANSIGN.
Definition: lib.h:126
#define KEYFLAG_RESTRICTIONS
Definition: lib.h:141
#define KEYFLAG_ABILITIES
Definition: lib.h:143
#define KEYFLAG_CANENCRYPT
Key is suitable for encryption.
Definition: lib.h:129
#define KEYFLAG_CANTUSE
Definition: lib.h:140
#define KEYFLAG_PREFER_SIGNING
Key's owner prefers signing.
Definition: lib.h:138
#define KEYFLAG_CRITICAL
Key is marked critical.
Definition: lib.h:136
#define KEYFLAG_DISABLED
Key is marked disabled.
Definition: lib.h:134
#define KEYFLAG_REVOKED
Key is revoked.
Definition: lib.h:133
#define KEYFLAG_PREFER_ENCRYPTION
Key's owner prefers encryption.
Definition: lib.h:137
#define KEYFLAG_CANSIGN
Key is suitable for signing.
Definition: lib.h:128
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:57
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition: opcodes.c:48
char * pgp_this_keyid(struct PgpKeyInfo *k)
Get the ID of this key.
Definition: pgp.c:192
char * pgp_fpr_or_lkeyid(struct PgpKeyInfo *k)
Get the fingerprint or long keyid.
Definition: pgp.c:235
PGP sign, encrypt, check routines.
Pgp functions.
struct PgpKeyInfo * pgp_principal_key(struct PgpKeyInfo *key)
Get the main (parent) PGP key.
Definition: pgpkey.c:89
PGP key management routines.
Misc PGP helper routines.
void mutt_qsort_r(void *base, size_t nmemb, size_t size, sort_t compar, void *sdata)
Sort an array, where the comparator has access to opaque data rather than requiring global variables.
Definition: qsort_r.c:66
int(* sort_t)(const void *a, const void *b, void *sdata)
Definition: qsort_r.h:40
void sbar_set_title(struct MuttWindow *win, const char *title)
Set the title for the Simple Bar.
Definition: sbar.c:227
GUI display the mailboxes in a side panel.
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:74
@ SORT_TRUST
Sort by encryption key's trust level.
Definition: sort2.h:52
@ SORT_KEYID
Sort by the encryption key's ID.
Definition: sort2.h:51
@ SORT_DATE
Sort by the date the email was sent.
Definition: sort2.h:39
@ SORT_ADDRESS
Sort by email address.
Definition: sort2.h:50
#define SORT_REVERSE
Reverse the order of the sort.
Definition: sort2.h:75
Assorted sorting methods.
#define mutt_numeric_cmp(a, b)
Definition: sort.h:34
Key value store.
#define NONULL(x)
Definition: string2.h:37
An email address.
Definition: address.h:36
struct Buffer * mailbox
Mailbox and host address.
Definition: address.h:38
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition: subset.h:52
A config-change event.
Definition: subset.h:71
const char * name
Name of config item that changed.
Definition: subset.h:73
An Event that happened to a Window.
Definition: mutt_window.h:239
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:240
Mapping between user-readable string and a constant.
Definition: mapping.h:32
Definition: lib.h:70
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:77
void(* make_entry)(struct Menu *menu, char *buf, size_t buflen, int line)
Definition: lib.h:96
void(* mdata_free)(struct Menu *menu, void **ptr)
Definition: lib.h:151
void * mdata
Private data.
Definition: lib.h:137
int max
Number of entries in the menu.
Definition: lib.h:72
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * wdata
Private data.
Definition: mutt_window.h:145
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
Container for Accounts, Notifications.
Definition: neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:45
locale_t time_c_locale
Current locale but LC_TIME=C.
Definition: neomutt.h:47
Data passed to a notification function.
Definition: observer.h:34
void * event_data
Data from notify_send()
Definition: observer.h:38
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition: observer.h:36
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
Definition: observer.h:37
void * global_data
Data from notify_observer_add()
Definition: observer.h:39
Data to pass to the Pgp Functions.
Definition: pgp_functions.h:34
struct PgpUid ** key_table
Array of Keys.
Definition: pgp_functions.h:37
struct Menu * menu
Pgp Menu.
Definition: pgp_functions.h:36
bool done
Should we close the Dialog?
Definition: pgp_functions.h:35
struct PgpKeyInfo * key
Selected Key.
Definition: pgp_functions.h:38
An entry in a PGP key menu.
Definition: private.h:39
struct PgpUid * uid
Definition: private.h:41
size_t num
Index number.
Definition: private.h:40
Information about a PGP key.
Definition: pgplib.h:47
KeyFlags flags
Definition: pgplib.h:51
struct PgpKeyInfo * next
Definition: pgplib.h:57
short keylen
Definition: pgplib.h:52
time_t gen_time
Definition: pgplib.h:53
const char * algorithm
Definition: pgplib.h:55
PGP User ID.
Definition: pgplib.h:35
short trust
Definition: pgplib.h:37
struct PgpKeyInfo * parent
Parent key.
Definition: pgplib.h:39
int flags
Definition: pgplib.h:38
char * addr
Definition: pgplib.h:36
struct PgpUid * next
Linked list.
Definition: pgplib.h:40
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
@ MENU_PGP
PGP encryption menu.
Definition: type.h:56