NeoMutt  2022-04-29-323-g5fcc6c
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 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 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...
 
void cert_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Create a string to display in a Menu - 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 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...
 
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...
 

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() -.

See also
$alias_format, alias_format_str()

Definition at line 168 of file dlg_alias.c.

169{
170 const struct AliasMenuData *mdata = menu->mdata;
171 const struct AliasViewArray *ava = &mdata->ava;
172 const struct AliasView *av = ARRAY_GET(ava, line);
173
174 const char *const alias_format = cs_subset_string(mdata->sub, "alias_format");
175
176 mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(alias_format),
178}
#define ARRAY_GET(head, idx)
Return the element at index.
Definition: array.h:108
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
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 -.
Definition: dlg_alias.c:124
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:777
#define NONULL(x)
Definition: string2.h:37
AliasView array wrapper with Pattern information -.
Definition: gui.h:52
struct AliasViewArray ava
All Aliases/Queries.
Definition: gui.h:53
struct Menu * menu
Menu.
Definition: gui.h:56
struct ConfigSubset * sub
Config items.
Definition: gui.h:55
GUI data wrapping an Alias.
Definition: gui.h:36
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
void * mdata
Private data.
Definition: lib.h:137
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
+ 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() -.

See also
$query_format, query_format_str()

Definition at line 215 of file dlg_query.c.

216{
217 const struct AliasMenuData *mdata = menu->mdata;
218 const struct AliasViewArray *ava = &mdata->ava;
219 struct AliasView *av = ARRAY_GET(ava, line);
220
221 const char *const query_format = cs_subset_string(mdata->sub, "query_format");
222
223 mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(query_format),
225}
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 -.
Definition: dlg_query.c:148
+ 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() -.

See also
$attach_format, attach_format_str()

Definition at line 386 of file dlg_attach.c.

387{
388 struct AttachPrivateData *priv = menu->mdata;
389 struct AttachCtx *actx = priv->actx;
390
391 const char *const c_attach_format = cs_subset_string(NeoMutt->sub, "attach_format");
392 mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_attach_format),
393 attach_format_str, (intptr_t) (actx->idx[actx->v2r[line]]),
395}
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 -.
Definition: dlg_attach.c:152
A set of attachments.
Definition: attach.h:51
struct AttachPtr ** idx
Array of attachments.
Definition: attach.h:55
short * v2r
Mapping from virtual to real attachment.
Definition: attach.h:59
Private state data for Attachments.
Definition: private_data.h:34
struct Menu * menu
Current Menu.
Definition: private_data.h:35
struct AttachCtx * actx
List of all Attachments.
Definition: private_data.h:36
Container for Accounts, Notifications.
Definition: neomutt.h:37
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:

◆ 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() -.

See also
$autocrypt_acct_format, autocrypt_format_str()

Definition at line 183 of file dlg_autocrypt.c.

184{
185 struct AccountEntry *entry = &((struct AccountEntry *) menu->mdata)[num];
186
187 const char *const c_autocrypt_acct_format = cs_subset_string(NeoMutt->sub, "autocrypt_acct_format");
188 mutt_expando_format(buf, buflen, 0, menu->win->state.cols,
189 NONULL(c_autocrypt_acct_format), autocrypt_format_str,
190 (intptr_t) entry, MUTT_FORMAT_ARROWCURSOR);
191}
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 -.
An entry in the Autocrypt account Menu.
Definition: private.h:44
int num
Number in the index.
Definition: private.h:45
+ 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 806 of file browser.c.

807{
808 struct BrowserState *state = menu->mdata;
809 struct BrowserStateEntry *entry = &state->entry;
810 struct Folder folder = {
811 .ff = ARRAY_GET(entry, line),
812 .num = line,
813 };
814
815#ifdef USE_NNTP
816 if (OptNews)
817 {
818 const char *const c_group_index_format = cs_subset_string(NeoMutt->sub, "group_index_format");
819 mutt_expando_format(buf, buflen, 0, menu->win->state.cols,
820 NONULL(c_group_index_format), group_index_format_str,
821 (intptr_t) &folder, MUTT_FORMAT_ARROWCURSOR);
822 }
823 else
824#endif
825 if (state->is_mailbox_list)
826 {
827 const char *const c_mailbox_folder_format = cs_subset_string(NeoMutt->sub, "mailbox_folder_format");
828 mutt_expando_format(buf, buflen, 0, menu->win->state.cols,
829 NONULL(c_mailbox_folder_format), folder_format_str,
830 (intptr_t) &folder, MUTT_FORMAT_ARROWCURSOR);
831 }
832 else
833 {
834 const char *const c_folder_format = cs_subset_string(NeoMutt->sub, "folder_format");
835 mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_folder_format),
836 folder_format_str, (intptr_t) &folder, MUTT_FORMAT_ARROWCURSOR);
837 }
838}
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 -.
Definition: browse.c:55
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 -.
Definition: browser.c:207
bool OptNews
(pseudo) used to change reader mode
Definition: options.h:50
State of the file/mailbox browser.
Definition: lib.h:111
bool is_mailbox_list
Viewing mailboxes.
Definition: lib.h:117
struct BrowserStateEntry entry
Array of files / dirs / mailboxes.
Definition: lib.h:112
A folder/dir in the browser.
Definition: lib.h:64
struct FolderFile * ff
File / Dir / Mailbox.
Definition: lib.h:65
+ 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() -.

See also
$attach_format, attach_format_str()

Definition at line 218 of file attach.c.

219{
220 struct ComposeAttachData *adata = menu->mdata;
221 struct AttachCtx *actx = adata->actx;
222 struct ComposeSharedData *shared = menu->win->parent->wdata;
223 struct ConfigSubset *sub = shared->sub;
224
225 const char *const c_attach_format = cs_subset_string(sub, "attach_format");
226 mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_attach_format),
227 attach_format_str, (intptr_t) (actx->idx[actx->v2r[line]]),
229}
#define MUTT_FORMAT_STAT_FILE
Used by attach_format_str.
Definition: format_flags.h:34
Data to fill the Compose Attach Window.
Definition: attach_data.h:33
struct Menu * menu
Menu displaying the attachments.
Definition: attach_data.h:35
struct AttachCtx * actx
Set of attachments.
Definition: attach_data.h:34
Shared Compose Data.
Definition: shared_data.h:33
struct ConfigSubset * sub
Config set to use.
Definition: shared_data.h:34
A set of inherited config items.
Definition: subset.h:47
void * wdata
Private data.
Definition: mutt_window.h:145
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:135
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cert_make_entry()

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

Create a string to display in a Menu - Implements Menu::make_entry() -.

Definition at line 136 of file dlg_verifycert.c.

137{
138 struct CertMenuData *mdata = menu->mdata;
139
140 menu->current = -1; /* hide menubar */
141
142 const char **line_ptr = ARRAY_GET(mdata->carr, line);
143 if (!line_ptr)
144 {
145 buf[0] = '\0';
146 return;
147 }
148
149 mutt_str_copy(buf, *line_ptr, buflen);
150}
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:652
Certificate data to use in the Menu.
Definition: ssl.h:42
struct CertArray * carr
Lines of the Certificate.
Definition: ssl.h:43
int current
Current entry.
Definition: lib.h:70
+ 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() -.

See also
history_format_str()

Definition at line 114 of file dlg_history.c.

115{
116 char *entry = ((char **) menu->mdata)[line];
117
118 mutt_expando_format(buf, buflen, 0, menu->win->state.cols, "%s", history_format_str,
119 (intptr_t) entry, MUTT_FORMAT_ARROWCURSOR);
120}
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 -.
Definition: dlg_history.c:92
+ 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 803 of file dlg_index.c.

804{
805 buf[0] = '\0';
806
807 if (!menu || !menu->mdata)
808 return;
809
810 struct IndexPrivateData *priv = menu->mdata;
811 struct IndexSharedData *shared = priv->shared;
812 struct Mailbox *m = shared->mailbox;
813 if (!shared->mailboxview)
814 menu->current = -1;
815
816 if (!m || (line < 0) || (line >= m->email_max))
817 return;
818
819 struct Email *e = mutt_get_virt_email(m, line);
820 if (!e)
821 return;
822
824 struct MuttThread *tmp = NULL;
825
826 const enum UseThreads c_threads = mutt_thread_style();
827 if ((c_threads > UT_FLAT) && e->tree && e->thread)
828 {
829 flags |= MUTT_FORMAT_TREE; /* display the thread tree */
830 if (e->display_subject)
831 flags |= MUTT_FORMAT_FORCESUBJ;
832 else
833 {
834 const bool reverse = c_threads == UT_REVERSE;
835 int edgemsgno;
836 if (reverse)
837 {
838 if (menu->top + menu->page_len > menu->max)
839 edgemsgno = m->v2r[menu->max - 1];
840 else
841 edgemsgno = m->v2r[menu->top + menu->page_len - 1];
842 }
843 else
844 edgemsgno = m->v2r[menu->top];
845
846 for (tmp = e->thread->parent; tmp; tmp = tmp->parent)
847 {
848 if (!tmp->message)
849 continue;
850
851 /* if no ancestor is visible on current screen, provisionally force
852 * subject... */
853 if (reverse ? (tmp->message->msgno > edgemsgno) : (tmp->message->msgno < edgemsgno))
854 {
855 flags |= MUTT_FORMAT_FORCESUBJ;
856 break;
857 }
858 else if (tmp->message->vnum >= 0)
859 break;
860 }
861 if (flags & MUTT_FORMAT_FORCESUBJ)
862 {
863 for (tmp = e->thread->prev; tmp; tmp = tmp->prev)
864 {
865 if (!tmp->message)
866 continue;
867
868 /* ...but if a previous sibling is available, don't force it */
869 if (reverse ? (tmp->message->msgno > edgemsgno) : (tmp->message->msgno < edgemsgno))
870 break;
871 else if (tmp->message->vnum >= 0)
872 {
873 flags &= ~MUTT_FORMAT_FORCESUBJ;
874 break;
875 }
876 }
877 }
878 }
879 }
880
881 const char *const c_index_format = cs_subset_string(shared->sub, "index_format");
882 int msg_in_pager = shared->mailboxview ? shared->mailboxview->msg_in_pager : 0;
883 mutt_make_string(buf, buflen, menu->win->state.cols, NONULL(c_index_format),
884 m, msg_in_pager, e, flags, NULL);
885}
#define MUTT_FORMAT_FORCESUBJ
Print the subject even if unchanged.
Definition: format_flags.h:31
#define MUTT_FORMAT_INDEX
This is a main index entry.
Definition: format_flags.h:36
#define MUTT_FORMAT_TREE
Draw the thread tree.
Definition: format_flags.h:32
uint8_t MuttFormatFlags
Flags for mutt_expando_format(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: format_flags.h:29
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:1405
enum UseThreads mutt_thread_style(void)
Which threading style is active?
Definition: mutt_thread.c:89
UseThreads
Which threading style is active, $use_threads.
Definition: mutt_thread.h:83
@ UT_FLAT
Unthreaded.
Definition: mutt_thread.h:85
@ UT_REVERSE
Reverse threading (subthreads above root)
Definition: mutt_thread.h:87
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
Definition: mview.c:414
The envelope/body of an email.
Definition: email.h:37
bool display_subject
Used for threading.
Definition: email.h:101
char * tree
Character string to print thread tree.
Definition: email.h:125
int vnum
Virtual message number.
Definition: email.h:114
int msgno
Number displayed to the user.
Definition: email.h:111
struct MuttThread * thread
Thread of Emails.
Definition: email.h:119
Private state data for the Index.
Definition: private_data.h:35
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:42
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:43
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
struct MailboxView * mailboxview
Current Mailbox view.
Definition: shared_data.h:39
struct Mailbox * mailbox
Current Mailbox.
Definition: shared_data.h:41
struct ConfigSubset * sub
Config set to use.
Definition: shared_data.h:38
int msg_in_pager
Message currently shown in the pager.
Definition: mview.h:43
A mailbox.
Definition: mailbox.h:79
int * v2r
Mapping from virtual to real msgno.
Definition: mailbox.h:98
int email_max
Number of pointers in emails.
Definition: mailbox.h:97
int top
Entry that is the top of the current page.
Definition: lib.h:80
int max
Number of entries in the menu.
Definition: lib.h:71
int page_len
Number of entries per screen.
Definition: lib.h:74
An Email conversation.
Definition: thread.h:35
struct MuttThread * parent
Parent of this Thread.
Definition: thread.h:45
struct MuttThread * prev
Previous sibling Thread.
Definition: thread.h:48
struct Email * message
Email this Thread refers to.
Definition: thread.h:49
+ 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() -.

See also
$mix_entry_format, mix_format_str()

Definition at line 190 of file win_hosts.c.

191{
192 struct RemailerArray *ra = menu->mdata;
193 struct Remailer **r = ARRAY_GET(ra, num);
194 if (!r)
195 return;
196
197 const char *const c_mix_entry_format = cs_subset_string(NeoMutt->sub, "mix_entry_format");
198 mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_mix_entry_format),
200}
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 -.
Definition: win_hosts.c:119
A Mixmaster remailer.
Definition: remailer.h:40
int num
Index number.
Definition: remailer.h:41
+ 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() -.

See also
$pgp_entry_format, crypt_format_str()

Definition at line 573 of file dlg_gpgme.c.

574{
575 struct CryptKeyInfo **key_table = menu->mdata;
576 struct CryptEntry entry;
577
578 entry.key = key_table[line];
579 entry.num = line + 1;
580
581 const char *const c_pgp_entry_format = cs_subset_string(NeoMutt->sub, "pgp_entry_format");
582 mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_pgp_entry_format),
583 crypt_format_str, (intptr_t) &entry, MUTT_FORMAT_ARROWCURSOR);
584}
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 -.
Definition: dlg_gpgme.c:361
An entry in the Select-Key menu.
Definition: dlg_gpgme.c:108
struct CryptKeyInfo * key
Key.
Definition: dlg_gpgme.c:110
A stored PGP key.
Definition: crypt_gpgme.h:44
+ 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() -.

See also
$pgp_entry_format, pgp_entry_format_str()

Definition at line 500 of file dlg_pgp.c.

501{
502 struct PgpUid **key_table = menu->mdata;
503 struct PgpEntry entry;
504
505 entry.uid = key_table[line];
506 entry.num = line + 1;
507
508 const char *const c_pgp_entry_format = cs_subset_string(NeoMutt->sub, "pgp_entry_format");
509 mutt_expando_format(buf, buflen, 0, menu->win->state.cols,
510 NONULL(c_pgp_entry_format), pgp_entry_format_str,
511 (intptr_t) &entry, MUTT_FORMAT_ARROWCURSOR);
512}
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:339
An entry in a PGP key menu.
Definition: dlg_pgp.c:108
struct PgpUid * uid
Definition: dlg_pgp.c:110
PGP User ID.
Definition: pgplib.h:35
+ 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 111 of file dlg_smime.c.

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

See also
$pattern_format, pattern_format_str()

Definition at line 139 of file dlg_pattern.c.

140{
141 struct PatternEntry *entry = &((struct PatternEntry *) menu->mdata)[num];
142
143 const char *const c_pattern_format = cs_subset_string(NeoMutt->sub, "pattern_format");
144 mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(c_pattern_format),
146}
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 -.
Definition: dlg_pattern.c:107
A line in the Pattern Completion menu.
Definition: private.h:34
int num
Index number.
Definition: private.h:35
+ 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 101 of file dlg_postpone.c.

102{
103 struct Mailbox *m = menu->mdata;
104
105 const char *const c_index_format = cs_subset_string(NeoMutt->sub, "index_format");
106 mutt_make_string(buf, buflen, menu->win->state.cols, NONULL(c_index_format),
107 m, -1, m->emails[line], MUTT_FORMAT_ARROWCURSOR, NULL);
108}
struct Email ** emails
Array of Emails.
Definition: mailbox.h:96
+ Here is the call graph for this function:
+ Here is the caller graph for this function: