NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
make_entry()

Format a item for a menu. More...

+ Collaboration diagram for make_entry():

Functions

static void alias_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the alias list - Implements Menu::make_entry() -. More...
 
static void query_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the query list - Implements Menu::make_entry() -. More...
 
static void autocrypt_make_entry (struct Menu *menu, char *buf, size_t buflen, int num)
 Create a line for the Autocrypt account menu - Implements Menu::make_entry() -. More...
 
static void folder_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the folder browser - Implements Menu::make_entry() -. More...
 
static void compose_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the attachment list - Implements Menu::make_entry() -. More...
 
static void history_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the history list - Implements Menu::make_entry() -. More...
 
void index_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the index list - Implements Menu::make_entry() -. More...
 
static void crypt_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the key selection list - Implements Menu::make_entry() -. More...
 
static void pgp_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the pgp key list - Implements Menu::make_entry() -. More...
 
static void smime_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the smime key list - Implements Menu::make_entry() -. More...
 
static void make_pattern_entry (struct Menu *menu, char *buf, size_t buflen, int num)
 Create a line for the Pattern Completion menu - Implements Menu::make_entry() -. More...
 
static void post_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the email list - Implements Menu::make_entry() -. More...
 
static void attach_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the attachment list - Implements Menu::make_entry() -. More...
 
static void mix_make_entry (struct Menu *menu, char *buf, size_t buflen, int num)
 Format a menu item for the mixmaster chain list - Implements Menu::make_entry() -. More...
 

Detailed Description

Format a item for a menu.

Parameters
[in]menuMenu containing items
[out]bufBuffer in which to save string
[in]buflenBuffer length
[in]lineMenu line number

Function Documentation

◆ alias_make_entry()

static void alias_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)
static

Format a menu item for the alias list - Implements Menu::make_entry() -.

Definition at line 165 of file dlgalias.c.

166 {
167  const struct AliasMenuData *mdata = menu->mdata;
168  const struct AliasViewArray *ava = &mdata->ava;
169  const struct AliasView *av = ARRAY_GET(ava, line);
170 
171  const char *const alias_format = cs_subset_string(mdata->sub, "alias_format");
172 
173  mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(alias_format),
174  alias_format_str, (intptr_t) av, MUTT_FORMAT_ARROWCURSOR);
175 }
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:780
#define NONULL(x)
Definition: string2.h:37
AliasView array wrapper with Pattern information -.
Definition: gui.h:52
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
#define ARRAY_GET(head, idx)
Return the element at index.
Definition: array.h:105
GUI data wrapping an Alias.
Definition: gui.h:35
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
struct ConfigSubset * sub
Config items.
Definition: gui.h:56
struct AliasViewArray ava
Array of AliasView.
Definition: gui.h:55
static const char * alias_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 a string for the alias list - Implements format_t -Expando Description %a Alias name %c Comme...
Definition: dlgalias.c:123
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ query_make_entry()

static void query_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)
static

Format a menu item for the query list - Implements Menu::make_entry() -.

Definition at line 247 of file dlgquery.c.

248 {
249  const struct AliasMenuData *mdata = menu->mdata;
250  const struct AliasViewArray *ava = &mdata->ava;
251  struct AliasView *av = ARRAY_GET(ava, line);
252 
253  const char *const query_format = cs_subset_string(mdata->sub, "query_format");
254 
255  mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(query_format),
256  query_format_str, (intptr_t) av, MUTT_FORMAT_ARROWCURSOR);
257 }
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:780
#define NONULL(x)
Definition: string2.h:37
AliasView array wrapper with Pattern information -.
Definition: gui.h:52
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
#define ARRAY_GET(head, idx)
Return the element at index.
Definition: array.h:105
GUI data wrapping an Alias.
Definition: gui.h:35
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
struct ConfigSubset * sub
Config items.
Definition: gui.h:56
struct AliasViewArray ava
Array of AliasView.
Definition: gui.h:55
static const char * query_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 a string for the query menu - Implements format_t -Expando Description %a Destination address...
Definition: dlgquery.c:182
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ autocrypt_make_entry()

static void autocrypt_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  num 
)
static

Create a line for the Autocrypt account menu - Implements Menu::make_entry() -.

Definition at line 191 of file dlgautocrypt.c.

192 {
193  struct AccountEntry *entry = &((struct AccountEntry *) menu->mdata)[num];
194 
195  const char *const c_autocrypt_acct_format =
196  cs_subset_string(NeoMutt->sub, "autocrypt_acct_format");
197  mutt_expando_format(buf, buflen, 0, menu->win->state.cols,
198  NONULL(c_autocrypt_acct_format), autocrypt_format_str,
199  (intptr_t) entry, MUTT_FORMAT_ARROWCURSOR);
200 }
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:780
#define NONULL(x)
Definition: string2.h:37
static const char * autocrypt_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 a string for the Autocrypt account list - Implements format_t -Expando Description %a Email a...
Definition: dlgautocrypt.c:134
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
Container for Accounts, Notifications.
Definition: neomutt.h:36
An entry in the Autocrypt account Menu.
Definition: dlgautocrypt.c:89
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ folder_make_entry()

static void folder_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)
static

Format a menu item for the folder browser - Implements Menu::make_entry() -.

Definition at line 986 of file browser.c.

987 {
988  struct BrowserStateEntry *entry = menu->mdata;
989  struct Folder folder = {
990  .ff = ARRAY_GET(entry, line),
991  .num = line,
992  };
993 
994 #ifdef USE_NNTP
995  if (OptNews)
996  {
997  const char *const c_group_index_format =
998  cs_subset_string(NeoMutt->sub, "group_index_format");
999  mutt_expando_format(buf, buflen, 0, menu->win->state.cols,
1000  NONULL(c_group_index_format), group_index_format_str,
1001  (intptr_t) &folder, MUTT_FORMAT_ARROWCURSOR);
1002  }
1003  else
1004 #endif
1005  {
1006  const char *const c_folder_format =
1007  cs_subset_string(NeoMutt->sub, "folder_format");
1008  mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_folder_format),
1009  folder_format_str, (intptr_t) &folder, MUTT_FORMAT_ARROWCURSOR);
1010  }
1011 }
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:780
#define NONULL(x)
Definition: string2.h:37
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
#define ARRAY_GET(head, idx)
Return the element at index.
Definition: array.h:105
Container for Accounts, Notifications.
Definition: neomutt.h:36
struct FolderFile * ff
Definition: browser.h:46
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
A folder/dir in the browser.
Definition: browser.h:44
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
static const char * folder_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 a string for the folder browser - Implements format_t -Expando Description %C Current file nu...
Definition: browser.c:405
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
const char * group_index_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 a string for the newsgroup menu - Implements format_t -Expando Description %C Current newsgro...
Definition: browse.c:55
WHERE bool OptNews
(pseudo) used to change reader mode
Definition: options.h:44
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compose_make_entry()

static void compose_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)
static

Format a menu item for the attachment list - Implements Menu::make_entry() -.

Definition at line 261 of file attach.c.

262 {
263  struct ComposeAttachData *adata = menu->mdata;
264  struct AttachCtx *actx = adata->actx;
265  struct ComposeSharedData *shared = menu->win->parent->wdata;
266  struct ConfigSubset *sub = shared->sub;
267 
268  const char *const c_attach_format = cs_subset_string(sub, "attach_format");
269  mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_attach_format),
270  attach_format_str, (intptr_t) (actx->idx[actx->v2r[line]]),
272 }
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:780
#define NONULL(x)
Definition: string2.h:37
Data to fill the Compose Attach Window.
Definition: attach_data.h:32
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
Shared Compose Data.
Definition: shared_data.h:29
#define MUTT_FORMAT_STAT_FILE
Used by attach_format_str.
Definition: format_flags.h:34
const char * attach_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 a string for the attachment menu - Implements format_t -Expando Description %C Character set ...
Definition: recvattach.c:270
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
A set of inherited config items.
Definition: subset.h:46
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
struct AttachCtx * actx
Definition: attach_data.h:34
short * v2r
Mapping from virtual to real attachment.
Definition: attach.h:58
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:135
void * wdata
Private data.
Definition: mutt_window.h:145
A set of attachments.
Definition: attach.h:49
struct AttachPtr ** idx
Array of attachments.
Definition: attach.h:54
struct ConfigSubset * sub
Config set to use.
Definition: shared_data.h:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ history_make_entry()

static void history_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)
static

Format a menu item for the history list - Implements Menu::make_entry() -.

Definition at line 110 of file dlghistory.c.

111 {
112  char *entry = ((char **) menu->mdata)[line];
113 
114  mutt_expando_format(buf, buflen, 0, menu->win->state.cols, "%s", history_format_str,
115  (intptr_t) entry, MUTT_FORMAT_ARROWCURSOR);
116 }
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:780
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
static const char * history_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 a string for the history list - Implements format_t -Expando Description %s History match ...
Definition: dlghistory.c:90
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index_make_entry()

void index_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)

Format a menu item for the index list - Implements Menu::make_entry() -.

Definition at line 761 of file dlg_index.c.

762 {
763  buf[0] = '\0';
764 
765  struct IndexPrivateData *priv = menu->mdata;
766  struct IndexSharedData *shared = priv->shared;
767  struct Mailbox *m = shared->mailbox;
768 
769  if (!m || !menu || (line < 0) || (line >= m->email_max))
770  return;
771 
772  struct Email *e = mutt_get_virt_email(m, line);
773  if (!e)
774  return;
775 
777  struct MuttThread *tmp = NULL;
778 
779  const enum UseThreads c_threads = mutt_thread_style();
780  if ((c_threads > UT_FLAT) && e->tree)
781  {
782  flags |= MUTT_FORMAT_TREE; /* display the thread tree */
783  if (e->display_subject)
784  flags |= MUTT_FORMAT_FORCESUBJ;
785  else
786  {
787  const bool reverse = c_threads == UT_REVERSE;
788  int edgemsgno;
789  if (reverse)
790  {
791  if (menu->top + menu->pagelen > menu->max)
792  edgemsgno = m->v2r[menu->max - 1];
793  else
794  edgemsgno = m->v2r[menu->top + menu->pagelen - 1];
795  }
796  else
797  edgemsgno = m->v2r[menu->top];
798 
799  for (tmp = e->thread->parent; tmp; tmp = tmp->parent)
800  {
801  if (!tmp->message)
802  continue;
803 
804  /* if no ancestor is visible on current screen, provisionally force
805  * subject... */
806  if (reverse ? (tmp->message->msgno > edgemsgno) : (tmp->message->msgno < edgemsgno))
807  {
808  flags |= MUTT_FORMAT_FORCESUBJ;
809  break;
810  }
811  else if (tmp->message->vnum >= 0)
812  break;
813  }
814  if (flags & MUTT_FORMAT_FORCESUBJ)
815  {
816  for (tmp = e->thread->prev; tmp; tmp = tmp->prev)
817  {
818  if (!tmp->message)
819  continue;
820 
821  /* ...but if a previous sibling is available, don't force it */
822  if (reverse ? (tmp->message->msgno > edgemsgno) : (tmp->message->msgno < edgemsgno))
823  break;
824  else if (tmp->message->vnum >= 0)
825  {
826  flags &= ~MUTT_FORMAT_FORCESUBJ;
827  break;
828  }
829  }
830  }
831  }
832  }
833 
834  const char *const c_index_format =
835  cs_subset_string(shared->sub, "index_format");
836  mutt_make_string(buf, buflen, menu->win->state.cols, NONULL(c_index_format),
837  m, shared->ctx->msg_in_pager, e, flags, NULL);
838 }
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:43
uint8_t MuttFormatFlags
Flags for mutt_expando_format(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: format_flags.h:29
#define NONULL(x)
Definition: string2.h:37
int msg_in_pager
Message currently shown in the pager.
Definition: context.h:43
The envelope/body of an email.
Definition: email.h:37
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
Definition: context.c:412
#define MUTT_FORMAT_FORCESUBJ
Print the subject even if unchanged.
Definition: format_flags.h:31
Private state data for the Index.
Definition: private_data.h:34
struct MuttThread * thread
Thread of Emails.
Definition: email.h:95
struct ConfigSubset * sub
Config set to use.
Definition: shared_data.h:38
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
bool display_subject
Used for threading.
Definition: email.h:57
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:36
struct MuttThread * parent
Parent of this Thread.
Definition: thread.h:45
enum UseThreads mutt_thread_style(void)
Which threading style is active?
Definition: mutt_thread.c:89
struct MuttThread * prev
Previous sibling Thread.
Definition: thread.h:48
#define MUTT_FORMAT_TREE
Draw the thread tree.
Definition: format_flags.h:32
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
UseThreads
Which threading style is active, $use_threads.
Definition: mutt_thread.h:77
void mutt_make_string(char *buf, size_t buflen, int cols, const char *s, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress)
Create formatted strings using mailbox expandos.
Definition: hdrline.c:1409
struct Context * ctx
Current Mailbox view.
Definition: shared_data.h:39
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
int email_max
Number of pointers in emails.
Definition: mailbox.h:100
A mailbox.
Definition: mailbox.h:81
int top
Entry that is the top of the current page.
Definition: lib.h:89
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
int vnum
Virtual message number.
Definition: email.h:88
int pagelen
Number of entries per screen.
Definition: lib.h:74
char * tree
Character string to print thread tree.
Definition: email.h:94
struct Email * message
Email this Thread refers to.
Definition: thread.h:49
Unthreaded.
Definition: mutt_thread.h:80
int max
Number of entries in the menu.
Definition: lib.h:71
An Email conversation.
Definition: thread.h:34
int * v2r
Mapping from virtual to real msgno.
Definition: mailbox.h:101
#define MUTT_FORMAT_INDEX
This is a main index entry.
Definition: format_flags.h:36
struct Mailbox * mailbox
Current Mailbox.
Definition: shared_data.h:41
Reverse threading (subthreads above root)
Definition: mutt_thread.h:82
int msgno
Number displayed to the user.
Definition: email.h:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crypt_make_entry()

static void crypt_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)
static

Format a menu item for the key selection list - Implements Menu::make_entry() -.

Definition at line 1230 of file dlggpgme.c.

1231 {
1232  struct CryptKeyInfo **key_table = menu->mdata;
1233  struct CryptEntry entry;
1234 
1235  entry.key = key_table[line];
1236  entry.num = line + 1;
1237 
1238  const char *const c_pgp_entry_format =
1239  cs_subset_string(NeoMutt->sub, "pgp_entry_format");
1240  mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_pgp_entry_format),
1241  crypt_format_str, (intptr_t) &entry, MUTT_FORMAT_ARROWCURSOR);
1242 }
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:780
#define NONULL(x)
Definition: string2.h:37
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
Container for Accounts, Notifications.
Definition: neomutt.h:36
static const char * crypt_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 a string for the key selection menu - Implements format_t -Expando Description %n Number %p P...
Definition: dlggpgme.c:1020
A stored PGP key.
Definition: crypt_gpgme.h:44
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
An entry in the Select-Key menu.
Definition: dlggpgme.c:116
struct CryptKeyInfo * key
Definition: dlggpgme.c:119
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pgp_make_entry()

static void pgp_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)
static

Format a menu item for the pgp key list - Implements Menu::make_entry() -.

Definition at line 502 of file dlgpgp.c.

503 {
504  struct PgpUid **key_table = menu->mdata;
505  struct PgpEntry entry;
506 
507  entry.uid = key_table[line];
508  entry.num = line + 1;
509 
510  const char *const c_pgp_entry_format =
511  cs_subset_string(NeoMutt->sub, "pgp_entry_format");
512  mutt_expando_format(buf, buflen, 0, menu->win->state.cols,
513  NONULL(c_pgp_entry_format), pgp_entry_format_str,
514  (intptr_t) &entry, MUTT_FORMAT_ARROWCURSOR);
515 }
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:780
#define NONULL(x)
Definition: string2.h:37
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
PGP User ID.
Definition: pgplib.h:34
Container for Accounts, Notifications.
Definition: neomutt.h:36
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
An entry in a PGP key menu.
Definition: dlgpgp.c:111
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
struct PgpUid * uid
Definition: dlgpgp.c:114
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 -Expando Description %n Number %...
Definition: dlgpgp.c:343
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ smime_make_entry()

static void smime_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)
static

Format a menu item for the smime key list - Implements Menu::make_entry() -.

Definition at line 112 of file dlgsmime.c.

113 {
114  struct SmimeKey **table = menu->mdata;
115  struct SmimeKey *key = table[line];
116  char *truststate = NULL;
117  switch (key->trust)
118  {
119  case 'e':
120  /* L10N: Describes the trust state of a S/MIME key.
121  This translation must be padded with spaces to the right such that it
122  has the same length as the other translations.
123  The translation strings which need to be padded are:
124  Expired, Invalid, Revoked, Trusted, Unverified, Verified, and Unknown. */
125  truststate = _("Expired ");
126  break;
127  case 'i':
128  /* L10N: Describes the trust state of a S/MIME key.
129  This translation must be padded with spaces to the right such that it
130  has the same length as the other translations.
131  The translation strings which need to be padded are:
132  Expired, Invalid, Revoked, Trusted, Unverified, Verified, and Unknown. */
133  truststate = _("Invalid ");
134  break;
135  case 'r':
136  /* L10N: Describes the trust state of a S/MIME key.
137  This translation must be padded with spaces to the right such that it
138  has the same length as the other translations.
139  The translation strings which need to be padded are:
140  Expired, Invalid, Revoked, Trusted, Unverified, Verified, and Unknown. */
141  truststate = _("Revoked ");
142  break;
143  case 't':
144  /* L10N: Describes the trust state of a S/MIME key.
145  This translation must be padded with spaces to the right such that it
146  has the same length as the other translations.
147  The translation strings which need to be padded are:
148  Expired, Invalid, Revoked, Trusted, Unverified, Verified, and Unknown. */
149  truststate = _("Trusted ");
150  break;
151  case 'u':
152  /* L10N: Describes the trust state of a S/MIME key.
153  This translation must be padded with spaces to the right such that it
154  has the same length as the other translations.
155  The translation strings which need to be padded are:
156  Expired, Invalid, Revoked, Trusted, Unverified, Verified, and Unknown. */
157  truststate = _("Unverified");
158  break;
159  case 'v':
160  /* L10N: Describes the trust state of a S/MIME key.
161  This translation must be padded with spaces to the right such that it
162  has the same length as the other translations.
163  The translation strings which need to be padded are:
164  Expired, Invalid, Revoked, Trusted, Unverified, Verified, and Unknown. */
165  truststate = _("Verified ");
166  break;
167  default:
168  /* L10N: Describes the trust state of a S/MIME key.
169  This translation must be padded with spaces to the right such that it
170  has the same length as the other translations.
171  The translation strings which need to be padded are:
172  Expired, Invalid, Revoked, Trusted, Unverified, Verified, and Unknown. */
173  truststate = _("Unknown ");
174  }
175  snprintf(buf, buflen, " 0x%s %s %s %-35.35s %s", key->hash,
176  smime_key_flags(key->flags), truststate, key->email, key->label);
177 }
KeyFlags flags
Definition: smime.h:51
#define _(a)
Definition: message.h:28
char trust
i=Invalid r=revoked e=expired u=unverified v=verified t=trusted
Definition: smime.h:50
An SIME key.
Definition: smime.h:44
static char * smime_key_flags(KeyFlags flags)
Turn SMIME key flags into a string.
Definition: dlgsmime.c:90
void * mdata
Private data.
Definition: lib.h:155
char * email
Definition: smime.h:46
char * label
Definition: smime.h:48
char * hash
Definition: smime.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_pattern_entry()

static void make_pattern_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  num 
)
static

Create a line for the Pattern Completion menu - Implements Menu::make_entry() -.

Definition at line 147 of file dlgpattern.c.

148 {
149  struct PatternEntry *entry = &((struct PatternEntry *) menu->mdata)[num];
150 
151  const char *const c_pattern_format =
152  cs_subset_string(NeoMutt->sub, "pattern_format");
153  mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_pattern_format),
154  pattern_format_str, (intptr_t) entry, MUTT_FORMAT_ARROWCURSOR);
155 }
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:780
#define NONULL(x)
Definition: string2.h:37
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
Container for Accounts, Notifications.
Definition: neomutt.h:36
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
static const char * pattern_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 a string for the pattern completion menu - Implements format_t -Expando Description %d Patter...
Definition: dlgpattern.c:117
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
int num
Index number.
Definition: dlgpattern.c:92
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
A line in the Pattern Completion menu.
Definition: dlgpattern.c:90
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ post_make_entry()

static void post_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)
static

Format a menu item for the email list - Implements Menu::make_entry() -.

Definition at line 248 of file postpone.c.

249 {
250  struct Mailbox *m = menu->mdata;
251 
252  const char *const c_index_format =
253  cs_subset_string(NeoMutt->sub, "index_format");
254  mutt_make_string(buf, buflen, menu->win->state.cols, NONULL(c_index_format),
255  m, -1, m->emails[line], MUTT_FORMAT_ARROWCURSOR, NULL);
256 }
struct Email ** emails
Array of Emails.
Definition: mailbox.h:99
#define NONULL(x)
Definition: string2.h:37
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
Container for Accounts, Notifications.
Definition: neomutt.h:36
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
void mutt_make_string(char *buf, size_t buflen, int cols, const char *s, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress)
Create formatted strings using mailbox expandos.
Definition: hdrline.c:1409
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
A mailbox.
Definition: mailbox.h:81
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ attach_make_entry()

static void attach_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  line 
)
static

Format a menu item for the attachment list - Implements Menu::make_entry() -.

Definition at line 505 of file recvattach.c.

506 {
507  struct AttachCtx *actx = menu->mdata;
508 
509  const char *const c_attach_format =
510  cs_subset_string(NeoMutt->sub, "attach_format");
511  mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_attach_format),
512  attach_format_str, (intptr_t) (actx->idx[actx->v2r[line]]),
514 }
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:780
#define NONULL(x)
Definition: string2.h:37
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
Container for Accounts, Notifications.
Definition: neomutt.h:36
const char * attach_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 a string for the attachment menu - Implements format_t -Expando Description %C Character set ...
Definition: recvattach.c:270
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
short * v2r
Mapping from virtual to real attachment.
Definition: attach.h:58
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
A set of attachments.
Definition: attach.h:49
struct AttachPtr ** idx
Array of attachments.
Definition: attach.h:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mix_make_entry()

static void mix_make_entry ( struct Menu menu,
char *  buf,
size_t  buflen,
int  num 
)
static

Format a menu item for the mixmaster chain list - Implements Menu::make_entry() -.

Definition at line 546 of file remailer.c.

547 {
548  struct Remailer **type2_list = menu->mdata;
549  const char *const c_mix_entry_format =
550  cs_subset_string(NeoMutt->sub, "mix_entry_format");
551  mutt_expando_format(buf, buflen, 0, menu->win->state.cols,
552  NONULL(c_mix_entry_format), mix_format_str,
553  (intptr_t) type2_list[num], MUTT_FORMAT_ARROWCURSOR);
554 }
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:780
#define NONULL(x)
Definition: string2.h:37
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
int num
Definition: remailer.h:47
Container for Accounts, Notifications.
Definition: neomutt.h:36
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * mdata
Private data.
Definition: lib.h:155
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
static const char * mix_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 a string for the remailer menu - Implements format_t -Expando Description %a The remailer&#39;s e...
Definition: remailer.c:477
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
A Mixmaster remailer.
Definition: remailer.h:45
+ Here is the call graph for this function:
+ Here is the caller graph for this function: