#include "opcodes.h"
/**
- * struct Entry - An entry in the Autocrypt account Menu
+ * struct AccountEntry - An entry in the Autocrypt account Menu
*/
-struct Entry
+struct AccountEntry
{
int tagged; /* TODO */
int num;
const char *ifstring, const char *elsestring,
unsigned long data, MuttFormatFlags flags)
{
- struct Entry *entry = (struct Entry *) data;
+ struct AccountEntry *entry = (struct AccountEntry *) data;
char tmp[128];
switch (op)
*/
static void account_entry(char *buf, size_t buflen, struct Menu *menu, int num)
{
- struct Entry *entry = &((struct Entry *) menu->data)[num];
+ struct AccountEntry *entry = &((struct AccountEntry *) menu->data)[num];
mutt_expando_format(buf, buflen, 0, menu->indexwin->cols,
NONULL(C_AutocryptAcctFormat), account_format_str,
char *helpstr = mutt_mem_malloc(256);
menu->help = mutt_compile_help(helpstr, 256, MENU_AUTOCRYPT_ACCT, AutocryptAcctHelp);
- struct Entry *entries = mutt_mem_calloc(num_accounts, sizeof(struct Entry));
+ struct AccountEntry *entries =
+ mutt_mem_calloc(num_accounts, sizeof(struct AccountEntry));
menu->data = entries;
menu->max = num_accounts;
*/
static void free_menu(struct Menu **menu)
{
- struct Entry *entries = (struct Entry *) (*menu)->data;
+ struct AccountEntry *entries = (struct AccountEntry *) (*menu)->data;
for (int i = 0; i < (*menu)->max; i++)
{
* toggle_active - Toggle whether an Autocrypt account is active
* @param entry Menu Entry for the account
*/
-static void toggle_active(struct Entry *entry)
+static void toggle_active(struct AccountEntry *entry)
{
entry->account->enabled = !entry->account->enabled;
if (mutt_autocrypt_db_account_update(entry->account) != 0)
* toggle_prefer_encrypt - Toggle whether an Autocrypt account prefers encryption
* @param entry Menu Entry for the account
*/
-static void toggle_prefer_encrypt(struct Entry *entry)
+static void toggle_prefer_encrypt(struct AccountEntry *entry)
{
entry->account->prefer_encrypt = !entry->account->prefer_encrypt;
if (mutt_autocrypt_db_account_update(entry->account))
case OP_AUTOCRYPT_DELETE_ACCT:
if (menu->data)
{
- struct Entry *entry = (struct Entry *) (menu->data) + menu->current;
+ struct AccountEntry *entry = (struct AccountEntry *) (menu->data) + menu->current;
char msg[128];
snprintf(msg, sizeof(msg),
// L10N: Confirmation message when deleting an autocrypt account
case OP_AUTOCRYPT_TOGGLE_ACTIVE:
if (menu->data)
{
- struct Entry *entry = (struct Entry *) (menu->data) + menu->current;
+ struct AccountEntry *entry = (struct AccountEntry *) (menu->data) + menu->current;
toggle_active(entry);
menu->redraw |= REDRAW_FULL;
}
case OP_AUTOCRYPT_TOGGLE_PREFER:
if (menu->data)
{
- struct Entry *entry = (struct Entry *) (menu->data) + menu->current;
+ struct AccountEntry *entry = (struct AccountEntry *) (menu->data) + menu->current;
toggle_prefer_encrypt(entry);
menu->redraw |= REDRAW_FULL;
}
};
/**
- * struct Entry - An entry in a selectable list of Query's
+ * struct QueryEntry - An entry in a selectable list of Query's
*/
-struct Entry
+struct QueryEntry
{
bool tagged;
struct Query *data;
*/
static int query_search(struct Menu *menu, regex_t *rx, int line)
{
- struct Entry *table = menu->data;
+ struct QueryEntry *table = menu->data;
struct Query *query = table[line].data;
if (query->name && !regexec(rx, query->name, 0, NULL, 0))
const char *if_str, const char *else_str,
unsigned long data, MuttFormatFlags flags)
{
- struct Entry *entry = (struct Entry *) data;
+ struct QueryEntry *entry = (struct QueryEntry *) data;
struct Query *query = entry->data;
char fmt[128];
char tmp[256] = { 0 };
*/
static void query_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
{
- struct Entry *entry = &((struct Entry *) menu->data)[line];
+ struct QueryEntry *entry = &((struct QueryEntry *) menu->data)[line];
entry->data->num = line;
mutt_expando_format(buf, buflen, 0, menu->indexwin->cols, NONULL(C_QueryFormat),
*/
static int query_tag(struct Menu *menu, int sel, int act)
{
- struct Entry *cur = &((struct Entry *) menu->data)[sel];
+ struct QueryEntry *cur = &((struct QueryEntry *) menu->data)[sel];
bool ot = cur->tagged;
cur->tagged = ((act >= 0) ? act : !cur->tagged);
static void query_menu(char *buf, size_t buflen, struct Query *results, bool retbuf)
{
struct Menu *menu = NULL;
- struct Entry *query_table = NULL;
+ struct QueryEntry *query_table = NULL;
struct Query *queryp = NULL;
char title[256];
for (queryp = results; queryp; queryp = queryp->next)
menu->max++;
- query_table = mutt_mem_calloc(menu->max, sizeof(struct Entry));
+ query_table = mutt_mem_calloc(menu->max, sizeof(struct QueryEntry));
menu->data = query_table;
queryp = results;
if (op == OP_QUERY)
{
menu->data = query_table =
- mutt_mem_calloc(menu->max, sizeof(struct Entry));
+ mutt_mem_calloc(menu->max, sizeof(struct QueryEntry));
queryp = results;
for (int i = 0; queryp; queryp = queryp->next, i++)
bool clear = false;
/* append */
- mutt_mem_realloc(&query_table, menu->max * sizeof(struct Entry));
+ mutt_mem_realloc(&query_table, menu->max * sizeof(struct QueryEntry));
menu->data = query_table;