]> granicus.if.org Git - neomutt/commitdiff
expand global bools,quadoptions
authorRichard Russon <rich@flatcap.org>
Sun, 29 Oct 2017 23:22:40 +0000 (23:22 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 28 Dec 2017 20:16:24 +0000 (20:16 +0000)
Replace the packed array of booleans with separate `bool`s.

84 files changed:
addrbook.c
alias.c
attach.c
browser.c
buffy.c
color.c
commands.c
complete.c
compose.c
compress.c
conn/sasl.c
conn/socket.c
conn/ssl.c
conn/ssl_gnutls.c
copy.c
curs_lib.c
curs_main.c
edit.c
editmsg.c
flags.c
globals.h
handler.c
hcache/kc.c
hcache/qdbm.c
hcache/tc.c
hdrline.c
header.c
help.c
history.c
hook.c
imap/browse.c
imap/command.c
imap/imap.c
imap/message.c
imap/util.c
init.c
init.h
keymap.c
main.c
mbox.c
menu.c
mh.c
mutt.h
mutt_account.c
mutt_curses.h
mutt_idna.c
mutt_lua.c
mutt_signal.c
muttlib.c
mx.c
ncrypt/crypt.c
ncrypt/crypt_gpgme.c
ncrypt/cryptglue.c
ncrypt/gnupgparse.c
ncrypt/pgp.c
ncrypt/pgpkey.c
ncrypt/smime.c
newsrc.c
nntp.c
options.h
pager.c
parse.c
pattern.c
pop.c
pop_auth.c
pop_lib.c
postpone.c
protos.h
recvattach.c
recvcmd.c
remailer.c
rfc1524.c
rfc2047.c
rfc2231.c
rfc3676.c
score.c
send.c
sendlib.c
sidebar.c
signal.c [new file with mode: 0644]
smtp.c
sort.c
status.c
thread.c

index c75e1c1c844e08cea8d6910a3df5b43e80479334..ea6cad7c074ed6bbbe111046162e8791c32f8fc3 100644 (file)
@@ -248,7 +248,7 @@ new_aliases:
         {
           AliasTable[menu->current]->del = (op == OP_DELETE);
           menu->redraw |= REDRAW_CURRENT;
-          if (option(OPT_RESOLVE) && menu->current < menu->max - 1)
+          if (OPT_RESOLVE && menu->current < menu->max - 1)
           {
             menu->current++;
             menu->redraw |= REDRAW_INDEX;
diff --git a/alias.c b/alias.c
index d97feb56ab71bdce20894c1c6678a6ee12abf479..a3e1509ebb78d284abbfb52fcb4f89ae43672abf 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -123,7 +123,7 @@ static struct Address *expand_aliases_r(struct Address *a, struct ListHead *expn
     last->next = NULL;
   }
 
-  if (option(OPT_USE_DOMAIN) && (fqdn = mutt_fqdn(1)))
+  if (OPT_USE_DOMAIN && (fqdn = mutt_fqdn(1)))
   {
     /* now qualify all local addresses */
     mutt_addr_qualify(head, fqdn);
index 6fab3a185539e626e9b6357c76d3232b9e15f327..466740637f07cb7c5dc4041a82591ce78ca0f727 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -523,7 +523,7 @@ int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr,
                    _("---Command: %-30.30s Attachment: %s"), command, type);
       }
 
-      if ((mutt_wait_filter(thepid) || (entry->needsterminal && option(OPT_WAIT_KEY))) && !use_pager)
+      if ((mutt_wait_filter(thepid) || (entry->needsterminal && OPT_WAIT_KEY)) && !use_pager)
         mutt_any_key_to_continue(NULL);
 
       if (tempfd != -1)
@@ -538,7 +538,7 @@ int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr,
       if (rv == -1)
         mutt_debug(1, "Error running \"%s\"!", command);
 
-      if ((rv != 0) || (entry->needsterminal && option(OPT_WAIT_KEY)))
+      if ((rv != 0) || (entry->needsterminal && OPT_WAIT_KEY))
         mutt_any_key_to_continue(NULL);
     }
   }
@@ -587,14 +587,14 @@ int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr,
     else
     {
       /* Use built-in handler */
-      set_option(OPT_VIEW_ATTACH); /* disable the "use 'v' to view this part"
+      OPT_VIEW_ATTACH = true; /* disable the "use 'v' to view this part"
                                    * message in case of error */
       if (mutt_decode_save_attachment(fp, a, pagerfile, MUTT_DISPLAY, 0))
       {
-        unset_option(OPT_VIEW_ATTACH);
+        OPT_VIEW_ATTACH = false;
         goto return_error;
       }
-      unset_option(OPT_VIEW_ATTACH);
+      OPT_VIEW_ATTACH = false;
     }
 
     if (a->description)
@@ -741,7 +741,7 @@ bail:
   if (mutt_wait_filter(thepid) != 0)
     rc = 0;
 
-  if (rc == 0 || option(OPT_WAIT_KEY))
+  if (rc == 0 || OPT_WAIT_KEY)
     mutt_any_key_to_continue(NULL);
   return rc;
 }
@@ -1056,7 +1056,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
       mutt_file_copy_stream(ifp, fpout);
       mutt_file_fclose(&fpout);
       mutt_file_fclose(&ifp);
-      if (mutt_wait_filter(thepid) || option(OPT_WAIT_KEY))
+      if (mutt_wait_filter(thepid) || OPT_WAIT_KEY)
         mutt_any_key_to_continue(NULL);
     }
     else
@@ -1065,7 +1065,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
       if (rc == -1)
         mutt_debug(1, "Error running \"%s\"!", command);
 
-      if ((rc != 0) || option(OPT_WAIT_KEY))
+      if ((rc != 0) || OPT_WAIT_KEY)
         mutt_any_key_to_continue(NULL);
     }
 
@@ -1121,7 +1121,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
       mutt_file_fclose(&fpout);
       mutt_file_fclose(&ifp);
 
-      if (mutt_wait_filter(thepid) != 0 || option(OPT_WAIT_KEY))
+      if (mutt_wait_filter(thepid) != 0 || OPT_WAIT_KEY)
         mutt_any_key_to_continue(NULL);
       rc = 1;
     }
index b3a623a81060e8a8805ad94524e68b88b4d9e9b2..3492371db293a16578b419c69ffe9c91d64113b5 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -249,7 +249,7 @@ static void browser_sort(struct BrowserState *state)
 #ifdef USE_NNTP
     case SORT_SIZE:
     case SORT_DATE:
-      if (option(OPT_NEWS))
+      if (OPT_NEWS)
         return;
 #endif
     default:
@@ -641,8 +641,7 @@ static const char *group_index_format_str(char *buf, size_t buflen, size_t col,
         snprintf(fmt, sizeof(fmt), "%%%sd", prec);
         snprintf(buf, buflen, fmt, Context->new);
       }
-      else if (option(OPT_MARK_OLD) &&
-               folder->ff->nd->last_cached >= folder->ff->nd->first_message &&
+      else if (OPT_MARK_OLD && folder->ff->nd->last_cached >= folder->ff->nd->first_message &&
                folder->ff->nd->last_cached <= folder->ff->nd->last_message)
       {
         snprintf(fmt, sizeof(fmt), "%%%sd", prec);
@@ -699,7 +698,7 @@ static void add_folder(struct Menu *m, struct BrowserState *state, const char *n
   (state->entry)[state->entrylen].imap = false;
 #endif
 #ifdef USE_NNTP
-  if (option(OPT_NEWS))
+  if (OPT_NEWS)
     (state->entry)[state->entrylen].nd = (struct NntpData *) data;
 #endif
   (state->entrylen)++;
@@ -724,7 +723,7 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state,
                              char *d, const char *prefix)
 {
 #ifdef USE_NNTP
-  if (option(OPT_NEWS))
+  if (OPT_NEWS)
   {
     struct NntpServer *nserv = CurrentNewsSrv;
 
@@ -855,7 +854,7 @@ static int examine_mailboxes(struct Menu *menu, struct BrowserState *state)
   char buffer[LONG_STRING];
 
 #ifdef USE_NNTP
-  if (option(OPT_NEWS))
+  if (OPT_NEWS)
   {
     struct NntpServer *nserv = CurrentNewsSrv;
 
@@ -864,9 +863,8 @@ static int examine_mailboxes(struct Menu *menu, struct BrowserState *state)
     for (unsigned int i = 0; i < nserv->groups_num; i++)
     {
       struct NntpData *nntp_data = nserv->groups_list[i];
-      if (nntp_data &&
-          (nntp_data->new || (nntp_data->subscribed &&
-                              (nntp_data->unread || !option(OPT_SHOW_ONLY_UNREAD)))))
+      if (nntp_data && (nntp_data->new || (nntp_data->subscribed &&
+                                           (nntp_data->unread || !OPT_SHOW_ONLY_UNREAD))))
         add_folder(menu, state, nntp_data->group, NULL, NULL, NULL, nntp_data);
     }
   }
@@ -944,7 +942,7 @@ static int examine_mailboxes(struct Menu *menu, struct BrowserState *state)
 static int select_file_search(struct Menu *menu, regex_t *re, int n)
 {
 #ifdef USE_NNTP
-  if (option(OPT_NEWS))
+  if (OPT_NEWS)
     return (regexec(re, ((struct FolderFile *) menu->data)[n].desc, 0, NULL, 0));
 #endif
   return (regexec(re, ((struct FolderFile *) menu->data)[n].name, 0, NULL, 0));
@@ -972,7 +970,7 @@ static void folder_entry(char *buf, size_t buflen, struct Menu *menu, int num)
   folder.num = num;
 
 #ifdef USE_NNTP
-  if (option(OPT_NEWS))
+  if (OPT_NEWS)
     mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols,
                         NONULL(GroupIndexFormat), group_index_format_str,
                         (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR);
@@ -1045,7 +1043,7 @@ static void init_menu(struct BrowserState *state, struct Menu *menu,
   menu->tagged = 0;
 
 #ifdef USE_NNTP
-  if (option(OPT_NEWS))
+  if (OPT_NEWS)
   {
     if (buffy)
       snprintf(title, titlelen, _("Subscribed newsgroups"));
@@ -1172,7 +1170,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
   memset(&state, 0, sizeof(struct BrowserState));
 
 #ifdef USE_NNTP
-  if (option(OPT_NEWS))
+  if (OPT_NEWS)
   {
     if (*f)
       mutt_str_strfcpy(prefix, f, sizeof(prefix));
@@ -1389,9 +1387,9 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
 
   menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_FOLDER,
 #ifdef USE_NNTP
-                                 option(OPT_NEWS) ? FolderNewsHelp :
+                                 OPT_NEWS ? FolderNewsHelp :
 #endif
-                                                    FolderHelp);
+                                            FolderHelp);
   mutt_push_current_menu(menu);
 
   init_menu(&state, menu, title, sizeof(title), buffy);
@@ -1530,7 +1528,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
           }
         }
 
-        if (buffy || option(OPT_NEWS)) /* USE_NNTP */
+        if (buffy || OPT_NEWS) /* USE_NNTP */
         {
           mutt_str_strfcpy(f, state.entry[menu->current].name, flen);
           mutt_expand_path(f, flen);
@@ -1590,10 +1588,10 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
 
 #ifdef USE_IMAP
       case OP_BROWSER_TOGGLE_LSUB:
-        if (option(OPT_IMAP_LIST_SUBSCRIBED))
-          unset_option(OPT_IMAP_LIST_SUBSCRIBED);
+        if (OPT_IMAP_LIST_SUBSCRIBED)
+          OPT_IMAP_LIST_SUBSCRIBED = false;
         else
-          set_option(OPT_IMAP_LIST_SUBSCRIBED);
+          OPT_IMAP_LIST_SUBSCRIBED = true;
 
         mutt_unget_event(0, OP_CHECK_NEW);
         break;
@@ -1687,7 +1685,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
       case OP_CHANGE_DIRECTORY:
 
 #ifdef USE_NNTP
-        if (option(OPT_NEWS))
+        if (OPT_NEWS)
           break;
 #endif
 
@@ -2007,7 +2005,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
 #ifdef USE_NNTP
       case OP_CATCHUP:
       case OP_UNCATCHUP:
-        if (option(OPT_NEWS))
+        if (OPT_NEWS)
         {
           struct FolderFile *ff = &state.entry[menu->current];
           int rc;
@@ -2036,7 +2034,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
         break;
 
       case OP_LOAD_ACTIVE:
-        if (option(OPT_NEWS))
+        if (OPT_NEWS)
         {
           struct NntpServer *nserv = CurrentNewsSrv;
 
@@ -2070,7 +2068,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
 #ifdef USE_NNTP
       case OP_SUBSCRIBE_PATTERN:
       case OP_UNSUBSCRIBE_PATTERN:
-        if (option(OPT_NEWS))
+        if (OPT_NEWS)
         {
           struct NntpServer *nserv = CurrentNewsSrv;
           regex_t rx;
diff --git a/buffy.c b/buffy.c
index d6982ad32f87b73a2a940e3deaa7f1763fa44fc5..79c71affd7240fd6de91cb58868def4ee1ba64f2 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -205,7 +205,7 @@ static int buffy_maildir_check_dir(struct Buffy *mailbox, const char *dir_name,
   /* when $mail_check_recent is set, if the new/ directory hasn't been modified since
    * the user last exited the mailbox, then we know there is no recent mail.
    */
-  if (check_new && option(OPT_MAIL_CHECK_RECENT))
+  if (check_new && OPT_MAIL_CHECK_RECENT)
   {
     if (stat(path, &sb) == 0 && sb.st_mtime < mailbox->last_visited)
     {
@@ -245,7 +245,7 @@ static int buffy_maildir_check_dir(struct Buffy *mailbox, const char *dir_name,
         mailbox->msg_unread++;
       if (check_new)
       {
-        if (option(OPT_MAIL_CHECK_RECENT))
+        if (OPT_MAIL_CHECK_RECENT)
         {
           snprintf(msgpath, sizeof(msgpath), "%s/%s", path, de->d_name);
           /* ensure this message was received since leaving this mailbox */
@@ -286,7 +286,7 @@ static int buffy_maildir_check(struct Buffy *mailbox, bool check_stats)
 
   rc = buffy_maildir_check_dir(mailbox, "new", check_new, check_stats);
 
-  check_new = !rc && option(OPT_MAILDIR_CHECK_CUR);
+  check_new = !rc && OPT_MAILDIR_CHECK_CUR;
   if (check_new || check_stats)
     if (buffy_maildir_check_dir(mailbox, "cur", check_new, check_stats))
       rc = 1;
@@ -307,7 +307,7 @@ static int buffy_mbox_check(struct Buffy *mailbox, struct stat *sb, bool check_s
   int new_or_changed;
   struct Context ctx;
 
-  if (option(OPT_CHECK_MBOX_SIZE))
+  if (OPT_CHECK_MBOX_SIZE)
     new_or_changed = sb->st_size > mailbox->size;
   else
     new_or_changed = sb->st_mtime > sb->st_atime ||
@@ -316,13 +316,13 @@ static int buffy_mbox_check(struct Buffy *mailbox, struct stat *sb, bool check_s
 
   if (new_or_changed)
   {
-    if (!option(OPT_MAIL_CHECK_RECENT) || sb->st_mtime > mailbox->last_visited)
+    if (!OPT_MAIL_CHECK_RECENT || sb->st_mtime > mailbox->last_visited)
     {
       rc = 1;
       mailbox->new = true;
     }
   }
-  else if (option(OPT_CHECK_MBOX_SIZE))
+  else if (OPT_CHECK_MBOX_SIZE)
   {
     /* some other program has deleted mail from the folder */
     mailbox->size = (off_t) sb->st_size;
@@ -439,7 +439,7 @@ static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_st
 #endif
     }
   }
-  else if (option(OPT_CHECK_MBOX_SIZE) && Context && Context->path)
+  else if (OPT_CHECK_MBOX_SIZE && Context && Context->path)
     tmp->size = (off_t) sb.st_size; /* update the size of current folder */
 
 #ifdef USE_SIDEBAR
@@ -489,7 +489,7 @@ void mutt_buffy_cleanup(const char *buf, struct stat *st)
 {
   struct utimbuf ut;
 
-  if (option(OPT_CHECK_MBOX_SIZE))
+  if (OPT_CHECK_MBOX_SIZE)
   {
     struct Buffy *b = mutt_find_mailbox(buf);
     if (b && !b->new)
@@ -617,8 +617,7 @@ int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s,
        * reading it), the size is set to 0 so that later when we check we see
        * that it increased. without check_mbox_size we probably don't care.
        */
-      if (option(OPT_CHECK_MBOX_SIZE) && stat((*b)->path, &sb) == 0 &&
-          !test_new_folder((*b)->path))
+      if (OPT_CHECK_MBOX_SIZE && stat((*b)->path, &sb) == 0 && !test_new_folder((*b)->path))
       {
         /* some systems out there don't have an off_t type */
         (*b)->size = (off_t) sb.st_size;
@@ -716,7 +715,7 @@ int mutt_buffy_check(bool force)
   if (!force && (t - BuffyTime < MailCheck))
     return BuffyCount;
 
-  if (option(OPT_MAIL_CHECK_STATS) && (t - BuffyStatsTime >= MailCheckStatsInterval))
+  if (OPT_MAIL_CHECK_STATS && (t - BuffyStatsTime >= MailCheckStatsInterval))
   {
     check_stats = true;
     BuffyStatsTime = t;
diff --git a/color.c b/color.c
index d4bf03550e00969707db4300f7dd4bec16a68277..74224dcdefa7e07779090ff8d1763e571770e8e2 100644 (file)
--- a/color.c
+++ b/color.c
@@ -398,8 +398,7 @@ static int parse_color_name(const char *s, int *col, int *attr, int is_fg, struc
   {
     s += 5;
     *col = strtol(s, &eptr, 10);
-    if (!*s || *eptr || *col < 0 ||
-        (*col >= COLORS && !option(OPT_NO_CURSES) && has_colors()))
+    if (!*s || *eptr || *col < 0 || (*col >= COLORS && !OPT_NO_CURSES && has_colors()))
     {
       snprintf(err->data, err->dsize, _("%s: color not supported by term"), s);
       return -1;
@@ -530,7 +529,7 @@ static int parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long dat
   if (
 #ifdef HAVE_COLOR
       /* we're running without curses */
-      option(OPT_NO_CURSES) || /* we're parsing an uncolor command, and have no colors */
+      OPT_NO_CURSES || /* we're parsing an uncolor command, and have no colors */
       (parse_uncolor && !has_colors())
       /* we're parsing an unmono command, and have colors */
       || (!parse_uncolor && has_colors())
@@ -565,7 +564,7 @@ static int parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long dat
   else if (object == MT_COLOR_INDEX_TAG)
     do_uncolor(buf, s, &ColorIndexTagList, &do_cache, parse_uncolor);
 
-  if (do_cache && !option(OPT_NO_CURSES))
+  if (do_cache && !OPT_NO_CURSES)
   {
     mutt_set_menu_redraw_full(MENU_MAIN);
     /* force re-caching of index colors */
@@ -872,7 +871,7 @@ static int parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer *err,
 
 #ifdef HAVE_COLOR
 #ifdef HAVE_USE_DEFAULT_COLORS
-  if (!option(OPT_NO_CURSES) && has_colors()
+  if (!OPT_NO_CURSES && has_colors()
       /* delay use_default_colors() until needed, since it initializes things */
       && (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT || object == MT_COLOR_TREE) &&
       use_default_colors() != OK)
@@ -986,7 +985,7 @@ int mutt_parse_color(struct Buffer *buf, struct Buffer *s, unsigned long data,
 {
   bool dry_run = false;
 
-  if (option(OPT_NO_CURSES) || !has_colors())
+  if (OPT_NO_CURSES || !has_colors())
     dry_run = true;
 
   return parse_color(buf, s, err, parse_color_pair, dry_run);
@@ -1000,10 +999,10 @@ int mutt_parse_mono(struct Buffer *buf, struct Buffer *s, unsigned long data,
   bool dry_run = false;
 
 #ifdef HAVE_COLOR
-  if (option(OPT_NO_CURSES) || has_colors())
+  if (OPT_NO_CURSES || has_colors())
     dry_run = true;
 #else
-  if (option(OPT_NO_CURSES))
+  if (OPT_NO_CURSES)
     dry_run = true;
 #endif
 
index 9121da133037b676d979af7ab9d81bb08e64329e..0fdaf9f9ecea60388badf1f8dd8a3560f23ed3f4 100644 (file)
@@ -162,7 +162,7 @@ int mutt_display_message(struct Header *cur)
     fputs("\n\n", fpout);
   }
 
-  chflags = (option(OPT_WEED) ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_FROM | CH_DISPLAY;
+  chflags = (OPT_WEED ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_FROM | CH_DISPLAY;
 #ifdef USE_NOTMUCH
   if (Context->magic == MUTT_NOTMUCH)
     chflags |= CH_VIRTUAL;
@@ -242,11 +242,11 @@ int mutt_display_message(struct Header *cur)
     if (r == -1)
       mutt_error(_("Error running \"%s\"!"), buf);
     unlink(tempfile);
-    if (!option(OPT_NO_CURSES))
+    if (!OPT_NO_CURSES)
       keypad(stdscr, true);
     if (r != -1)
       mutt_set_flag(Context, cur, MUTT_READ, 1);
-    if (r != -1 && option(OPT_PROMPT_AFTER))
+    if (r != -1 && OPT_PROMPT_AFTER)
     {
       mutt_unget_event(mutt_any_key_to_continue(_("Command: ")), 0);
       rc = km_dokey(MENU_PAGER);
@@ -356,7 +356,7 @@ static void pipe_set_flags(int decode, int print, int *cmflags, int *chflags)
     *cmflags |= MUTT_CM_DECODE | MUTT_CM_CHARCONV;
     *chflags |= CH_DECODE | CH_REORDER;
 
-    if (option(OPT_WEED))
+    if (OPT_WEED)
     {
       *chflags |= CH_WEED;
       *cmflags |= MUTT_CM_WEED;
@@ -418,11 +418,11 @@ static int pipe_message(struct Header *h, char *cmd, int decode, int print,
       return 1;
     }
 
-    set_option(OPT_KEEP_QUIET);
+    OPT_KEEP_QUIET = true;
     pipe_msg(h, fpout, decode, print);
     mutt_file_fclose(&fpout);
     rc = mutt_wait_filter(thepid);
-    unset_option(OPT_KEEP_QUIET);
+    OPT_KEEP_QUIET = false;
   }
   else
   {
@@ -459,7 +459,7 @@ static int pipe_message(struct Header *h, char *cmd, int decode, int print,
           mutt_perror(_("Can't create filter process"));
           return 1;
         }
-        set_option(OPT_KEEP_QUIET);
+        OPT_KEEP_QUIET = true;
         pipe_msg(Context->hdrs[i], fpout, decode, print);
         /* add the message separator */
         if (sep)
@@ -467,7 +467,7 @@ static int pipe_message(struct Header *h, char *cmd, int decode, int print,
         mutt_file_fclose(&fpout);
         if (mutt_wait_filter(thepid) != 0)
           rc = 1;
-        unset_option(OPT_KEEP_QUIET);
+        OPT_KEEP_QUIET = false;
       }
     }
     else
@@ -479,7 +479,7 @@ static int pipe_message(struct Header *h, char *cmd, int decode, int print,
         mutt_perror(_("Can't create filter process"));
         return 1;
       }
-      set_option(OPT_KEEP_QUIET);
+      OPT_KEEP_QUIET = true;
       for (int i = 0; i < Context->msgcount; i++)
       {
         if (!message_is_tagged(Context, i))
@@ -494,11 +494,11 @@ static int pipe_message(struct Header *h, char *cmd, int decode, int print,
       mutt_file_fclose(&fpout);
       if (mutt_wait_filter(thepid) != 0)
         rc = 1;
-      unset_option(OPT_KEEP_QUIET);
+      OPT_KEEP_QUIET = false;
     }
   }
 
-  if (rc || option(OPT_WAIT_KEY))
+  if (rc || OPT_WAIT_KEY)
     mutt_any_key_to_continue(NULL);
   return rc;
 }
@@ -515,12 +515,12 @@ void mutt_pipe_message(struct Header *h)
   }
 
   mutt_expand_path(buffer, sizeof(buffer));
-  pipe_message(h, buffer, option(OPT_PIPE_DECODE), 0, option(OPT_PIPE_SPLIT), PipeSep);
+  pipe_message(h, buffer, OPT_PIPE_DECODE, 0, OPT_PIPE_SPLIT, PipeSep);
 }
 
 void mutt_print_message(struct Header *h)
 {
-  if (quadoption(OPT_PRINT) && (!PrintCommand || !*PrintCommand))
+  if (OPT_PRINT && (!PrintCommand || !*PrintCommand))
   {
     mutt_message(_("No printing command has been defined."));
     return;
@@ -530,8 +530,7 @@ void mutt_print_message(struct Header *h)
                        h ? _("Print message?") : _("Print tagged messages?")) != MUTT_YES)
     return;
 
-  if (pipe_message(h, PrintCommand, option(OPT_PRINT_DECODE), 1,
-                   option(OPT_PRINT_SPLIT), "\f") == 0)
+  if (pipe_message(h, PrintCommand, OPT_PRINT_DECODE, 1, OPT_PRINT_SPLIT, "\f") == 0)
     mutt_message(h ? _("Message printed") : _("Messages printed"));
   else
     mutt_message(h ? _("Message could not be printed") :
@@ -628,7 +627,7 @@ void mutt_shell_escape(void)
       if (rc == -1)
         mutt_debug(1, "Error running \"%s\"!", buf);
 
-      if ((rc != 0) || option(OPT_WAIT_KEY))
+      if ((rc != 0) || OPT_WAIT_KEY)
         mutt_any_key_to_continue(NULL);
       mutt_buffy_check(true);
     }
@@ -722,7 +721,7 @@ static void set_copy_flags(struct Header *hdr, int decode, int decrypt,
     {
       *chflags |= CH_DECODE; /* then decode RFC2047 headers, */
 
-      if (option(OPT_WEED))
+      if (OPT_WEED)
       {
         *chflags |= CH_WEED; /* and respect $weed. */
         *cmflags |= MUTT_CM_WEED;
@@ -750,7 +749,7 @@ int mutt_save_message_ctx(struct Header *h, int delete, int decode, int decrypt,
   {
     mutt_set_flag(Context, h, MUTT_DELETE, 1);
     mutt_set_flag(Context, h, MUTT_PURGE, 1);
-    if (option(OPT_DELETE_UNTAG))
+    if (OPT_DELETE_UNTAG)
       mutt_set_flag(Context, h, MUTT_TAG, 0);
   }
 
index e85429de3b1aa8de4adaf42b326fcfc2601a2c03..47cda133e5cddbf26c7accb7db2a7325516f7b9f 100644 (file)
@@ -64,7 +64,7 @@ int mutt_complete(char *s, size_t slen)
   mutt_debug(2, "completing %s\n", s);
 
 #ifdef USE_NNTP
-  if (option(OPT_NEWS))
+  if (OPT_NEWS)
   {
     struct NntpServer *nserv = CurrentNewsSrv;
     unsigned int n = 0;
index 78287348d110484499d5c43b4975c67bb69a5d7e..ee8e0103f3e8798291721e3b16ccc04968e9f4a8 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -289,7 +289,7 @@ static void redraw_crypt_lines(struct Header *msg)
       addstr(_(" (S/MIME)"));
   }
 
-  if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT) && (msg->security & OPPENCRYPT))
+  if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT && (msg->security & OPPENCRYPT))
     addstr(_(" (OppEnc mode)"));
 
   mutt_window_clrtoeol(MuttIndexWindow);
@@ -412,7 +412,7 @@ static void draw_envelope(struct Header *msg, char *fcc)
 {
   draw_envelope_addr(HDR_FROM, msg->env->from);
 #ifdef USE_NNTP
-  if (!option(OPT_NEWS_SEND))
+  if (!OPT_NEWS_SEND)
   {
 #endif
     draw_envelope_addr(HDR_TO, msg->env->to);
@@ -428,7 +428,7 @@ static void draw_envelope(struct Header *msg, char *fcc)
     mutt_window_mvprintw(MuttIndexWindow, HDR_CC, 0, "%*s",
                          HeaderPadding[HDR_FOLLOWUPTO], Prompts[HDR_FOLLOWUPTO]);
     mutt_paddstr(W, NONULL(msg->env->followup_to));
-    if (option(OPT_X_COMMENT_TO))
+    if (OPT_X_COMMENT_TO)
     {
       mutt_window_mvprintw(MuttIndexWindow, HDR_BCC, 0, "%*s",
                            HeaderPadding[HDR_XCOMMENTTO], Prompts[HDR_XCOMMENTTO]);
@@ -797,7 +797,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
 #ifdef USE_NNTP
   int news = 0; /* is it a news article ? */
 
-  if (option(OPT_NEWS_SEND))
+  if (OPT_NEWS_SEND)
     news++;
 #endif
 
@@ -827,7 +827,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
   while (loop)
   {
 #ifdef USE_NNTP
-    unset_option(OPT_NEWS); /* for any case */
+    OPT_NEWS = false; /* for any case */
 #endif
     switch (op = mutt_menu_loop(menu))
     {
@@ -841,7 +841,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
           break;
 #endif
         edit_address_list(HDR_TO, &msg->env->to);
-        if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+        if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
         {
           crypt_opportunistic_encrypt(msg);
           redraw_crypt_lines(msg);
@@ -854,7 +854,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
           break;
 #endif
         edit_address_list(HDR_BCC, &msg->env->bcc);
-        if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+        if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
         {
           crypt_opportunistic_encrypt(msg);
           redraw_crypt_lines(msg);
@@ -867,7 +867,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
           break;
 #endif
         edit_address_list(HDR_CC, &msg->env->cc);
-        if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+        if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
         {
           crypt_opportunistic_encrypt(msg);
           redraw_crypt_lines(msg);
@@ -912,7 +912,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
         }
         break;
       case OP_COMPOSE_EDIT_X_COMMENT_TO:
-        if (news && option(OPT_X_COMMENT_TO))
+        if (news && OPT_X_COMMENT_TO)
         {
           if (msg->env->x_comment_to)
             mutt_str_strfcpy(buf, msg->env->x_comment_to, sizeof(buf));
@@ -963,7 +963,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
         mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
         break;
       case OP_COMPOSE_EDIT_MESSAGE:
-        if (Editor && (mutt_str_strcmp("builtin", Editor) != 0) && !option(OPT_EDIT_HEADERS))
+        if (Editor && (mutt_str_strcmp("builtin", Editor) != 0) && !OPT_EDIT_HEADERS)
         {
           mutt_edit_file(Editor, msg->content->filename);
           mutt_update_encoding(msg->content);
@@ -974,8 +974,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
       /* fallthrough */
       case OP_COMPOSE_EDIT_HEADERS:
         if ((mutt_str_strcmp("builtin", Editor) != 0) &&
-            (op == OP_COMPOSE_EDIT_HEADERS ||
-             (op == OP_COMPOSE_EDIT_MESSAGE && option(OPT_EDIT_HEADERS))))
+            (op == OP_COMPOSE_EDIT_HEADERS || (op == OP_COMPOSE_EDIT_MESSAGE && OPT_EDIT_HEADERS)))
         {
           char *tag = NULL, *err = NULL;
           mutt_env_to_local(msg->env);
@@ -985,7 +984,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
             mutt_error(_("Bad IDN in \"%s\": '%s'"), tag, err);
             FREE(&err);
           }
-          if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+          if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
             crypt_opportunistic_encrypt(msg);
         }
         else
@@ -1082,7 +1081,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
         prompt = _("Open mailbox to attach message from");
 
 #ifdef USE_NNTP
-        unset_option(OPT_NEWS);
+        OPT_NEWS = false;
         if (op == OP_COMPOSE_ATTACH_NEWS_MESSAGE)
         {
           CurrentNewsSrv = nntp_select_server(NewsServer, false);
@@ -1090,7 +1089,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
             break;
 
           prompt = _("Open newsgroup to attach message from");
-          set_option(OPT_NEWS);
+          OPT_NEWS = true;
         }
 #endif
 
@@ -1107,7 +1106,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
           break;
 
 #ifdef USE_NNTP
-        if (option(OPT_NEWS))
+        if (OPT_NEWS)
           nntp_expand_path(fname, sizeof(fname), &CurrentNewsSrv->conn->account);
         else
 #endif
@@ -1119,7 +1118,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
           if (!mx_is_pop(fname))
 #endif
 #ifdef USE_NNTP
-            if (!mx_is_nntp(fname) && !option(OPT_NEWS))
+            if (!mx_is_nntp(fname) && !OPT_NEWS)
 #endif
               /* check to make sure the file exists and is readable */
               if (access(fname, R_OK) == -1)
@@ -1150,10 +1149,10 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
         old_sort_aux = SortAux;
 
         Context = ctx;
-        set_option(OPT_ATTACH_MSG);
+        OPT_ATTACH_MSG = true;
         mutt_message(_("Tag the messages you want to attach!"));
         close = mutt_index_menu();
-        unset_option(OPT_ATTACH_MSG);
+        OPT_ATTACH_MSG = false;
 
         if (!Context)
         {
index 5a30dbe420b9df3282e9811f5dd04e2af5fc9d8c..b9ec230b9bb7f1a44f51ee1c1747fb0594c10dc1 100644 (file)
@@ -613,7 +613,7 @@ static int comp_close_mailbox(struct Context *ctx)
   if (!ctx->append)
   {
     /* If the file was removed, remove the compressed folder too */
-    if ((access(ctx->path, F_OK) != 0) && !option(OPT_SAVE_EMPTY))
+    if ((access(ctx->path, F_OK) != 0) && !OPT_SAVE_EMPTY)
     {
       remove(ctx->realpath);
     }
index f51b6eade7cd89c28dc088078f5e9eebf5a0d393..51983b4db4e0d6bb2c65ebacc7d15968d6b9afc1 100644 (file)
@@ -661,7 +661,7 @@ int mutt_sasl_interact(sasl_interact_t *interaction)
 
     snprintf(prompt, sizeof(prompt), "%s: ", interaction->prompt);
     resp[0] = '\0';
-    if (option(OPT_NO_CURSES) || mutt_get_field(prompt, resp, sizeof(resp), 0))
+    if (OPT_NO_CURSES || mutt_get_field(prompt, resp, sizeof(resp), 0))
       return SASL_FAIL;
 
     interaction->len = mutt_str_strlen(resp) + 1;
index a32d1510804cb6973cb20b1ee1048d2405d0ca5e..4614ec6346a0a48f394dfdcfb01ef0defaef01d3 100644 (file)
@@ -495,7 +495,7 @@ int raw_socket_open(struct Connection *conn)
   /* we accept v4 or v6 STREAM sockets */
   memset(&hints, 0, sizeof(hints));
 
-  if (option(OPT_USE_IPV6))
+  if (OPT_USE_IPV6)
     hints.ai_family = AF_UNSPEC;
   else
     hints.ai_family = AF_INET;
@@ -514,7 +514,7 @@ int raw_socket_open(struct Connection *conn)
   host_idna = conn->account.host;
 #endif
 
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
     mutt_message(_("Looking up %s..."), conn->account.host);
 
   rc = getaddrinfo(host_idna, port, &hints, &res);
@@ -530,7 +530,7 @@ int raw_socket_open(struct Connection *conn)
     return -1;
   }
 
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
     mutt_message(_("Connecting to %s..."), conn->account.host);
 
   rc = -1;
@@ -573,7 +573,7 @@ int raw_socket_open(struct Connection *conn)
   host_idna = conn->account.host;
 #endif
 
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
     mutt_message(_("Looking up %s..."), conn->account.host);
 
   he = gethostbyname(host_idna);
@@ -589,7 +589,7 @@ int raw_socket_open(struct Connection *conn)
     return -1;
   }
 
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
     mutt_message(_("Connecting to %s..."), conn->account.host);
 
   rc = -1;
index 8982283117b06045cd663e914b3ae5fe84fa9cdd..b122e9b54a1c04107c8e7e39f3eb8b8cf0de63ec 100644 (file)
@@ -180,7 +180,7 @@ static int ssl_set_verify_partial(SSL_CTX *ctx)
 #ifdef HAVE_SSL_PARTIAL_CHAIN
   X509_VERIFY_PARAM *param = NULL;
 
-  if (option(OPT_SSL_VERIFY_PARTIAL_CHAINS))
+  if (OPT_SSL_VERIFY_PARTIAL_CHAINS)
   {
     param = X509_VERIFY_PARAM_new();
     if (param)
@@ -511,7 +511,7 @@ static bool compare_certificates(X509 *cert, X509 *peercert,
  */
 static bool check_certificate_expiration(X509 *peercert, bool silent)
 {
-  if (option(OPT_SSL_VERIFY_DATES) != MUTT_NO)
+  if (OPT_SSL_VERIFY_DATES != MUTT_NO)
   {
     if (X509_cmp_current_time(X509_get_notBefore(peercert)) >= 0)
     {
@@ -1014,7 +1014,7 @@ static int interactive_check_cert(X509 *cert, int idx, size_t len, SSL *ssl, int
 
 /* The leaf/host certificate can't be skipped. */
 #ifdef HAVE_SSL_PARTIAL_CHAIN
-  if ((idx != 0) && (option(OPT_SSL_VERIFY_PARTIAL_CHAINS)))
+  if ((idx != 0) && OPT_SSL_VERIFY_PARTIAL_CHAINS)
     ALLOW_SKIP = 1;
 #endif
 
@@ -1056,7 +1056,7 @@ static int interactive_check_cert(X509 *cert, int idx, size_t len, SSL *ssl, int
   menu->help = helpstr;
 
   done = 0;
-  set_option(OPT_IGNORE_MACRO_EVENTS);
+  OPT_IGNORE_MACRO_EVENTS = true;
   while (!done)
   {
     switch (mutt_menu_loop(menu))
@@ -1101,7 +1101,7 @@ static int interactive_check_cert(X509 *cert, int idx, size_t len, SSL *ssl, int
         break;
     }
   }
-  unset_option(OPT_IGNORE_MACRO_EVENTS);
+  OPT_IGNORE_MACRO_EVENTS = false;
   mutt_pop_current_menu(menu);
   mutt_menu_destroy(&menu);
   mutt_debug(2, "done=%d\n", done);
@@ -1169,7 +1169,7 @@ static int ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
    * a second time with preverify_ok = 1.  Don't show it or the user
    * will think their "s" key is broken.
    */
-  if (option(OPT_SSL_VERIFY_PARTIAL_CHAINS))
+  if (OPT_SSL_VERIFY_PARTIAL_CHAINS)
   {
     if (skip_mode && preverify_ok && (pos == last_pos) && last_cert)
     {
@@ -1198,7 +1198,7 @@ static int ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
 
   /* check hostname only for the leaf certificate */
   buf[0] = 0;
-  if (pos == 0 && option(OPT_SSL_VERIFY_HOST) != MUTT_NO)
+  if (pos == 0 && OPT_SSL_VERIFY_HOST != MUTT_NO)
   {
     if (!check_host(cert, host, buf, sizeof(buf)))
     {
@@ -1342,7 +1342,7 @@ static int ssl_socket_open(struct Connection *conn)
   }
 
   /* disable SSL protocols as needed */
-  if (!option(OPT_SSL_USE_TLSV1))
+  if (!OPT_SSL_USE_TLSV1)
   {
     SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1);
   }
@@ -1350,27 +1350,27 @@ static int ssl_socket_open(struct Connection *conn)
    * as Fedora 17 are on OpenSSL 1.0.0.
    */
 #ifdef SSL_OP_NO_TLSv1_1
-  if (!option(OPT_SSL_USE_TLSV1_1))
+  if (!OPT_SSL_USE_TLSV1_1)
   {
     SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1_1);
   }
 #endif
 #ifdef SSL_OP_NO_TLSv1_2
-  if (!option(OPT_SSL_USE_TLSV1_2))
+  if (!OPT_SSL_USE_TLSV1_2)
   {
     SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1_2);
   }
 #endif
-  if (!option(OPT_SSL_USE_SSLV2))
+  if (!OPT_SSL_USE_SSLV2)
   {
     SSL_CTX_set_options(data->ctx, SSL_OP_NO_SSLv2);
   }
-  if (!option(OPT_SSL_USE_SSLV3))
+  if (!OPT_SSL_USE_SSLV3)
   {
     SSL_CTX_set_options(data->ctx, SSL_OP_NO_SSLv3);
   }
 
-  if (option(OPT_SSL_USESYSTEMCERTS))
+  if (OPT_SSL_USESYSTEMCERTS)
   {
     if (!SSL_CTX_set_default_verify_paths(data->ctx))
     {
@@ -1444,15 +1444,15 @@ int mutt_ssl_starttls(struct Connection *conn)
     goto bail_ssldata;
   }
 #ifdef SSL_OP_NO_TLSv1_2
-  if (!option(OPT_SSL_USE_TLSV1_2))
+  if (!OPT_SSL_USE_TLSV1_2)
     ssl_options |= SSL_OP_NO_TLSv1_2;
 #endif
 #ifdef SSL_OP_NO_TLSv1_1
-  if (!option(OPT_SSL_USE_TLSV1_1))
+  if (!OPT_SSL_USE_TLSV1_1)
     ssl_options |= SSL_OP_NO_TLSv1_1;
 #endif
 #ifdef SSL_OP_NO_TLSv1
-  if (!option(OPT_SSL_USE_TLSV1))
+  if (!OPT_SSL_USE_TLSV1)
     ssl_options |= SSL_OP_NO_TLSv1;
 #endif
 /* these are always set */
@@ -1468,7 +1468,7 @@ int mutt_ssl_starttls(struct Connection *conn)
     goto bail_ctx;
   }
 
-  if (option(OPT_SSL_USESYSTEMCERTS))
+  if (OPT_SSL_USESYSTEMCERTS)
   {
     if (!SSL_CTX_set_default_verify_paths(ssldata->ctx))
     {
index 5147d53975eaaae1e0c9da61552edcf9e4bdbeab..cfae24066780e590f3bde29f4d15b510df72bc46 100644 (file)
@@ -469,7 +469,7 @@ static int tls_check_preauth(const gnutls_datum_t *certdata,
     return -1;
   }
 
-  if (option(OPT_SSL_VERIFY_DATES) != MUTT_NO)
+  if (OPT_SSL_VERIFY_DATES != MUTT_NO)
   {
     if (gnutls_x509_crt_get_expiration_time(cert) < time(NULL))
       *certerr |= CERTERR_EXPIRED;
@@ -477,7 +477,7 @@ static int tls_check_preauth(const gnutls_datum_t *certdata,
       *certerr |= CERTERR_NOTYETVALID;
   }
 
-  if (chainidx == 0 && option(OPT_SSL_VERIFY_HOST) != MUTT_NO &&
+  if (chainidx == 0 && OPT_SSL_VERIFY_HOST != MUTT_NO &&
       !gnutls_x509_crt_check_hostname(cert, hostname) &&
       !tls_check_stored_hostname(certdata, hostname))
     *certerr |= CERTERR_HOSTNAME;
@@ -818,7 +818,7 @@ static int tls_check_one_certificate(const gnutls_datum_t *certdata,
   menu->help = helpstr;
 
   done = 0;
-  set_option(OPT_IGNORE_MACRO_EVENTS);
+  OPT_IGNORE_MACRO_EVENTS = true;
   while (!done)
   {
     switch (mutt_menu_loop(menu))
@@ -870,7 +870,7 @@ static int tls_check_one_certificate(const gnutls_datum_t *certdata,
         break;
     }
   }
-  unset_option(OPT_IGNORE_MACRO_EVENTS);
+  OPT_IGNORE_MACRO_EVENTS = false;
   mutt_pop_current_menu(menu);
   mutt_menu_destroy(&menu);
   gnutls_x509_crt_deinit(cert);
@@ -1045,22 +1045,22 @@ static int tls_set_priority(struct TlsSockData *data)
   else
     mutt_str_strcat(priority, priority_size, "NORMAL");
 
-  if (!option(OPT_SSL_USE_TLSV1_2))
+  if (!OPT_SSL_USE_TLSV1_2)
   {
     nproto--;
     mutt_str_strcat(priority, priority_size, ":-VERS-TLS1.2");
   }
-  if (!option(OPT_SSL_USE_TLSV1_1))
+  if (!OPT_SSL_USE_TLSV1_1)
   {
     nproto--;
     mutt_str_strcat(priority, priority_size, ":-VERS-TLS1.1");
   }
-  if (!option(OPT_SSL_USE_TLSV1))
+  if (!OPT_SSL_USE_TLSV1)
   {
     nproto--;
     mutt_str_strcat(priority, priority_size, ":-VERS-TLS1.0");
   }
-  if (!option(OPT_SSL_USE_SSLV3))
+  if (!OPT_SSL_USE_SSLV3)
   {
     nproto--;
     mutt_str_strcat(priority, priority_size, ":-VERS-SSL3.0");
@@ -1097,13 +1097,13 @@ static int tls_set_priority(struct TlsSockData *data)
 {
   size_t nproto = 0; /* number of tls/ssl protocols */
 
-  if (option(OPT_SSL_USE_TLSV1_2))
+  if (OPT_SSL_USE_TLSV1_2)
     protocol_priority[nproto++] = GNUTLS_TLS1_2;
-  if (option(OPT_SSL_USE_TLSV1_1))
+  if (OPT_SSL_USE_TLSV1_1)
     protocol_priority[nproto++] = GNUTLS_TLS1_1;
-  if (option(OPT_SSL_USE_TLSV1))
+  if (OPT_SSL_USE_TLSV1)
     protocol_priority[nproto++] = GNUTLS_TLS1;
-  if (option(OPT_SSL_USE_SSLV3))
+  if (OPT_SSL_USE_SSLV3)
     protocol_priority[nproto++] = GNUTLS_SSL3;
   protocol_priority[nproto] = 0;
 
@@ -1237,7 +1237,7 @@ static int tls_negotiate(struct Connection *conn)
 
   tls_get_client_cert(conn);
 
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
   {
     mutt_message(_("SSL/TLS connection using %s (%s/%s/%s)"),
                  gnutls_protocol_get_name(gnutls_protocol_get_version(data->state)),
diff --git a/copy.c b/copy.c
index 5969b887c0592166a2cf10aaf1d11c1a9de16fd5..90d6583160050984d62e7e4cf6d08f48942a9a1c 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -455,7 +455,7 @@ int mutt_copy_header(FILE *in, struct Header *h, FILE *out, int flags, const cha
   {
     /* Add some fake headers based on notmuch data */
     char *folder = nm_header_get_folder(h);
-    if (folder && !(option(OPT_WEED) && mutt_matches_ignore("folder")))
+    if (folder && !(OPT_WEED && mutt_matches_ignore("folder")))
     {
       char buf[LONG_STRING];
       mutt_str_strfcpy(buf, folder, sizeof(buf));
@@ -468,7 +468,7 @@ int mutt_copy_header(FILE *in, struct Header *h, FILE *out, int flags, const cha
   }
 #endif
   char *tags = driver_tags_get(&h->tags);
-  if (tags && !(option(OPT_WEED) && mutt_matches_ignore("tags")))
+  if (tags && !(OPT_WEED && mutt_matches_ignore("tags")))
   {
     fputs("Tags: ", out);
     fputs(tags, out);
@@ -559,7 +559,7 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Header *hdr, int flags,
 
   if (flags & MUTT_CM_PREFIX)
   {
-    if (option(OPT_TEXT_FLOWED))
+    if (OPT_TEXT_FLOWED)
       mutt_str_strfcpy(prefix, ">", sizeof(prefix));
     else
       mutt_make_string_flags(prefix, sizeof(prefix), NONULL(IndentString), Context, hdr, 0);
index b895f129d32aa4bc160da2c89efc310f4e459d72..0758a88a1d2a56013ce6be7fc14a363ebfc10171 100644 (file)
@@ -93,11 +93,11 @@ static void reflow_message_window_rows(int mw_rows);
 void mutt_refresh(void)
 {
   /* don't refresh when we are waiting for a child. */
-  if (option(OPT_KEEP_QUIET))
+  if (OPT_KEEP_QUIET)
     return;
 
   /* don't refresh in the middle of macros unless necessary */
-  if (MacroBufferCount && !option(OPT_FORCE_REFRESH) && !option(OPT_IGNORE_MACRO_EVENTS))
+  if (MacroBufferCount && !OPT_FORCE_REFRESH && !OPT_IGNORE_MACRO_EVENTS)
     return;
 
   /* else */
@@ -128,7 +128,7 @@ struct Event mutt_getch(void)
   if (UngetCount)
     return UngetKeyEvents[--UngetCount];
 
-  if (!option(OPT_IGNORE_MACRO_EVENTS) && MacroBufferCount)
+  if (!OPT_IGNORE_MACRO_EVENTS && MacroBufferCount)
     return MacroEvents[--MacroBufferCount];
 
   SigInt = 0;
@@ -160,7 +160,7 @@ struct Event mutt_getch(void)
     return timeout;
   }
 
-  if ((ch & 0x80) && option(OPT_META_KEY))
+  if ((ch & 0x80) && OPT_META_KEY)
   {
     /* send ALT-x as ESC-x */
     ch &= ~0x80;
@@ -212,9 +212,9 @@ int mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags)
 {
   int rc;
 
-  set_option(OPT_IGNORE_MACRO_EVENTS);
+  OPT_IGNORE_MACRO_EVENTS = true;
   rc = mutt_get_field(msg, buf, buflen, flags);
-  unset_option(OPT_IGNORE_MACRO_EVENTS);
+  OPT_IGNORE_MACRO_EVENTS = false;
 
   return rc;
 }
@@ -222,7 +222,7 @@ int mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags)
 void mutt_clear_error(void)
 {
   ErrorBuf[0] = 0;
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
     mutt_window_clearline(MuttMessageWindow, 0);
 }
 
@@ -412,7 +412,7 @@ static void curses_message(int error, const char *fmt, va_list ap)
   mutt_simple_format(ErrorBuf, sizeof(ErrorBuf), 0, MuttMessageWindow->cols,
                      FMT_LEFT, 0, scratch, sizeof(scratch), 0);
 
-  if (!option(OPT_KEEP_QUIET))
+  if (!OPT_KEEP_QUIET)
   {
     if (error)
       BEEP();
@@ -424,9 +424,9 @@ static void curses_message(int error, const char *fmt, va_list ap)
   }
 
   if (error)
-    set_option(OPT_MSG_ERR);
+    OPT_MSG_ERR = true;
   else
-    unset_option(OPT_MSG_ERR);
+    OPT_MSG_ERR = false;
 }
 
 void mutt_curses_error(const char *fmt, ...)
@@ -454,7 +454,7 @@ void mutt_progress_init(struct Progress *progress, const char *msg,
 
   if (!progress)
     return;
-  if (option(OPT_NO_CURSES))
+  if (OPT_NO_CURSES)
     return;
 
   memset(progress, 0, sizeof(struct Progress));
@@ -553,7 +553,7 @@ void mutt_progress_update(struct Progress *progress, long pos, int percent)
   struct timeval tv = { 0, 0 };
   unsigned int now = 0;
 
-  if (option(OPT_NO_CURSES))
+  if (OPT_NO_CURSES)
     return;
 
   if (!progress->inc)
@@ -639,21 +639,21 @@ void mutt_free_windows(void)
 
 void mutt_reflow_windows(void)
 {
-  if (option(OPT_NO_CURSES))
+  if (OPT_NO_CURSES)
     return;
 
   mutt_debug(2, "entering\n");
 
   MuttStatusWindow->rows = 1;
   MuttStatusWindow->cols = COLS;
-  MuttStatusWindow->row_offset = option(OPT_STATUS_ON_TOP) ? 0 : LINES - 2;
+  MuttStatusWindow->row_offset = OPT_STATUS_ON_TOP ? 0 : LINES - 2;
   MuttStatusWindow->col_offset = 0;
 
   memcpy(MuttHelpWindow, MuttStatusWindow, sizeof(struct MuttWindow));
-  if (!option(OPT_HELP))
+  if (!OPT_HELP)
     MuttHelpWindow->rows = 0;
   else
-    MuttHelpWindow->row_offset = option(OPT_STATUS_ON_TOP) ? LINES - 2 : 0;
+    MuttHelpWindow->row_offset = OPT_STATUS_ON_TOP ? LINES - 2 : 0;
 
   memcpy(MuttMessageWindow, MuttStatusWindow, sizeof(struct MuttWindow));
   MuttMessageWindow->row_offset = LINES - 1;
@@ -662,16 +662,16 @@ void mutt_reflow_windows(void)
   MuttIndexWindow->rows = MAX(
       LINES - MuttStatusWindow->rows - MuttHelpWindow->rows - MuttMessageWindow->rows, 0);
   MuttIndexWindow->row_offset =
-      option(OPT_STATUS_ON_TOP) ? MuttStatusWindow->rows : MuttHelpWindow->rows;
+      OPT_STATUS_ON_TOP ? MuttStatusWindow->rows : MuttHelpWindow->rows;
 
 #ifdef USE_SIDEBAR
-  if (option(OPT_SIDEBAR_VISIBLE))
+  if (OPT_SIDEBAR_VISIBLE)
   {
     memcpy(MuttSidebarWindow, MuttIndexWindow, sizeof(struct MuttWindow));
     MuttSidebarWindow->cols = SidebarWidth;
     MuttIndexWindow->cols -= SidebarWidth;
 
-    if (option(OPT_SIDEBAR_ON_RIGHT))
+    if (OPT_SIDEBAR_ON_RIGHT)
     {
       MuttSidebarWindow->col_offset = COLS - SidebarWidth;
     }
@@ -692,16 +692,16 @@ static void reflow_message_window_rows(int mw_rows)
   MuttMessageWindow->rows = mw_rows;
   MuttMessageWindow->row_offset = LINES - mw_rows;
 
-  MuttStatusWindow->row_offset = option(OPT_STATUS_ON_TOP) ? 0 : LINES - mw_rows - 1;
+  MuttStatusWindow->row_offset = OPT_STATUS_ON_TOP ? 0 : LINES - mw_rows - 1;
 
-  if (option(OPT_HELP))
-    MuttHelpWindow->row_offset = option(OPT_STATUS_ON_TOP) ? LINES - mw_rows - 1 : 0;
+  if (OPT_HELP)
+    MuttHelpWindow->row_offset = OPT_STATUS_ON_TOP ? LINES - mw_rows - 1 : 0;
 
   MuttIndexWindow->rows = MAX(
       LINES - MuttStatusWindow->rows - MuttHelpWindow->rows - MuttMessageWindow->rows, 0);
 
 #ifdef USE_SIDEBAR
-  if (option(OPT_SIDEBAR_VISIBLE))
+  if (OPT_SIDEBAR_VISIBLE)
     MuttSidebarWindow->rows = MuttIndexWindow->rows;
 #endif
 
@@ -801,10 +801,10 @@ void mutt_window_getyx(struct MuttWindow *win, int *y, int *x)
 
 void mutt_show_error(void)
 {
-  if (option(OPT_KEEP_QUIET))
+  if (OPT_KEEP_QUIET)
     return;
 
-  SETCOLOR(option(OPT_MSG_ERR) ? MT_COLOR_ERROR : MT_COLOR_MESSAGE);
+  SETCOLOR(OPT_MSG_ERR ? MT_COLOR_ERROR : MT_COLOR_MESSAGE);
   mutt_window_mvaddstr(MuttMessageWindow, 0, 0, ErrorBuf);
   NORMAL_COLOR;
   mutt_window_clrtoeol(MuttMessageWindow);
@@ -814,7 +814,7 @@ void mutt_endwin(const char *msg)
 {
   int e = errno;
 
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
   {
     /* at least in some situations (screen + xterm under SuSE11/12) endwin()
      * doesn't properly flush the screen without an explicit call.
index 78727096ab1ea0ebc5a0383a5a70fb6496dffd89..833483cce83cbaeb7acf8c9713ad1b3fce008ae0 100644 (file)
@@ -133,7 +133,7 @@ static const char *NoVisible = N_("No visible messages.");
   }
 
 #define CHECK_ATTACH                                                           \
-  if (option(OPT_ATTACH_MSG))                                                  \
+  if (OPT_ATTACH_MSG)                                                          \
   {                                                                            \
     mutt_flushinp();                                                           \
     mutt_error(_(Function_not_permitted_in_attach_message_mode));              \
@@ -145,8 +145,7 @@ static const char *NoVisible = N_("No visible messages.");
 #define FLAGGED(h) mutt_thread_contains_flagged(Context, h)
 
 #define CAN_COLLAPSE(header)                                                   \
-  ((option(OPT_COLLAPSE_UNREAD) || !UNREAD(header)) &&                         \
-   (option(OPT_COLLAPSE_FLAGGED) || !FLAGGED(header)))
+  ((OPT_COLLAPSE_UNREAD || !UNREAD(header)) && (OPT_COLLAPSE_FLAGGED || !FLAGGED(header)))
 
 /* de facto standard escapes for tsl/fsl */
 static char *tsl = "\033]0;";
@@ -373,7 +372,7 @@ void update_index(struct Menu *menu, struct Context *ctx, int check, int oldcoun
   }
 
   /* save the list of new messages */
-  if (option(OPT_UNCOLLAPSE_NEW) && oldcount && check != MUTT_REOPENED &&
+  if (OPT_UNCOLLAPSE_NEW && oldcount && check != MUTT_REOPENED &&
       ((Sort & SORT_MASK) == SORT_THREADS))
   {
     save_new = mutt_mem_malloc(sizeof(struct Header *) * (ctx->msgcount - oldcount));
@@ -385,7 +384,7 @@ void update_index(struct Menu *menu, struct Context *ctx, int check, int oldcoun
   mutt_sort_headers(ctx, (check == MUTT_REOPENED));
 
   /* uncollapse threads with new mail */
-  if (option(OPT_UNCOLLAPSE_NEW) && ((Sort & SORT_MASK) == SORT_THREADS))
+  if (OPT_UNCOLLAPSE_NEW && ((Sort & SORT_MASK) == SORT_THREADS))
   {
     if (check == MUTT_REOPENED)
     {
@@ -439,9 +438,9 @@ static int main_change_folder(struct Menu *menu, int op, char *buf,
                               size_t bufsz, int *oldcount, int *index_hint)
 {
 #ifdef USE_NNTP
-  if (option(OPT_NEWS))
+  if (OPT_NEWS)
   {
-    unset_option(OPT_NEWS);
+    OPT_NEWS = false;
     nntp_expand_path(buf, bufsz, &CurrentNewsSrv->conn->account);
   }
   else
@@ -477,7 +476,7 @@ static int main_change_folder(struct Menu *menu, int op, char *buf,
         update_index(menu, Context, check, *oldcount, *index_hint);
 
       FREE(&new_last_folder);
-      set_option(OPT_SEARCH_INVALID);
+      OPT_SEARCH_INVALID = true;
       menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
       return 0;
     }
@@ -499,9 +498,7 @@ static int main_change_folder(struct Menu *menu, int op, char *buf,
    * switch statement would need to be run. */
   mutt_folder_hook(buf);
 
-  Context = mx_open_mailbox(
-      buf, (option(OPT_READ_ONLY) || (op == OP_MAIN_CHANGE_FOLDER_READONLY)) ? MUTT_READONLY : 0,
-      NULL);
+  Context = mx_open_mailbox(buf, (OPT_READ_ONLY || (op == OP_MAIN_CHANGE_FOLDER_READONLY)) ? MUTT_READONLY : 0, NULL);
   if (Context)
   {
     menu->current = ci_first_message();
@@ -509,7 +506,7 @@ static int main_change_folder(struct Menu *menu, int op, char *buf,
   else
     menu->current = 0;
 
-  if (((Sort & SORT_MASK) == SORT_THREADS) && option(OPT_COLLAPSE_ALL))
+  if (((Sort & SORT_MASK) == SORT_THREADS) && OPT_COLLAPSE_ALL)
     collapse_all(menu, 0);
 
 #ifdef USE_SIDEBAR
@@ -519,7 +516,7 @@ static int main_change_folder(struct Menu *menu, int op, char *buf,
   mutt_clear_error();
   mutt_buffy_check(true); /* force the buffy check after we have changed the folder */
   menu->redraw = REDRAW_FULL;
-  set_option(OPT_SEARCH_INVALID);
+  OPT_SEARCH_INVALID = true;
 
   return 0;
 }
@@ -889,7 +886,7 @@ static void index_menu_redraw(struct Menu *menu)
     mutt_draw_statusline(MuttStatusWindow->cols, buf, sizeof(buf));
     NORMAL_COLOR;
     menu->redraw &= ~REDRAW_STATUS;
-    if (option(OPT_TS_ENABLED) && TSSupported)
+    if (OPT_TS_ENABLED && TSSupported)
     {
       menu_status_line(buf, sizeof(buf), menu, NONULL(TSStatusFormat));
       mutt_ts_status(buf);
@@ -923,7 +920,7 @@ int mutt_index_menu(void)
   int index_hint;  /* used to restore cursor position */
   bool do_buffy_notify = true;
   int close = 0; /* did we OP_QUIT or OP_EXIT out of this menu? */
-  int attach_msg = option(OPT_ATTACH_MSG);
+  int attach_msg = OPT_ATTACH_MSG;
 
   menu = mutt_new_menu(MENU_MAIN);
   menu->make_entry = index_make_entry;
@@ -941,7 +938,7 @@ int mutt_index_menu(void)
   if (!attach_msg)
     mutt_buffy_check(true); /* force the buffy check after we enter the folder */
 
-  if (((Sort & SORT_MASK) == SORT_THREADS) && option(OPT_COLLAPSE_ALL))
+  if (((Sort & SORT_MASK) == SORT_THREADS) && OPT_COLLAPSE_ALL)
   {
     collapse_all(menu, 0);
     menu->redraw = REDRAW_FULL;
@@ -959,17 +956,17 @@ int mutt_index_menu(void)
      * any 'op' below could do mutt_enter_command(), either here or
      * from any new menu launched, and change $sort/$sort_aux
      */
-    if (option(OPT_NEED_RESORT) && Context && Context->msgcount && menu->current >= 0)
+    if (OPT_NEED_RESORT && Context && Context->msgcount && menu->current >= 0)
       resort_index(menu);
 
     menu->max = Context ? Context->vcount : 0;
     oldcount = Context ? Context->msgcount : 0;
 
-    if (option(OPT_REDRAW_TREE) && Context && Context->msgcount && (Sort & SORT_MASK) == SORT_THREADS)
+    if (OPT_REDRAW_TREE && Context && Context->msgcount && (Sort & SORT_MASK) == SORT_THREADS)
     {
       mutt_draw_tree(Context);
       menu->redraw |= REDRAW_STATUS;
-      unset_option(OPT_REDRAW_TREE);
+      OPT_REDRAW_TREE = false;
     }
 
     if (Context)
@@ -998,7 +995,7 @@ int mutt_index_menu(void)
           menu->redraw = REDRAW_FULL;
         }
 
-        set_option(OPT_SEARCH_INVALID);
+        OPT_SEARCH_INVALID = true;
       }
       else if (check == MUTT_NEW_MAIL || check == MUTT_REOPENED || check == MUTT_FLAGS)
       {
@@ -1013,7 +1010,7 @@ int mutt_index_menu(void)
             if (!Context->hdrs[i]->read)
             {
               mutt_message(_("New mail in this mailbox."));
-              if (option(OPT_BEEP_NEW))
+              if (OPT_BEEP_NEW)
                 beep();
               if (NewMailCommand)
               {
@@ -1040,7 +1037,7 @@ int mutt_index_menu(void)
         menu->redraw = REDRAW_FULL;
         menu->max = Context->vcount;
 
-        set_option(OPT_SEARCH_INVALID);
+        OPT_SEARCH_INVALID = true;
       }
     }
 
@@ -1056,7 +1053,7 @@ int mutt_index_menu(void)
         if (mutt_buffy_notify())
         {
           menu->redraw |= REDRAW_STATUS;
-          if (option(OPT_BEEP_NEW))
+          if (OPT_BEEP_NEW)
             beep();
           if (NewMailCommand)
           {
@@ -1090,9 +1087,9 @@ int mutt_index_menu(void)
       else
         menu->oldcurrent = -1;
 
-      if (option(OPT_ARROW_CURSOR))
+      if (OPT_ARROW_CURSOR)
         mutt_window_move(MuttIndexWindow, menu->current - menu->top + menu->offset, 2);
-      else if (option(OPT_BRAILLE_FRIENDLY))
+      else if (OPT_BRAILLE_FRIENDLY)
         mutt_window_move(MuttIndexWindow, menu->current - menu->top + menu->offset, 0);
       else
         mutt_window_move(MuttIndexWindow, menu->current - menu->top + menu->offset,
@@ -1163,7 +1160,7 @@ int mutt_index_menu(void)
         tag = true;
         continue;
       }
-      else if (option(OPT_AUTO_TAG) && Context && Context->tagged)
+      else if (OPT_AUTO_TAG && Context && Context->tagged)
         tag = true;
 
       mutt_clear_error();
@@ -1179,7 +1176,7 @@ int mutt_index_menu(void)
     }
 
 #ifdef USE_NNTP
-    unset_option(OPT_NEWS); /* for any case */
+    OPT_NEWS = false; /* for any case */
 #endif
 
 #ifdef USE_NOTMUCH
@@ -1533,14 +1530,14 @@ int mutt_index_menu(void)
           {
             snprintf(buf2, sizeof(buf2), "!~R!~D~s%s",
                      Context->pattern ? Context->pattern : ".*");
-            set_option(OPT_HIDE_READ);
+            OPT_HIDE_READ = true;
           }
           else
           {
             mutt_str_strfcpy(buf2, Context->pattern + 8, sizeof(buf2));
             if (!*buf2 || (strncmp(buf2, ".*", 2) == 0))
               snprintf(buf2, sizeof(buf2), "~A");
-            unset_option(OPT_HIDE_READ);
+            OPT_HIDE_READ = false;
           }
           FREE(&Context->pattern);
           Context->pattern = mutt_str_strdup(buf2);
@@ -1601,7 +1598,7 @@ int mutt_index_menu(void)
               update_index(menu, Context, check, oldcount, index_hint);
 
             menu->redraw = REDRAW_FULL; /* new mail arrived? */
-            set_option(OPT_SEARCH_INVALID);
+            OPT_SEARCH_INVALID = true;
           }
         }
         break;
@@ -1634,7 +1631,7 @@ int mutt_index_menu(void)
           if (Context && Context->msgcount)
           {
             resort_index(menu);
-            set_option(OPT_SEARCH_INVALID);
+            OPT_SEARCH_INVALID = true;
           }
           if (menu->menu == MENU_PAGER)
           {
@@ -1649,7 +1646,7 @@ int mutt_index_menu(void)
 
         CHECK_MSGCOUNT;
         CHECK_VISIBLE;
-        if (tag && !option(OPT_AUTO_TAG))
+        if (tag && !OPT_AUTO_TAG)
         {
           for (j = 0; j < Context->msgcount; j++)
             if (message_is_visible(Context, j))
@@ -1666,7 +1663,7 @@ int mutt_index_menu(void)
                                              Context->last_tag);
 
           menu->redraw |= REDRAW_STATUS;
-          if (option(OPT_RESOLVE) && menu->current < Context->vcount - 1)
+          if (OPT_RESOLVE && menu->current < Context->vcount - 1)
           {
             menu->current++;
             menu->redraw |= REDRAW_MOTION_RESYNCH;
@@ -1728,7 +1725,7 @@ int mutt_index_menu(void)
         {
           if (mx_close_mailbox(Context, &index_hint) != 0)
           {
-            set_option(OPT_SEARCH_INVALID);
+            OPT_SEARCH_INVALID = true;
             menu->redraw = REDRAW_FULL;
             break;
           }
@@ -1736,7 +1733,7 @@ int mutt_index_menu(void)
         }
         imap_logout_all();
         mutt_message(_("Logged out of IMAP servers."));
-        set_option(OPT_SEARCH_INVALID);
+        OPT_SEARCH_INVALID = true;
         menu->redraw = REDRAW_FULL;
         break;
 #endif
@@ -1780,7 +1777,7 @@ int mutt_index_menu(void)
                   break;
                 }
               }
-            set_option(OPT_SEARCH_INVALID);
+            OPT_SEARCH_INVALID = true;
           }
           else if (check == MUTT_NEW_MAIL || check == MUTT_REOPENED)
             update_index(menu, Context, check, oc, index_hint);
@@ -1955,7 +1952,7 @@ int mutt_index_menu(void)
             op = OP_DISPLAY_MESSAGE;
             continue;
           }
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             menu->current = ci_next_undeleted(menu->current);
             if (menu->current == -1)
@@ -2041,9 +2038,9 @@ int mutt_index_menu(void)
 #ifdef USE_NNTP
       case OP_MAIN_CHANGE_GROUP:
       case OP_MAIN_CHANGE_GROUP_READONLY:
-        unset_option(OPT_NEWS);
+        OPT_NEWS = false;
 #endif
-        if (attach_msg || option(OPT_READ_ONLY) ||
+        if (attach_msg || OPT_READ_ONLY ||
 #ifdef USE_NNTP
             op == OP_MAIN_CHANGE_GROUP_READONLY ||
 #endif
@@ -2103,7 +2100,7 @@ int mutt_index_menu(void)
 #endif
         else
         {
-          if (option(OPT_CHANGE_FOLDER_NEXT) && Context && Context->path)
+          if (OPT_CHANGE_FOLDER_NEXT && Context && Context->path)
           {
             mutt_str_strfcpy(buf, Context->path, sizeof(buf));
             mutt_pretty_mailbox(buf, sizeof(buf));
@@ -2111,7 +2108,7 @@ int mutt_index_menu(void)
 #ifdef USE_NNTP
           if (op == OP_MAIN_CHANGE_GROUP || op == OP_MAIN_CHANGE_GROUP_READONLY)
           {
-            set_option(OPT_NEWS);
+            OPT_NEWS = true;
             CurrentNewsSrv = nntp_select_server(NewsServer, false);
             if (!CurrentNewsSrv)
               break;
@@ -2171,20 +2168,19 @@ int mutt_index_menu(void)
          * again while reading the message.
          */
         if (op == OP_DISPLAY_HEADERS)
-          toggle_option(OPT_WEED);
+          OPT_WEED = !OPT_WEED;
 
-        unset_option(OPT_NEED_RESORT);
+        OPT_NEED_RESORT = false;
 
         if ((Sort & SORT_MASK) == SORT_THREADS && CURHDR->collapsed)
         {
           mutt_uncollapse_thread(Context, CURHDR);
           mutt_set_virtual(Context);
-          if (option(OPT_UNCOLLAPSE_JUMP))
+          if (OPT_UNCOLLAPSE_JUMP)
             menu->current = mutt_thread_next_unread(Context, CURHDR);
         }
 
-        if (option(OPT_PGP_AUTO_DECODE) &&
-            (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+        if (OPT_PGP_AUTO_DECODE && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
         {
           mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
         }
@@ -2198,7 +2194,7 @@ int mutt_index_menu(void)
         op = mutt_display_message(CURHDR);
         if (op < 0)
         {
-          unset_option(OPT_NEED_RESORT);
+          OPT_NEED_RESORT = false;
           break;
         }
 
@@ -2437,7 +2433,7 @@ int mutt_index_menu(void)
           menu->redraw |= REDRAW_STATUS;
           if (tag)
             menu->redraw |= REDRAW_INDEX;
-          else if (option(OPT_RESOLVE))
+          else if (OPT_RESOLVE)
           {
             menu->current = ci_next_undeleted(menu->current);
             if (menu->current == -1)
@@ -2571,7 +2567,7 @@ int mutt_index_menu(void)
         else
         {
           mutt_set_flag(Context, CURHDR, MUTT_FLAG, !CURHDR->flagged);
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             menu->current = ci_next_undeleted(menu->current);
             if (menu->current == -1)
@@ -2617,7 +2613,7 @@ int mutt_index_menu(void)
           else
             mutt_set_flag(Context, CURHDR, MUTT_READ, 1);
 
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             menu->current = ci_next_undeleted(menu->current);
             if (menu->current == -1)
@@ -2717,7 +2713,7 @@ int mutt_index_menu(void)
           menu->redraw |= REDRAW_STATUS;
           if (tag)
             menu->redraw |= REDRAW_INDEX;
-          else if (option(OPT_RESOLVE))
+          else if (OPT_RESOLVE)
           {
             menu->current = ci_next_undeleted(menu->current);
             if (menu->current == -1)
@@ -2747,7 +2743,7 @@ int mutt_index_menu(void)
         {
           menu->current = mutt_uncollapse_thread(Context, CURHDR);
           mutt_set_virtual(Context);
-          if (option(OPT_UNCOLLAPSE_JUMP))
+          if (OPT_UNCOLLAPSE_JUMP)
             menu->current = mutt_thread_next_unread(Context, CURHDR);
         }
         else if (CAN_COLLAPSE(CURHDR))
@@ -2813,7 +2809,7 @@ int mutt_index_menu(void)
         {
           mutt_tag_set_flag(MUTT_DELETE, 1);
           mutt_tag_set_flag(MUTT_PURGE, (op == OP_PURGE_MESSAGE));
-          if (option(OPT_DELETE_UNTAG))
+          if (OPT_DELETE_UNTAG)
             mutt_tag_set_flag(MUTT_TAG, 0);
           menu->redraw |= REDRAW_INDEX;
         }
@@ -2821,9 +2817,9 @@ int mutt_index_menu(void)
         {
           mutt_set_flag(Context, CURHDR, MUTT_DELETE, 1);
           mutt_set_flag(Context, CURHDR, MUTT_PURGE, (op == OP_PURGE_MESSAGE));
-          if (option(OPT_DELETE_UNTAG))
+          if (OPT_DELETE_UNTAG)
             mutt_set_flag(Context, CURHDR, MUTT_TAG, 0);
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             menu->current = ci_next_undeleted(menu->current);
             if (menu->current == -1)
@@ -2867,9 +2863,9 @@ int mutt_index_menu(void)
               break;
           }
 
-          if (option(OPT_DELETE_UNTAG))
+          if (OPT_DELETE_UNTAG)
             mutt_thread_set_flag(CURHDR, MUTT_TAG, 0, subthread);
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             menu->current = ci_next_undeleted(menu->current);
             if (menu->current == -1)
@@ -2927,8 +2923,7 @@ int mutt_index_menu(void)
         else
           edit = false;
 
-        if (option(OPT_PGP_AUTO_DECODE) &&
-            (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+        if (OPT_PGP_AUTO_DECODE && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
         {
           mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
         }
@@ -2945,8 +2940,7 @@ int mutt_index_menu(void)
         CHECK_MSGCOUNT;
         CHECK_VISIBLE;
         CHECK_ATTACH;
-        if (option(OPT_PGP_AUTO_DECODE) &&
-            (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+        if (OPT_PGP_AUTO_DECODE && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
         {
           mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
         }
@@ -2963,8 +2957,7 @@ int mutt_index_menu(void)
         CHECK_MSGCOUNT;
         CHECK_VISIBLE;
         CHECK_ATTACH;
-        if (option(OPT_PGP_AUTO_DECODE) &&
-            (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+        if (OPT_PGP_AUTO_DECODE && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
         {
           mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
         }
@@ -3000,8 +2993,7 @@ int mutt_index_menu(void)
         CHECK_ATTACH;
         CHECK_MSGCOUNT;
         CHECK_VISIBLE;
-        if (option(OPT_PGP_AUTO_DECODE) &&
-            (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+        if (OPT_PGP_AUTO_DECODE && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
         {
           mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
         }
@@ -3058,7 +3050,7 @@ int mutt_index_menu(void)
         /* in an IMAP folder index with imap_peek=no, piping could change
          * new or old messages status to read. Redraw what's needed.
          */
-        if (Context->magic == MUTT_IMAP && !option(OPT_IMAP_PEEK))
+        if (Context->magic == MUTT_IMAP && !OPT_IMAP_PEEK)
         {
           menu->redraw |= (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
         }
@@ -3076,7 +3068,7 @@ int mutt_index_menu(void)
         /* in an IMAP folder index with imap_peek=no, printing could change
          * new or old messages status to read. Redraw what's needed.
          */
-        if (Context->magic == MUTT_IMAP && !option(OPT_IMAP_PEEK))
+        if (Context->magic == MUTT_IMAP && !OPT_IMAP_PEEK)
         {
           menu->redraw |= (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
         }
@@ -3097,7 +3089,7 @@ int mutt_index_menu(void)
 
         if (rc != -1)
         {
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             menu->current = (op == OP_MAIN_READ_THREAD ? mutt_next_thread(CURHDR) :
                                                          mutt_next_subthread(CURHDR));
@@ -3215,8 +3207,7 @@ int mutt_index_menu(void)
         CHECK_ATTACH;
         CHECK_MSGCOUNT;
         CHECK_VISIBLE;
-        if (option(OPT_PGP_AUTO_DECODE) &&
-            (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+        if (OPT_PGP_AUTO_DECODE && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
         {
           mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
         }
@@ -3239,7 +3230,7 @@ int mutt_index_menu(void)
 
         if (rc != -1)
         {
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             if (op == OP_TAG_THREAD)
               menu->current = mutt_next_thread(CURHDR);
@@ -3271,7 +3262,7 @@ int mutt_index_menu(void)
         {
           mutt_set_flag(Context, CURHDR, MUTT_DELETE, 0);
           mutt_set_flag(Context, CURHDR, MUTT_PURGE, 0);
-          if (option(OPT_RESOLVE) && menu->current < Context->vcount - 1)
+          if (OPT_RESOLVE && menu->current < Context->vcount - 1)
           {
             menu->current++;
             menu->redraw |= REDRAW_MOTION_RESYNCH;
@@ -3297,7 +3288,7 @@ int mutt_index_menu(void)
                                     op == OP_UNDELETE_THREAD ? 0 : 1);
         if (rc != -1)
         {
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             if (op == OP_UNDELETE_THREAD)
               menu->current = mutt_next_thread(CURHDR);
@@ -3346,7 +3337,7 @@ int mutt_index_menu(void)
         break;
 
       case OP_SIDEBAR_TOGGLE_VISIBLE:
-        toggle_option(OPT_SIDEBAR_VISIBLE);
+        OPT_SIDEBAR_VISIBLE = !OPT_SIDEBAR_VISIBLE;
         mutt_reflow_windows();
         break;
 
diff --git a/edit.c b/edit.c
index b4dfd7e620e312eca2ce412774f3838da89f6d12..3e6bd374dc8f678637e52e4bab0f22e95932519d 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -288,7 +288,7 @@ static void be_edit_header(struct Envelope *e, int force)
     addch('\n');
   }
 
-  if ((!e->cc && option(OPT_ASKCC)) || force)
+  if ((!e->cc && OPT_ASKCC) || force)
   {
     addstr("Cc: ");
     tmp[0] = '\0';
@@ -309,7 +309,7 @@ static void be_edit_header(struct Envelope *e, int force)
     addch('\n');
   }
 
-  if (option(OPT_ASKBCC) || force)
+  if (OPT_ASKBCC || force)
   {
     addstr("Bcc: ");
     tmp[0] = '\0';
@@ -460,7 +460,7 @@ int mutt_builtin_editor(const char *path, struct Header *msg, struct Header *cur
             buf = NULL;
             bufmax = buflen = 0;
 
-            if (option(OPT_EDIT_HEADERS))
+            if (OPT_EDIT_HEADERS)
             {
               mutt_env_to_local(msg->env);
               mutt_edit_headers(NONULL(Visual), path, msg, NULL, 0);
index 51f92fde1a8603666bb5a3b44379351ab391c8ec..53cef62cc44a839c961f40ff6e782e69ad7b1f67 100644 (file)
--- a/editmsg.c
+++ b/editmsg.c
@@ -241,7 +241,7 @@ bail:
     mutt_set_flag(Context, cur, MUTT_PURGE, 1);
     mutt_set_flag(Context, cur, MUTT_READ, 1);
 
-    if (option(OPT_DELETE_UNTAG))
+    if (OPT_DELETE_UNTAG)
       mutt_set_flag(Context, cur, MUTT_TAG, 0);
   }
   else if (rc == -1)
diff --git a/flags.c b/flags.c
index 7103f2892374e5cc068a76618473da1612948c4e..d4cc74abb9a2a3441b90d344705bb9b4149ced05 100644 (file)
--- a/flags.c
+++ b/flags.c
@@ -59,7 +59,7 @@ void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, int b
 
       if (bf)
       {
-        if (!h->deleted && !ctx->readonly && (!h->flagged || !option(OPT_FLAG_SAFE)))
+        if (!h->deleted && !ctx->readonly && (!h->flagged || !OPT_FLAG_SAFE))
         {
           h->deleted = true;
           update = true;
index 8c20f60423fbf643a4d2a8eb24bf00d54cbc19ef..aef3edcaedc003287cba7d4c17a5e0b81b54d876 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -205,13 +205,6 @@ WHERE struct ReplaceList *SpamList;
 WHERE struct RegexList *NoSpamList;
 WHERE struct ReplaceList *SubjectRegexList;
 
-/* bit vector for the yes/no/ask variable type */
-#ifdef MAIN_C
-unsigned char QuadOptions[(OPT_QUAD_MAX * 2 + 7) / 8];
-#else
-extern unsigned char QuadOptions[];
-#endif
-
 WHERE unsigned short Counter;
 
 #ifdef USE_NNTP
index 4cfac807970bb61c47327445b921ae3ac31a6d3c..ac2fd218188689f80741fff236cb46d04e967223 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -985,7 +985,7 @@ static int is_autoview(struct Body *b)
 
   snprintf(type, sizeof(type), "%s/%s", TYPE(b), b->subtype);
 
-  if (option(OPT_IMPLICIT_AUTOVIEW))
+  if (OPT_IMPLICIT_AUTOVIEW)
   {
     /* $implicit_autoview is essentially the same as "auto_view *" */
     is_av = 1;
@@ -1154,7 +1154,7 @@ static int alternative_handler(struct Body *a, struct State *s)
 
   if (choice)
   {
-    if (s->flags & MUTT_DISPLAY && !option(OPT_WEED))
+    if (s->flags & MUTT_DISPLAY && !OPT_WEED)
     {
       fseeko(s->fpin, choice->hdr_offset, SEEK_SET);
       mutt_file_copy_bytes(s->fpin, s->fpout, choice->offset - choice->hdr_offset);
@@ -1230,7 +1230,7 @@ static int message_handler(struct Body *a, struct State *s)
   {
     mutt_copy_hdr(s->fpin, s->fpout, off_start, b->parts->offset,
                   (((s->flags & MUTT_WEED) ||
-                    ((s->flags & (MUTT_DISPLAY | MUTT_PRINTING)) && option(OPT_WEED))) ?
+                    ((s->flags & (MUTT_DISPLAY | MUTT_PRINTING)) && OPT_WEED)) ?
                        (CH_WEED | CH_REORDER) :
                        0) |
                       (s->prefix ? CH_PREFIX : 0) | CH_DECODE | CH_FROM |
@@ -1322,7 +1322,7 @@ static int multipart_handler(struct Body *a, struct State *s)
       }
       state_puts(" --]\n", s);
       print_part_line(s, p, 0);
-      if (!option(OPT_WEED))
+      if (!OPT_WEED)
       {
         fseeko(s->fpin, p->hdr_offset, SEEK_SET);
         mutt_file_copy_bytes(s->fpin, s->fpout, p->offset - p->hdr_offset);
@@ -1341,8 +1341,7 @@ static int multipart_handler(struct Body *a, struct State *s)
                  NONULL(p->subtype));
     }
 
-    if ((s->flags & MUTT_REPLYING) && (option(OPT_INCLUDE_ONLYFIRST)) &&
-        (s->flags & MUTT_FIRSTDONE))
+    if ((s->flags & MUTT_REPLYING) && OPT_INCLUDE_ONLYFIRST && (s->flags & MUTT_FIRSTDONE))
     {
       break;
     }
@@ -1545,7 +1544,7 @@ static int external_body_handler(struct Body *b, struct State *s)
       }
 
       mutt_copy_hdr(s->fpin, s->fpout, ftello(s->fpin), b->parts->offset,
-                    (option(OPT_WEED) ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE, NULL);
+                    (OPT_WEED ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE, NULL);
     }
   }
   else if (expiration && expire < time(NULL))
@@ -1560,8 +1559,7 @@ static int external_body_handler(struct Body *b, struct State *s)
                         s);
 
       mutt_copy_hdr(s->fpin, s->fpout, ftello(s->fpin), b->parts->offset,
-                    (option(OPT_WEED) ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_DISPLAY,
-                    NULL);
+                    (OPT_WEED ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_DISPLAY, NULL);
     }
   }
   else
@@ -1575,8 +1573,7 @@ static int external_body_handler(struct Body *b, struct State *s)
       state_printf(
           s, _("[-- and the indicated access-type %s is unsupported --]\n"), access_type);
       mutt_copy_hdr(s->fpin, s->fpout, ftello(s->fpin), b->parts->offset,
-                    (option(OPT_WEED) ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_DISPLAY,
-                    NULL);
+                    (OPT_WEED ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_DISPLAY, NULL);
     }
   }
 
@@ -1642,7 +1639,7 @@ static int text_plain_handler(struct Body *b, struct State *s)
 
   while ((buf = mutt_file_read_line(buf, &sz, s->fpin, NULL, 0)))
   {
-    if ((mutt_str_strcmp(buf, "-- ") != 0) && option(OPT_TEXT_FLOWED))
+    if ((mutt_str_strcmp(buf, "-- ") != 0) && OPT_TEXT_FLOWED)
     {
       l = mutt_str_strlen(buf);
       while (l > 0 && buf[l - 1] == ' ')
@@ -1850,7 +1847,7 @@ int mutt_body_handler(struct Body *b, struct State *s)
        */
       if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b))
         handler = crypt_pgp_application_pgp_handler;
-      else if (option(OPT_REFLOW_TEXT) &&
+      else if (OPT_REFLOW_TEXT &&
                (mutt_str_strcasecmp("flowed", mutt_param_get("format", b->parameter)) == 0))
       {
         handler = rfc3676_handler;
@@ -1913,8 +1910,7 @@ int mutt_body_handler(struct Body *b, struct State *s)
   }
   else if (WithCrypto && b->type == TYPEAPPLICATION)
   {
-    if (option(OPT_DONT_HANDLE_PGP_KEYS) &&
-        (mutt_str_strcasecmp("pgp-keys", b->subtype) == 0))
+    if (OPT_DONT_HANDLE_PGP_KEYS && (mutt_str_strcasecmp("pgp-keys", b->subtype) == 0))
     {
       /* pass raw part through for key extraction */
       plaintext = true;
@@ -1927,24 +1923,22 @@ int mutt_body_handler(struct Body *b, struct State *s)
 
   /* only respect disposition == attachment if we're not
      displaying from the attachment menu (i.e. pager) */
-  if ((!option(OPT_HONOR_DISPOSITION) ||
-       (b->disposition != DISPATTACH || option(OPT_VIEW_ATTACH))) &&
+  if ((!OPT_HONOR_DISPOSITION || (b->disposition != DISPATTACH || OPT_VIEW_ATTACH)) &&
       (plaintext || handler))
   {
     rc = run_decode_and_handler(b, s, handler, plaintext);
   }
   /* print hint to use attachment menu for disposition == attachment
      if we're not already being called from there */
-  else if ((s->flags & MUTT_DISPLAY) ||
-           (b->disposition == DISPATTACH && !option(OPT_VIEW_ATTACH) &&
-            option(OPT_HONOR_DISPOSITION) && (plaintext || handler)))
+  else if ((s->flags & MUTT_DISPLAY) || (b->disposition == DISPATTACH && !OPT_VIEW_ATTACH &&
+                                         OPT_HONOR_DISPOSITION && (plaintext || handler)))
   {
     state_mark_attach(s);
-    if (option(OPT_HONOR_DISPOSITION) && b->disposition == DISPATTACH)
+    if (OPT_HONOR_DISPOSITION && b->disposition == DISPATTACH)
       fputs(_("[-- This is an attachment "), s->fpout);
     else
       state_printf(s, _("[-- %s/%s is unsupported "), TYPE(b), b->subtype);
-    if (!option(OPT_VIEW_ATTACH))
+    if (!OPT_VIEW_ATTACH)
     {
       char keystroke[SHORT_STRING];
 
index c079b686598cb699796cf5261e4a1acb4753ce45..0e8845f143eb3f09ebde2280728325142b53d4e4 100644 (file)
@@ -45,7 +45,7 @@ static void *hcache_kyotocabinet_open(const char *path)
 
   printfresult =
       snprintf(kcdbpath, sizeof(kcdbpath), "%s#type=kct#opts=%s#rcomp=lex",
-               path, option(OPT_HEADER_CACHE_COMPRESS) ? "lc" : "l");
+               path, OPT_HEADER_CACHE_COMPRESS ? "lc" : "l");
   if ((printfresult < 0) || (printfresult >= sizeof(kcdbpath)))
   {
     return NULL;
index f8cec63aef1b85b0431b7aa6deacfb5c9a1877b5..dc1f11bab5151d357070b722a2d3f51d949ffd29 100644 (file)
@@ -42,7 +42,7 @@ static void *hcache_qdbm_open(const char *path)
 {
   int flags = VL_OWRITER | VL_OCREAT;
 
-  if (option(OPT_HEADER_CACHE_COMPRESS))
+  if (OPT_HEADER_CACHE_COMPRESS)
     flags |= VL_OZCOMP;
 
   return vlopen(path, flags, VL_CMPLEX);
index fdd6af62b00271e5baaa8143c1950c0380d76a18..a8cd4002eea145b1507be0ac25cf4947a6935b47 100644 (file)
@@ -43,7 +43,7 @@ static void *hcache_tokyocabinet_open(const char *path)
   TCBDB *db = tcbdbnew();
   if (!db)
     return NULL;
-  if (option(OPT_HEADER_CACHE_COMPRESS))
+  if (OPT_HEADER_CACHE_COMPRESS)
     tcbdbtune(db, 0, 0, 0, -1, -1, BDBTDEFLATE);
   if (tcbdbopen(db, path, BDBOWRITER | BDBOCREAT))
     return db;
index 004adc04a8fdd2daa41a28df3b784b9e84e2ec07..94043f30c780c0156eb071fdb42eb13458f49994 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -998,7 +998,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
       if (!optional)
       {
         make_from_addr(hdr->env, tmp, sizeof(tmp), 1);
-        if (!option(OPT_SAVE_ADDRESS) && (p = strpbrk(tmp, "%@")))
+        if (!OPT_SAVE_ADDRESS && (p = strpbrk(tmp, "%@")))
           *p = 0;
         mutt_format_s(buf, buflen, prec, tmp);
       }
index e6e737e6ced5d029935d3912df7ed9e21f334d56..ec84f7092ca6f09dbb89b44ea6760ad0471386ed 100644 (file)
--- a/header.c
+++ b/header.c
@@ -130,7 +130,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg,
      we can simply compare strings as we don't generate References for
      multiple Message-Ids in IRT anyways */
 #ifdef USE_NNTP
-  if (!option(OPT_NEWS_SEND))
+  if (!OPT_NEWS_SEND)
 #endif
     if (!STAILQ_EMPTY(&msg->env->in_reply_to) &&
         (STAILQ_EMPTY(&n->in_reply_to) ||
diff --git a/help.c b/help.c
index a459b78ec8e10fa313050c843678676eac9e6ad1..d0b8fe55edc920604671c0cc88ce6793448a8ef4 100644 (file)
--- a/help.c
+++ b/help.c
@@ -289,7 +289,7 @@ static void format_line(FILE *f, int ismacro, const char *t1, const char *t2, co
         else
         {
           n += col - MuttIndexWindow->cols;
-          if (option(OPT_MARKERS))
+          if (OPT_MARKERS)
             n++;
         }
         col = pad(f, n, col_b);
index 0673c79661fb4a0df4f526bc7b2a9e1d434884b2..5f53e68bae253f1630d4322a727fd6311af0852c 100644 (file)
--- a/history.c
+++ b/history.c
@@ -205,7 +205,7 @@ static void shrink_histfile(void)
   if (!f)
     return;
 
-  if (option(OPT_HISTORY_REMOVE_DUPS))
+  if (OPT_HISTORY_REMOVE_DUPS)
     for (hclass = 0; hclass < HC_LAST; hclass++)
       dup_hashes[hclass] = mutt_hash_create(MAX(10, SaveHistory * 2), MUTT_HASH_STRDUP_KEYS);
 
@@ -222,8 +222,7 @@ static void shrink_histfile(void)
     if (hclass >= HC_LAST)
       continue;
     *p = '\0';
-    if (option(OPT_HISTORY_REMOVE_DUPS) &&
-        (dup_hash_inc(dup_hashes[hclass], linebuf + read) > 1))
+    if (OPT_HISTORY_REMOVE_DUPS && (dup_hash_inc(dup_hashes[hclass], linebuf + read) > 1))
     {
       regen_file = true;
       continue;
@@ -265,8 +264,7 @@ static void shrink_histfile(void)
       if (hclass >= HC_LAST)
         continue;
       *p = '\0';
-      if (option(OPT_HISTORY_REMOVE_DUPS) &&
-          (dup_hash_dec(dup_hashes[hclass], linebuf + read) > 0))
+      if (OPT_HISTORY_REMOVE_DUPS && (dup_hash_dec(dup_hashes[hclass], linebuf + read) > 0))
       {
         continue;
       }
@@ -290,7 +288,7 @@ cleanup:
     mutt_file_fclose(&tmp);
     unlink(tmpfname);
   }
-  if (option(OPT_HISTORY_REMOVE_DUPS))
+  if (OPT_HISTORY_REMOVE_DUPS)
     for (hclass = 0; hclass < HC_LAST; hclass++)
       mutt_hash_destroy(&dup_hashes[hclass]);
 }
@@ -416,7 +414,7 @@ void mutt_history_add(enum HistoryClass hclass, const char *s, bool save)
      */
     if (*s != ' ' && (!h->hist[prev] || (mutt_str_strcmp(h->hist[prev], s) != 0)))
     {
-      if (option(OPT_HISTORY_REMOVE_DUPS))
+      if (OPT_HISTORY_REMOVE_DUPS)
         remove_history_dups(hclass, s);
       if (save && SaveHistory)
         save_history(hclass, s);
diff --git a/hook.c b/hook.c
index 05d08a2a8e1ac639c5a37854e9cbd85d54cddaac..75917828b20e478acd01e83034a2c0d85fa9e0aa 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -482,12 +482,12 @@ void mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr)
 
   if (addr_hook(path, pathlen, MUTT_FCCHOOK, NULL, hdr) != 0)
   {
-    if ((option(OPT_SAVE_NAME) || option(OPT_FORCE_NAME)) && (env->to || env->cc || env->bcc))
+    if ((OPT_SAVE_NAME || OPT_FORCE_NAME) && (env->to || env->cc || env->bcc))
     {
       adr = env->to ? env->to : (env->cc ? env->cc : env->bcc);
       mutt_safe_path(buf, sizeof(buf), adr);
       mutt_file_concat_path(path, NONULL(Folder), buf, pathlen);
-      if (!option(OPT_FORCE_NAME) && mx_access(path, W_OK) != 0)
+      if (!OPT_FORCE_NAME && mx_access(path, W_OK) != 0)
         mutt_str_strfcpy(path, NONULL(Record), pathlen);
     }
     else
index 411f8d7bc76983f0c7f6695c3e09928543236d85..87920ac9f8332d94cedfecac52c52cf0446642ce 100644 (file)
@@ -217,10 +217,9 @@ int imap_browse(char *path, struct BrowserState *state)
     return -1;
   }
 
-  save_lsub = option(OPT_IMAP_CHECK_SUBSCRIBED);
-  unset_option(OPT_IMAP_CHECK_SUBSCRIBED);
-  mutt_str_strfcpy(list_cmd, option(OPT_IMAP_LIST_SUBSCRIBED) ? "LSUB" : "LIST",
-                   sizeof(list_cmd));
+  save_lsub = OPT_IMAP_CHECK_SUBSCRIBED;
+  OPT_IMAP_CHECK_SUBSCRIBED = false;
+  mutt_str_strfcpy(list_cmd, OPT_IMAP_LIST_SUBSCRIBED ? "LSUB" : "LIST", sizeof(list_cmd));
 
   idata = imap_conn_find(&(mx.account), 0);
   if (!idata)
@@ -350,14 +349,14 @@ int imap_browse(char *path, struct BrowserState *state)
   mutt_clear_error();
 
   if (save_lsub)
-    set_option(OPT_IMAP_CHECK_SUBSCRIBED);
+    OPT_IMAP_CHECK_SUBSCRIBED = true;
 
   FREE(&mx.mbox);
   return 0;
 
 fail:
   if (save_lsub)
-    set_option(OPT_IMAP_CHECK_SUBSCRIBED);
+    OPT_IMAP_CHECK_SUBSCRIBED = true;
   FREE(&mx.mbox);
   return -1;
 }
index 00a2c5a70c03eac3d2a45ed87d02c0ee1ccbc369..2d0faa10439b5c60d92ab37b56c2da4ce23927ea 100644 (file)
@@ -495,7 +495,7 @@ static void cmd_parse_lsub(struct ImapData *idata, char *s)
     return;
   }
 
-  if (!option(OPT_IMAP_CHECK_SUBSCRIBED))
+  if (!OPT_IMAP_CHECK_SUBSCRIBED)
     return;
 
   idata->cmdtype = IMAP_CT_LIST;
@@ -736,7 +736,7 @@ static void cmd_parse_status(struct ImapData *idata, char *s)
         mutt_debug(3, "Found %s in buffy list (OV: %d ON: %d U: %d)\n", mailbox,
                    olduv, oldun, status->unseen);
 
-        if (option(OPT_MAIL_CHECK_RECENT))
+        if (OPT_MAIL_CHECK_RECENT)
         {
           if (olduv && olduv == status->uidvalidity)
           {
@@ -891,7 +891,7 @@ static int cmd_handle_untagged(struct ImapData *idata)
 
     return -1;
   }
-  else if (option(OPT_IMAP_SERVERNOISE) && (mutt_str_strncasecmp("NO", s, 2) == 0))
+  else if (OPT_IMAP_SERVERNOISE && (mutt_str_strncasecmp("NO", s, 2) == 0))
   {
     mutt_debug(2, "Handling untagged NO\n");
 
index fb2141439ee64723f85337b9e109a2e11c9891f5..c9fba3c86976ff5226a66378633f0e34e8d27f6d 100644 (file)
@@ -389,7 +389,7 @@ static int get_mailbox(const char *path, struct ImapData **hidata, char *buf, si
     mutt_debug(1, "Error parsing %s\n", path);
     return -1;
   }
-  if (!(*hidata = imap_conn_find(&(mx.account), option(OPT_IMAP_PASSIVE) ? MUTT_IMAP_CONN_NONEW : 0)) ||
+  if (!(*hidata = imap_conn_find(&(mx.account), OPT_IMAP_PASSIVE ? MUTT_IMAP_CONN_NONEW : 0)) ||
       (*hidata)->state < IMAP_AUTHENTICATED)
   {
     FREE(&mx.mbox);
@@ -652,7 +652,7 @@ int imap_access(const char *path)
   if (imap_parse_path(path, &mx))
     return -1;
 
-  idata = imap_conn_find(&mx.account, option(OPT_IMAP_PASSIVE) ? MUTT_IMAP_CONN_NONEW : 0);
+  idata = imap_conn_find(&mx.account, OPT_IMAP_PASSIVE ? MUTT_IMAP_CONN_NONEW : 0);
   if (!idata)
   {
     FREE(&mx.mbox);
@@ -761,8 +761,7 @@ int imap_delete_mailbox(struct Context *ctx, struct ImapMbox *mx)
 
   if (!ctx || !ctx->data)
   {
-    idata = imap_conn_find(&mx->account,
-                           option(OPT_IMAP_PASSIVE) ? MUTT_IMAP_CONN_NONEW : 0);
+    idata = imap_conn_find(&mx->account, OPT_IMAP_PASSIVE ? MUTT_IMAP_CONN_NONEW : 0);
     if (!idata)
     {
       FREE(&mx->mbox);
@@ -1026,7 +1025,7 @@ struct ImapData *imap_conn_find(const struct Account *account, int flags)
     /* get root delimiter, '/' as default */
     idata->delim = '/';
     imap_exec(idata, "LIST \"\" \"\"", IMAP_CMD_QUEUE);
-    if (option(OPT_IMAP_CHECK_SUBSCRIBED))
+    if (OPT_IMAP_CHECK_SUBSCRIBED)
       imap_exec(idata, "LSUB \"\" \"*\"", IMAP_CMD_QUEUE);
     /* we may need the root delimiter before we open a mailbox */
     imap_exec(idata, NULL, IMAP_CMD_FAIL_OK);
@@ -1066,11 +1065,11 @@ int imap_open_connection(struct ImapData *idata)
 #ifdef USE_SSL
     /* Attempt STARTTLS if available and desired. */
     if (!idata->conn->ssf &&
-        (option(OPT_SSL_FORCE_TLS) || mutt_bit_isset(idata->capabilities, STARTTLS)))
+        (OPT_SSL_FORCE_TLS || mutt_bit_isset(idata->capabilities, STARTTLS)))
     {
       int rc;
 
-      if (option(OPT_SSL_FORCE_TLS))
+      if (OPT_SSL_FORCE_TLS)
         rc = MUTT_YES;
       else if ((rc = query_quadoption(OPT_SSL_STARTTLS,
                                       _("Secure connection with TLS?"))) == MUTT_ABORT)
@@ -1100,7 +1099,7 @@ int imap_open_connection(struct ImapData *idata)
       }
     }
 
-    if (option(OPT_SSL_FORCE_TLS) && !idata->conn->ssf)
+    if (OPT_SSL_FORCE_TLS && !idata->conn->ssf)
     {
       mutt_error(_("Encrypted connection unavailable"));
       mutt_sleep(1);
@@ -1412,7 +1411,7 @@ int imap_check(struct ImapData *idata, int force)
   int result = 0;
 
   /* try IDLE first, unless force is set */
-  if (!force && option(OPT_IMAP_IDLE) && mutt_bit_isset(idata->capabilities, IDLE) &&
+  if (!force && OPT_IMAP_IDLE && mutt_bit_isset(idata->capabilities, IDLE) &&
       (idata->state != IMAP_IDLE || time(NULL) >= idata->lastread + ImapKeepalive))
   {
     if (imap_cmd_idle(idata) < 0)
@@ -1764,7 +1763,7 @@ int imap_subscribe(char *path, bool subscribe)
   if (!*buf)
     mutt_str_strfcpy(buf, "INBOX", sizeof(buf));
 
-  if (option(OPT_IMAP_CHECK_SUBSCRIBED))
+  if (OPT_IMAP_CHECK_SUBSCRIBED)
   {
     mutt_buffer_init(&token);
     mutt_buffer_init(&err);
@@ -1849,7 +1848,7 @@ int imap_complete(char *dest, size_t dlen, char *path)
 
   /* fire off command */
   snprintf(buf, sizeof(buf), "%s \"\" \"%s%%\"",
-           option(OPT_IMAP_LIST_SUBSCRIBED) ? "LSUB" : "LIST", list);
+           OPT_IMAP_LIST_SUBSCRIBED ? "LSUB" : "LIST", list);
 
   imap_cmd_start(idata, buf);
 
@@ -1987,7 +1986,7 @@ int imap_fast_trash(struct Context *ctx, char *dest)
         break;
       mutt_debug(3, "server suggests TRYCREATE\n");
       snprintf(prompt, sizeof(prompt), _("Create %s?"), mbox);
-      if (option(OPT_CONFIRMCREATE) && mutt_yesorno(prompt, 1) != MUTT_YES)
+      if (OPT_CONFIRMCREATE && mutt_yesorno(prompt, 1) != MUTT_YES)
       {
         mutt_clear_error();
         goto out;
@@ -2282,7 +2281,7 @@ static int imap_open_mailbox_append(struct Context *ctx, int flags)
     return -1;
 
   snprintf(buf, sizeof(buf), _("Create %s?"), mailbox);
-  if (option(OPT_CONFIRMCREATE) && mutt_yesorno(buf, 1) != MUTT_YES)
+  if (OPT_CONFIRMCREATE && mutt_yesorno(buf, 1) != MUTT_YES)
     return -1;
 
   if (imap_create_mailbox(idata, mailbox) < 0)
@@ -2585,7 +2584,7 @@ int imap_sync_mailbox(struct Context *ctx, int expunge)
     idata->state = IMAP_AUTHENTICATED;
   }
 
-  if (option(OPT_MESSAGE_CACHE_CLEAN))
+  if (OPT_MESSAGE_CACHE_CLEAN)
     imap_cache_clean(idata);
 
   rc = 0;
index b72610f4241fa589cb2ac39aef2981b143cc66ec..a6fd9633a421084d2f1f05e0d5444b7ab64ca6e5 100644 (file)
@@ -260,7 +260,7 @@ static char *msg_parse_flags(struct ImapHeader *h, char *s)
     else if (mutt_str_strncasecmp("old", s, 3) == 0)
     {
       s += 3;
-      hd->old = option(OPT_MARK_OLD) ? true : false;
+      hd->old = OPT_MARK_OLD ? true : false;
     }
     else
     {
@@ -1072,7 +1072,7 @@ int imap_fetch_message(struct Context *ctx, struct Message *msg, int msgno)
 
   snprintf(buf, sizeof(buf), "UID FETCH %u %s", HEADER_DATA(h)->uid,
            (mutt_bit_isset(idata->capabilities, IMAP4REV1) ?
-                (option(OPT_IMAP_PEEK) ? "BODY.PEEK[]" : "BODY[]") :
+                (OPT_IMAP_PEEK ? "BODY.PEEK[]" : "BODY[]") :
                 "RFC822"));
 
   imap_cmd_start(idata, buf);
@@ -1511,7 +1511,7 @@ int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, int de
         break;
       mutt_debug(3, "server suggests TRYCREATE\n");
       snprintf(prompt, sizeof(prompt), _("Create %s?"), mbox);
-      if (option(OPT_CONFIRMCREATE) && mutt_yesorno(prompt, 1) != MUTT_YES)
+      if (OPT_CONFIRMCREATE && mutt_yesorno(prompt, 1) != MUTT_YES)
       {
         mutt_clear_error();
         goto out;
@@ -1540,7 +1540,7 @@ int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, int de
 
         mutt_set_flag(ctx, ctx->hdrs[i], MUTT_DELETE, 1);
         mutt_set_flag(ctx, ctx->hdrs[i], MUTT_PURGE, 1);
-        if (option(OPT_DELETE_UNTAG))
+        if (OPT_DELETE_UNTAG)
           mutt_set_flag(ctx, ctx->hdrs[i], MUTT_TAG, 0);
       }
     }
@@ -1548,7 +1548,7 @@ int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, int de
     {
       mutt_set_flag(ctx, h, MUTT_DELETE, 1);
       mutt_set_flag(ctx, h, MUTT_PURGE, 1);
-      if (option(OPT_DELETE_UNTAG))
+      if (OPT_DELETE_UNTAG)
         mutt_set_flag(ctx, h, MUTT_TAG, 0);
     }
   }
index bb782e0548427b7e3b8a60fbd764c4971ebc9585..da960dc8e43ab9c71717d86977625546389bc412 100644 (file)
@@ -974,10 +974,10 @@ int imap_wait_keepalive(pid_t pid)
   sigset_t oldmask;
   int rc;
 
-  bool imap_passive = option(OPT_IMAP_PASSIVE);
+  bool imap_passive = OPT_IMAP_PASSIVE;
 
-  set_option(OPT_IMAP_PASSIVE);
-  set_option(OPT_KEEP_QUIET);
+  OPT_IMAP_PASSIVE = true;
+  OPT_KEEP_QUIET = true;
 
   sigprocmask(SIG_SETMASK, NULL, &oldmask);
 
@@ -1004,9 +1004,9 @@ int imap_wait_keepalive(pid_t pid)
   sigaction(SIGALRM, &oldalrm, NULL);
   sigprocmask(SIG_SETMASK, &oldmask, NULL);
 
-  unset_option(OPT_KEEP_QUIET);
+  OPT_KEEP_QUIET = false;
   if (!imap_passive)
-    unset_option(OPT_IMAP_PASSIVE);
+    OPT_IMAP_PASSIVE = false;
 
   return rc;
 }
diff --git a/init.c b/init.c
index 243dad6a178ff57445e3463998580e5a3ff3d11f..74173094e62f034d025ed21f12a39b8a2ad0c88b 100644 (file)
--- a/init.c
+++ b/init.c
@@ -162,12 +162,12 @@ static char *getmailname(void)
 }
 #endif
 
-static void toggle_quadoption(int opt)
+static int toggle_quadoption(int opt)
 {
-  int n = opt / 4;
-  int b = (opt % 4) * 2;
-
-  QuadOptions[n] ^= (1 << b);
+  /* toggle the low bit
+   * MUTT_NO    <--> MUTT_YES
+   * MUTT_ASKNO <--> MUTT_ASKYES */
+  return opt ^= 1;
 }
 
 static int parse_regex(int idx, struct Buffer *tmp, struct Buffer *err)
@@ -229,37 +229,18 @@ static int parse_regex(int idx, struct Buffer *tmp, struct Buffer *err)
   return 1;
 }
 
-void set_quadoption(int opt, int flag)
-{
-  int n = opt / 4;
-  int b = (opt % 4) * 2;
-
-  QuadOptions[n] &= ~(0x3 << b);
-  QuadOptions[n] |= (flag & 0x3) << b;
-}
-
-int quadoption(int opt)
-{
-  int n = opt / 4;
-  int b = (opt % 4) * 2;
-
-  return (QuadOptions[n] >> b) & 0x3;
-}
-
 int query_quadoption(int opt, const char *prompt)
 {
-  int v = quadoption(opt);
-
-  switch (v)
+  switch (opt)
   {
     case MUTT_YES:
     case MUTT_NO:
-      return v;
+      return opt;
 
     default:
-      v = mutt_yesorno(prompt, (v == MUTT_ASKYES));
+      opt = mutt_yesorno(prompt, (opt == MUTT_ASKYES));
       mutt_window_clearline(MuttMessageWindow, 0);
-      return v;
+      return opt;
   }
 
   /* not reached */
@@ -520,12 +501,12 @@ int mutt_option_set(const struct Option *val, struct Buffer *err)
       break;
       case DT_BOOL:
         if (val->data)
-          set_option(MuttVars[idx].data);
+          *(bool *) MuttVars[idx].data = true;
         else
-          unset_option(MuttVars[idx].data);
+          *(bool *) MuttVars[idx].data = false;
         break;
       case DT_QUAD:
-        set_quadoption(MuttVars[idx].data, val->data);
+        *(short *) MuttVars[idx].data = val->data;
         break;
       case DT_NUMBER:
         *((short *) MuttVars[idx].data) = val->data;
@@ -1791,7 +1772,7 @@ static int parse_alias(struct Buffer *buf, struct Buffer *s, unsigned long data,
     tmp->name = mutt_str_strdup(buf->data);
     /* give the main addressbook code a chance */
     if (CurrentMenu == MENU_ALIAS)
-      set_option(OPT_MENU_CALLER);
+      OPT_MENU_CALLER = true;
   }
   else
   {
@@ -1983,12 +1964,12 @@ static void restore_default(struct Option *p)
       break;
     case DT_BOOL:
       if (p->init)
-        set_option(p->data);
+        *(bool *) p->data = true;
       else
-        unset_option(p->data);
+        *(bool *) p->data = false;
       break;
     case DT_QUAD:
-      set_quadoption(p->data, p->init);
+      *(unsigned char *) p->data = p->init;
       break;
     case DT_NUMBER:
     case DT_SORT:
@@ -2059,13 +2040,13 @@ static void restore_default(struct Option *p)
     mutt_set_menu_redraw(MENU_PAGER, REDRAW_FLOW);
   }
   if (p->flags & R_RESORT_SUB)
-    set_option(OPT_SORT_SUBTHREADS);
+    OPT_SORT_SUBTHREADS = true;
   if (p->flags & R_RESORT)
-    set_option(OPT_NEED_RESORT);
+    OPT_NEED_RESORT = true;
   if (p->flags & R_RESORT_INIT)
-    set_option(OPT_RESORT_INIT);
+    OPT_RESORT_INIT = true;
   if (p->flags & R_TREE)
-    set_option(OPT_REDRAW_TREE);
+    OPT_REDRAW_TREE = true;
   if (p->flags & R_REFLOW)
     mutt_reflow_windows();
 #ifdef USE_SIDEBAR
@@ -2454,10 +2435,10 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data,
         for (idx = 0; MuttVars[idx].option; idx++)
           restore_default(&MuttVars[idx]);
         mutt_set_current_menu_redraw_full();
-        set_option(OPT_SORT_SUBTHREADS);
-        set_option(OPT_NEED_RESORT);
-        set_option(OPT_RESORT_INIT);
-        set_option(OPT_REDRAW_TREE);
+        OPT_SORT_SUBTHREADS = true;
+        OPT_NEED_RESORT = true;
+        OPT_RESORT_INIT = true;
+        OPT_REDRAW_TREE = true;
         return 0;
       }
       else
@@ -2496,19 +2477,19 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data,
 
       if (query)
       {
-        snprintf(err->data, err->dsize,
-                 option(MuttVars[idx].data) ? _("%s is set") : _("%s is unset"),
+        snprintf(err->data,
+                 err->dsize, *(bool *) MuttVars[idx].data ? _("%s is set") : _("%s is unset"),
                  tmp->data);
         return 0;
       }
 
       CHECK_PAGER;
       if (unset)
-        unset_option(MuttVars[idx].data);
+        *(bool *) MuttVars[idx].data = false;
       else if (inv)
-        toggle_option(MuttVars[idx].data);
+        *(bool *) MuttVars[idx].data = !(*(bool *) MuttVars[idx].data);
       else
-        set_option(MuttVars[idx].data);
+        *(bool *) MuttVars[idx].data = true;
     }
     else if (myvar || DTYPE(MuttVars[idx].type) == DT_STRING ||
              DTYPE(MuttVars[idx].type) == DT_PATH || DTYPE(MuttVars[idx].type) == DT_ADDRESS ||
@@ -2663,7 +2644,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data,
         break;
       }
 
-      if (option(OPT_ATTACH_MSG) &&
+      if (OPT_ATTACH_MSG &&
           (mutt_str_strcmp(MuttVars[idx].option, "reply_regexp") == 0))
       {
         snprintf(err->data, err->dsize,
@@ -2816,7 +2797,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data,
         static const char *const vals[] = { "no", "yes", "ask-no", "ask-yes" };
 
         snprintf(err->data, err->dsize, "%s=%s", MuttVars[idx].option,
-                 vals[quadoption(MuttVars[idx].data)]);
+                 vals[*(unsigned char *) MuttVars[idx].data]);
         break;
       }
 
@@ -2826,13 +2807,13 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data,
         s->dptr++;
         mutt_extract_token(tmp, s, 0);
         if (mutt_str_strcasecmp("yes", tmp->data) == 0)
-          set_quadoption(MuttVars[idx].data, MUTT_YES);
+          MuttVars[idx].data = MUTT_YES;
         else if (mutt_str_strcasecmp("no", tmp->data) == 0)
-          set_quadoption(MuttVars[idx].data, MUTT_NO);
+          MuttVars[idx].data = MUTT_NO;
         else if (mutt_str_strcasecmp("ask-yes", tmp->data) == 0)
-          set_quadoption(MuttVars[idx].data, MUTT_ASKYES);
+          MuttVars[idx].data = MUTT_ASKYES;
         else if (mutt_str_strcasecmp("ask-no", tmp->data) == 0)
-          set_quadoption(MuttVars[idx].data, MUTT_ASKNO);
+          MuttVars[idx].data = MUTT_ASKNO;
         else
         {
           snprintf(err->data, err->dsize, _("%s: invalid value"), tmp->data);
@@ -2845,9 +2826,9 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data,
         if (inv)
           toggle_quadoption(MuttVars[idx].data);
         else if (unset)
-          set_quadoption(MuttVars[idx].data, MUTT_NO);
+          MuttVars[idx].data = MUTT_NO;
         else
-          set_quadoption(MuttVars[idx].data, MUTT_YES);
+          MuttVars[idx].data = MUTT_YES;
       }
     }
     else if (DTYPE(MuttVars[idx].type) == DT_SORT)
@@ -2950,13 +2931,13 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data,
         mutt_set_menu_redraw(MENU_PAGER, REDRAW_FLOW);
       }
       if (MuttVars[idx].flags & R_RESORT_SUB)
-        set_option(OPT_SORT_SUBTHREADS);
+        OPT_SORT_SUBTHREADS = true;
       if (MuttVars[idx].flags & R_RESORT)
-        set_option(OPT_NEED_RESORT);
+        OPT_NEED_RESORT = true;
       if (MuttVars[idx].flags & R_RESORT_INIT)
-        set_option(OPT_RESORT_INIT);
+        OPT_RESORT_INIT = true;
       if (MuttVars[idx].flags & R_TREE)
-        set_option(OPT_REDRAW_TREE);
+        OPT_REDRAW_TREE = true;
       if (MuttVars[idx].flags & R_REFLOW)
         mutt_reflow_windows();
 #ifdef USE_SIDEBAR
@@ -3665,7 +3646,7 @@ int var_to_string(int idx, char *val, size_t len)
     rfc822_write_address(tmp, sizeof(tmp), *((struct Address **) MuttVars[idx].data), 0);
   }
   else if (DTYPE(MuttVars[idx].type) == DT_QUAD)
-    mutt_str_strfcpy(tmp, vals[quadoption(MuttVars[idx].data)], sizeof(tmp));
+    mutt_str_strfcpy(tmp, vals[*(unsigned char *) MuttVars[idx].data], sizeof(tmp));
   else if (DTYPE(MuttVars[idx].type) == DT_NUMBER)
   {
     short sval = *((short *) MuttVars[idx].data);
@@ -3728,7 +3709,7 @@ int var_to_string(int idx, char *val, size_t len)
     mutt_str_strfcpy(tmp, p, sizeof(tmp));
   }
   else if (DTYPE(MuttVars[idx].type) == DT_BOOL)
-    mutt_str_strfcpy(tmp, option(MuttVars[idx].data) ? "yes" : "no", sizeof(tmp));
+    mutt_str_strfcpy(tmp, *(bool *) MuttVars[idx].data ? "yes" : "no", sizeof(tmp));
   else
     return 0;
 
@@ -4106,7 +4087,7 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands)
 #ifdef HAVE_GETSID
   /* Unset suspend by default if we're the session leader */
   if (getsid(0) == getpid())
-    unset_option(OPT_SUSPEND);
+    OPT_SUSPEND = false;
 #endif
 
   mutt_init_history();
@@ -4206,7 +4187,7 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands)
   {
     if (np->data)
     {
-      if (!option(OPT_NO_CURSES))
+      if (!OPT_NO_CURSES)
         endwin();
       if (source_rc(np->data, &err) != 0)
       {
@@ -4220,7 +4201,7 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands)
   if (execute_commands(commands) != 0)
     need_pause = 1;
 
-  if (need_pause && !option(OPT_NO_CURSES))
+  if (need_pause && !OPT_NO_CURSES)
   {
     if (mutt_any_key_to_continue(NULL) == -1)
       mutt_exit(1);
@@ -4231,7 +4212,7 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands)
   mutt_read_histfile();
 
 #ifdef USE_NOTMUCH
-  if (option(OPT_VIRTUAL_SPOOLFILE))
+  if (OPT_VIRTUAL_SPOOLFILE)
   {
     /* Find the first virtual folder and open it */
     for (struct Buffy *b = Incoming; b; b = b->next)
diff --git a/init.h b/init.h
index 26bfd27c391367b87c92c525aa8c376560e91597..0b3bc2209ba9c54c95a65d1e3ba84f297409c8ab 100644 (file)
--- a/init.h
+++ b/init.h
@@ -85,7 +85,7 @@ struct Buffer;
 struct Option MuttVars[] = {
   /*++*/
 
-  { "abort_noattach", DT_QUAD, R_NONE, OPT_ABORT_NOATTACH, MUTT_NO },
+  { "abort_noattach", DT_QUAD, R_NONE, UL &OPT_ABORT_NOATTACH, MUTT_NO },
   /*
   ** .pp
   ** If set to \fIyes\fP, when composing messages containing the regular expression
@@ -98,7 +98,7 @@ struct Option MuttVars[] = {
   ** set attach_keyword = "\\<attach(|ed|ments?)\\>"
   ** .te
   */
-  { "abort_nosubject",  DT_QUAD, R_NONE, OPT_ABORT_NOSUBJECT, MUTT_ASKYES },
+  { "abort_nosubject",  DT_QUAD, R_NONE, UL &OPT_ABORT_NOSUBJECT, MUTT_ASKYES },
   /*
   ** .pp
   ** If set to \fIyes\fP, when composing messages and no subject is given
@@ -106,7 +106,7 @@ struct Option MuttVars[] = {
   ** \fIno\fP, composing messages with no subject given at the subject
   ** prompt will never be aborted.
   */
-  { "abort_unmodified", DT_QUAD, R_NONE, OPT_ABORT_UNMODIFIED, MUTT_YES },
+  { "abort_unmodified", DT_QUAD, R_NONE, UL &OPT_ABORT_UNMODIFIED, MUTT_YES },
   /*
   ** .pp
   ** If set to \fIyes\fP, composition will automatically abort after
@@ -142,13 +142,13 @@ struct Option MuttVars[] = {
   ** .dt %t .dd Character which indicates if the alias is tagged for inclusion
   ** .de
   */
-  { "allow_8bit",       DT_BOOL, R_NONE, OPT_ALLOW_8BIT, 1 },
+  { "allow_8bit",       DT_BOOL, R_NONE, UL &OPT_ALLOW_8BIT, 1 },
   /*
   ** .pp
   ** Controls whether 8-bit data is converted to 7-bit using either Quoted-
   ** Printable or Base64 encoding when sending mail.
   */
-  { "allow_ansi",      DT_BOOL, R_NONE, OPT_ALLOW_ANSI, 0 },
+  { "allow_ansi",      DT_BOOL, R_NONE, UL &OPT_ALLOW_ANSI, 0 },
   /*
   ** .pp
   ** Controls whether ANSI color codes in messages (and color tags in
@@ -164,7 +164,7 @@ struct Option MuttVars[] = {
   ** and give it the same color as your attachment color (see also
   ** $$crypt_timestamp).
   */
-  { "arrow_cursor",     DT_BOOL, R_MENU, OPT_ARROW_CURSOR, 0 },
+  { "arrow_cursor",     DT_BOOL, R_MENU, UL &OPT_ARROW_CURSOR, 0 },
   /*
   ** .pp
   ** When \fIset\fP, an arrow (``->'') will be used to indicate the current entry
@@ -173,32 +173,32 @@ struct Option MuttVars[] = {
   ** be redrawn on the screen when moving to the next or previous entries
   ** in the menu.
   */
-  { "ascii_chars",      DT_BOOL, R_BOTH, OPT_ASCII_CHARS, 0 },
+  { "ascii_chars",      DT_BOOL, R_BOTH, UL &OPT_ASCII_CHARS, 0 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will use plain ASCII characters when displaying thread
   ** and attachment trees, instead of the default \fIACS\fP characters.
   */
-  { "askbcc",           DT_BOOL, R_NONE, OPT_ASKBCC, 0 },
+  { "askbcc",           DT_BOOL, R_NONE, UL &OPT_ASKBCC, 0 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will prompt you for blind-carbon-copy (Bcc) recipients
   ** before editing an outgoing message.
   */
-  { "askcc",            DT_BOOL, R_NONE, OPT_ASKCC, 0 },
+  { "askcc",            DT_BOOL, R_NONE, UL &OPT_ASKCC, 0 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will prompt you for carbon-copy (Cc) recipients before
   ** editing the body of an outgoing message.
   */
 #ifdef USE_NNTP
-  { "ask_follow_up",    DT_BOOL, R_NONE, OPT_ASK_FOLLOW_UP, 0 },
+  { "ask_follow_up",    DT_BOOL, R_NONE, UL &OPT_ASK_FOLLOW_UP, 0 },
   /*
   ** .pp
   ** If set, NeoMutt will prompt you for follow-up groups before editing
   ** the body of an outgoing message.
   */
-  { "ask_x_comment_to", DT_BOOL, R_NONE, OPT_ASK_X_COMMENT_TO, 0 },
+  { "ask_x_comment_to", DT_BOOL, R_NONE, UL &OPT_ASK_X_COMMENT_TO, 0 },
   /*
   ** .pp
   ** If set, NeoMutt will prompt you for x-comment-to field before editing
@@ -284,7 +284,7 @@ struct Option MuttVars[] = {
   ** The separator to add between attachments when operating (saving,
   ** printing, piping, etc) on a list of tagged attachments.
   */
-  { "attach_split",     DT_BOOL, R_NONE, OPT_ATTACH_SPLIT, 1 },
+  { "attach_split",     DT_BOOL, R_NONE, UL &OPT_ATTACH_SPLIT, 1 },
   /*
   ** .pp
   ** If this variable is \fIunset\fP, when operating (saving, printing, piping,
@@ -312,7 +312,7 @@ struct Option MuttVars[] = {
   ** will use your locale environment, so there is no need to set
   ** this except to override that default.
   */
-  { "auto_tag",         DT_BOOL, R_NONE, OPT_AUTO_TAG, 0 },
+  { "auto_tag",         DT_BOOL, R_NONE, UL &OPT_AUTO_TAG, 0 },
   /*
   ** .pp
   ** When \fIset\fP, functions in the \fIindex\fP menu which affect a message
@@ -320,7 +320,7 @@ struct Option MuttVars[] = {
   ** unset, you must first use the \fC<tag-prefix>\fP function (bound to ``;''
   ** by default) to make the next function apply to all tagged messages.
   */
-  { "autoedit",         DT_BOOL, R_NONE, OPT_AUTOEDIT, 0 },
+  { "autoedit",         DT_BOOL, R_NONE, UL &OPT_AUTOEDIT, 0 },
   /*
   ** .pp
   ** When \fIset\fP along with $$edit_headers, NeoMutt will skip the initial
@@ -335,19 +335,19 @@ struct Option MuttVars[] = {
   ** .pp
   ** Also see $$fast_reply.
   */
-  { "beep",             DT_BOOL, R_NONE, OPT_BEEP, 1 },
+  { "beep",             DT_BOOL, R_NONE, UL &OPT_BEEP, 1 },
   /*
   ** .pp
   ** When this variable is \fIset\fP, NeoMutt will beep when an error occurs.
   */
-  { "beep_new",         DT_BOOL, R_NONE, OPT_BEEP_NEW, 0 },
+  { "beep_new",         DT_BOOL, R_NONE, UL &OPT_BEEP_NEW, 0 },
   /*
   ** .pp
   ** When this variable is \fIset\fP, NeoMutt will beep whenever it prints a message
   ** notifying you of new mail.  This is independent of the setting of the
   ** $$beep variable.
   */
-  { "bounce",   DT_QUAD, R_NONE, OPT_BOUNCE, MUTT_ASKYES },
+  { "bounce",   DT_QUAD, R_NONE, UL &OPT_BOUNCE, MUTT_ASKYES },
   /*
   ** .pp
   ** Controls whether you will be asked to confirm bouncing messages.
@@ -355,13 +355,13 @@ struct Option MuttVars[] = {
   ** message. Setting this variable to \fIno\fP is not generally useful,
   ** and thus not recommended, because you are unable to bounce messages.
   */
-  { "bounce_delivered", DT_BOOL, R_NONE, OPT_BOUNCE_DELIVERED, 1 },
+  { "bounce_delivered", DT_BOOL, R_NONE, UL &OPT_BOUNCE_DELIVERED, 1 },
   /*
   ** .pp
   ** When this variable is \fIset\fP, NeoMutt will include Delivered-To headers when
   ** bouncing messages.  Postfix users may wish to \fIunset\fP this variable.
   */
-  { "braille_friendly", DT_BOOL, R_NONE, OPT_BRAILLE_FRIENDLY, 0 },
+  { "braille_friendly", DT_BOOL, R_NONE, UL &OPT_BRAILLE_FRIENDLY, 0 },
   /*
   ** .pp
   ** When this variable is \fIset\fP, NeoMutt will place the cursor at the beginning
@@ -371,7 +371,7 @@ struct Option MuttVars[] = {
   ** visual terminals don't permit making the cursor invisible.
   */
 #ifdef USE_NNTP
-  { "catchup_newsgroup", DT_QUAD, R_NONE, OPT_CATCHUP_NEWSGROUP, MUTT_ASKYES },
+  { "catchup_newsgroup", DT_QUAD, R_NONE, UL &OPT_CATCHUP_NEWSGROUP, MUTT_ASKYES },
   /*
   ** .pp
   ** If this variable is \fIset\fP, NeoMutt will mark all articles in newsgroup
@@ -399,7 +399,7 @@ struct Option MuttVars[] = {
   **
   */
 #endif
-  { "change_folder_next", DT_BOOL, R_NONE, OPT_CHANGE_FOLDER_NEXT, 0 },
+  { "change_folder_next", DT_BOOL, R_NONE, UL &OPT_CHANGE_FOLDER_NEXT, 0 },
   /*
   ** .pp
   ** When this variable is \fIset\fP, the \fC<change-folder>\fP function
@@ -418,7 +418,7 @@ struct Option MuttVars[] = {
   ** \fBNote:\fP It should only be set in case NeoMutt isn't able to determine the
   ** character set used correctly.
   */
-  { "check_mbox_size",  DT_BOOL, R_NONE, OPT_CHECK_MBOX_SIZE, 0 },
+  { "check_mbox_size",  DT_BOOL, R_NONE, UL &OPT_CHECK_MBOX_SIZE, 0 },
   /*
   ** .pp
   ** When this variable is \fIset\fP, NeoMutt will use file size attribute instead of
@@ -433,7 +433,7 @@ struct Option MuttVars[] = {
   ** mailbox by performing a fast mailbox scan when it is defined.
   ** Afterwards the new mail status is tracked by file size changes.
   */
-  { "check_new",        DT_BOOL, R_NONE, OPT_CHECK_NEW, 1 },
+  { "check_new",        DT_BOOL, R_NONE, UL &OPT_CHECK_NEW, 1 },
   /*
   ** .pp
   ** \fBNote:\fP this option only affects \fImaildir\fP and \fIMH\fP style
@@ -446,13 +446,13 @@ struct Option MuttVars[] = {
   ** this variable is \fIunset\fP, no check for new mail is performed
   ** while the mailbox is open.
   */
-  { "collapse_unread",  DT_BOOL, R_NONE, OPT_COLLAPSE_UNREAD, 1 },
+  { "collapse_unread",  DT_BOOL, R_NONE, UL &OPT_COLLAPSE_UNREAD, 1 },
   /*
   ** .pp
   ** When \fIunset\fP, NeoMutt will not collapse a thread if it contains any
   ** unread messages.
   */
-  { "collapse_flagged", DT_BOOL, R_NONE, OPT_COLLAPSE_FLAGGED, 1 },
+  { "collapse_flagged", DT_BOOL, R_NONE, UL &OPT_COLLAPSE_FLAGGED, 1 },
   /*
   ** .pp
   ** When \fIunset\fP, NeoMutt will not collapse a thread if it contains any
@@ -488,13 +488,13 @@ struct Option MuttVars[] = {
   ** characters as question marks which can lead to undesired
   ** side effects (for example in regular expressions).
   */
-  { "confirmappend",    DT_BOOL, R_NONE, OPT_CONFIRMAPPEND, 1 },
+  { "confirmappend",    DT_BOOL, R_NONE, UL &OPT_CONFIRMAPPEND, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will prompt for confirmation when appending messages to
   ** an existing mailbox.
   */
-  { "confirmcreate",    DT_BOOL, R_NONE, OPT_CONFIRMCREATE, 1 },
+  { "confirmcreate",    DT_BOOL, R_NONE, UL &OPT_CONFIRMCREATE, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will prompt for confirmation when saving messages to a
@@ -512,7 +512,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** Sets the default Content-Type for the body of newly composed messages.
   */
-  { "copy",             DT_QUAD, R_NONE, OPT_COPY, MUTT_YES },
+  { "copy",             DT_QUAD, R_NONE, UL &OPT_COPY, MUTT_YES },
   /*
   ** .pp
   ** This variable controls whether or not copies of your outgoing messages
@@ -520,7 +520,7 @@ struct Option MuttVars[] = {
   ** $$save_name, $$force_name and ``$fcc-hook''.
   */
   { "pgp_autoencrypt",          DT_SYNONYM,  R_NONE, UL "crypt_autoencrypt", 0 },
-  { "crypt_autoencrypt",        DT_BOOL, R_NONE, OPT_CRYPT_AUTOENCRYPT, 0 },
+  { "crypt_autoencrypt",        DT_BOOL, R_NONE, UL &OPT_CRYPT_AUTOENCRYPT, 0 },
   /*
   ** .pp
   ** Setting this variable will cause NeoMutt to always attempt to PGP
@@ -532,7 +532,7 @@ struct Option MuttVars[] = {
   ** settings can be overridden by use of the smime menu instead.
   ** (Crypto only)
   */
-  { "crypt_autopgp",    DT_BOOL, R_NONE, OPT_CRYPT_AUTOPGP, 1 },
+  { "crypt_autopgp",    DT_BOOL, R_NONE, UL &OPT_CRYPT_AUTOPGP, 1 },
   /*
   ** .pp
   ** This variable controls whether or not NeoMutt may automatically enable
@@ -541,7 +541,7 @@ struct Option MuttVars[] = {
   ** $$crypt_autosign, $$crypt_replysign and $$smime_is_default.
   */
   { "pgp_autosign",     DT_SYNONYM,  R_NONE, UL "crypt_autosign", 0 },
-  { "crypt_autosign",   DT_BOOL, R_NONE, OPT_CRYPT_AUTOSIGN, 0 },
+  { "crypt_autosign",   DT_BOOL, R_NONE, UL &OPT_CRYPT_AUTOSIGN, 0 },
   /*
   ** .pp
   ** Setting this variable will cause NeoMutt to always attempt to
@@ -552,7 +552,7 @@ struct Option MuttVars[] = {
   ** be overridden by use of the smime menu instead of the pgp menu.
   ** (Crypto only)
   */
-  { "crypt_autosmime",  DT_BOOL, R_NONE, OPT_CRYPT_AUTOSMIME, 1 },
+  { "crypt_autosmime",  DT_BOOL, R_NONE, UL &OPT_CRYPT_AUTOSMIME, 1 },
   /*
   ** .pp
   ** This variable controls whether or not NeoMutt may automatically enable
@@ -560,7 +560,7 @@ struct Option MuttVars[] = {
   ** $$crypt_replyencrypt,
   ** $$crypt_autosign, $$crypt_replysign and $$smime_is_default.
   */
-  { "crypt_confirmhook",        DT_BOOL, R_NONE, OPT_CRYPT_CONFIRMHOOK, 1 },
+  { "crypt_confirmhook",        DT_BOOL, R_NONE, UL &OPT_CRYPT_CONFIRMHOOK, 1 },
   /*
   ** .pp
   ** If set, then you will be prompted for confirmation of keys when using
@@ -568,7 +568,7 @@ struct Option MuttVars[] = {
   ** be presented.  This is generally considered unsafe, especially where
   ** typos are concerned.
   */
-  { "crypt_opportunistic_encrypt", DT_BOOL, R_NONE, OPT_CRYPT_OPPORTUNISTIC_ENCRYPT, 0 },
+  { "crypt_opportunistic_encrypt", DT_BOOL, R_NONE, UL &OPT_CRYPT_OPPORTUNISTIC_ENCRYPT, 0 },
   /*
   ** .pp
   ** Setting this variable will cause NeoMutt to automatically enable and
@@ -590,7 +590,7 @@ struct Option MuttVars[] = {
   ** (Crypto only)
    */
   { "pgp_replyencrypt",         DT_SYNONYM,  R_NONE, UL "crypt_replyencrypt", 1  },
-  { "crypt_replyencrypt",       DT_BOOL, R_NONE, OPT_CRYPT_REPLYENCRYPT, 1 },
+  { "crypt_replyencrypt",       DT_BOOL, R_NONE, UL &OPT_CRYPT_REPLYENCRYPT, 1 },
   /*
   ** .pp
   ** If \fIset\fP, automatically PGP or OpenSSL encrypt replies to messages which are
@@ -598,7 +598,7 @@ struct Option MuttVars[] = {
   ** (Crypto only)
   */
   { "pgp_replysign",    DT_SYNONYM, R_NONE, UL "crypt_replysign", 0 },
-  { "crypt_replysign",  DT_BOOL, R_NONE, OPT_CRYPT_REPLYSIGN, 0 },
+  { "crypt_replysign",  DT_BOOL, R_NONE, UL &OPT_CRYPT_REPLYSIGN, 0 },
   /*
   ** .pp
   ** If \fIset\fP, automatically PGP or OpenSSL sign replies to messages which are
@@ -609,7 +609,7 @@ struct Option MuttVars[] = {
   ** (Crypto only)
   */
   { "pgp_replysignencrypted",   DT_SYNONYM,  R_NONE, UL "crypt_replysignencrypted", 0 },
-  { "crypt_replysignencrypted", DT_BOOL, R_NONE, OPT_CRYPT_REPLYSIGNENCRYPTED, 0 },
+  { "crypt_replysignencrypted", DT_BOOL, R_NONE, UL &OPT_CRYPT_REPLYSIGNENCRYPTED, 0 },
   /*
   ** .pp
   ** If \fIset\fP, automatically PGP or OpenSSL sign replies to messages
@@ -620,7 +620,7 @@ struct Option MuttVars[] = {
   ** to find out whether an encrypted message is also signed.
   ** (Crypto only)
   */
-  { "crypt_timestamp", DT_BOOL, R_NONE, OPT_CRYPT_TIMESTAMP, 1 },
+  { "crypt_timestamp", DT_BOOL, R_NONE, UL &OPT_CRYPT_TIMESTAMP, 1 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will include a time stamp in the lines surrounding
@@ -629,7 +629,7 @@ struct Option MuttVars[] = {
   ** you may \fIunset\fP this setting.
   ** (Crypto only)
   */
-  { "crypt_use_gpgme",  DT_BOOL, R_NONE, OPT_CRYPT_USE_GPGME, 0 },
+  { "crypt_use_gpgme",  DT_BOOL, R_NONE, UL &OPT_CRYPT_USE_GPGME, 0 },
   /*
   ** .pp
   ** This variable controls the use of the GPGME-enabled crypto backends.
@@ -641,7 +641,7 @@ struct Option MuttVars[] = {
   ** Note that the GPGME backend does not support creating old-style inline
   ** (traditional) PGP encrypted or signed messages (see $$pgp_autoinline).
   */
-  { "crypt_use_pka", DT_BOOL, R_NONE, OPT_CRYPT_USE_PKA, 0 },
+  { "crypt_use_pka", DT_BOOL, R_NONE, UL &OPT_CRYPT_USE_PKA, 0 },
   /*
   ** .pp
   ** Controls whether NeoMutt uses PKA
@@ -649,7 +649,7 @@ struct Option MuttVars[] = {
   ** verification (only supported by the GPGME backend).
   */
   { "pgp_verify_sig",   DT_SYNONYM,  R_NONE, UL "crypt_verify_sig", 0 },
-  { "crypt_verify_sig", DT_QUAD, R_NONE, OPT_CRYPT_VERIFY_SIG, MUTT_YES },
+  { "crypt_verify_sig", DT_QUAD, R_NONE, UL &OPT_CRYPT_VERIFY_SIG, MUTT_YES },
   /*
   ** .pp
   ** If \fI``yes''\fP, always attempt to verify PGP or S/MIME signatures.
@@ -702,7 +702,7 @@ struct Option MuttVars[] = {
   ** ``$alternates'') and is to or cc'ed to a user matching the given
   ** regular expression.
   */
-  { "delete",           DT_QUAD, R_NONE, OPT_DELETE, MUTT_ASKYES },
+  { "delete",           DT_QUAD, R_NONE, UL &OPT_DELETE, MUTT_ASKYES },
   /*
   ** .pp
   ** Controls whether or not messages are really deleted when closing or
@@ -710,14 +710,14 @@ struct Option MuttVars[] = {
   ** deleting will automatically be purged without prompting.  If set to
   ** \fIno\fP, messages marked for deletion will be kept in the mailbox.
   */
-  { "delete_untag",     DT_BOOL, R_NONE, OPT_DELETE_UNTAG, 1 },
+  { "delete_untag",     DT_BOOL, R_NONE, UL &OPT_DELETE_UNTAG, 1 },
   /*
   ** .pp
   ** If this option is \fIset\fP, NeoMutt will untag messages when marking them
   ** for deletion.  This applies when you either explicitly delete a message,
   ** or when you save it to another folder.
   */
-  { "digest_collapse",  DT_BOOL, R_NONE, OPT_DIGEST_COLLAPSE, 1 },
+  { "digest_collapse",  DT_BOOL, R_NONE, UL &OPT_DIGEST_COLLAPSE, 1 },
   /*
   ** .pp
   ** If this option is \fIset\fP, NeoMutt's received-attachments menu will not show the subparts of
@@ -780,7 +780,7 @@ struct Option MuttVars[] = {
   ** for DSN. For SMTP delivery, DSN support is auto-detected so that it
   ** depends on the server whether DSN will be used or not.
   */
-  { "duplicate_threads",        DT_BOOL, R_RESORT|R_RESORT_INIT|R_INDEX, OPT_DUPLICATE_THREADS, 1 },
+  { "duplicate_threads",        DT_BOOL, R_RESORT|R_RESORT_INIT|R_INDEX, UL &OPT_DUPLICATE_THREADS, 1 },
   /*
   ** .pp
   ** This variable controls whether NeoMutt, when $$sort is set to \fIthreads\fP, threads
@@ -788,7 +788,7 @@ struct Option MuttVars[] = {
   ** that it thinks they are duplicates of each other with an equals sign
   ** in the thread tree.
   */
-  { "edit_headers",     DT_BOOL, R_NONE, OPT_EDIT_HEADERS, 0 },
+  { "edit_headers",     DT_BOOL, R_NONE, UL &OPT_EDIT_HEADERS, 0 },
   /*
   ** .pp
   ** This option allows you to edit the header of your outgoing messages
@@ -831,7 +831,7 @@ struct Option MuttVars[] = {
   ** This variable specifies the subject to be used when replying to an email
   ** with an empty subject.  It defaults to "Re: your mail".
   */
-  { "encode_from",      DT_BOOL, R_NONE, OPT_ENCODE_FROM, 0 },
+  { "encode_from",      DT_BOOL, R_NONE, UL &OPT_ENCODE_FROM, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will quoted-printable encode messages when
@@ -859,7 +859,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** Escape character to use for functions in the built-in editor.
   */
-  { "fast_reply",       DT_BOOL, R_NONE, OPT_FAST_REPLY, 0 },
+  { "fast_reply",       DT_BOOL, R_NONE, UL &OPT_FAST_REPLY, 0 },
   /*
   ** .pp
   ** When \fIset\fP, the initial prompt for recipients and subject are skipped
@@ -869,13 +869,13 @@ struct Option MuttVars[] = {
   ** \fBNote:\fP this variable has no effect when the $$autoedit
   ** variable is \fIset\fP.
   */
-  { "fcc_attach",       DT_QUAD, R_NONE, OPT_FCC_ATTACH, MUTT_YES },
+  { "fcc_attach",       DT_QUAD, R_NONE, UL &OPT_FCC_ATTACH, MUTT_YES },
   /*
   ** .pp
   ** This variable controls whether or not attachments on outgoing messages
   ** are saved along with the main body of your message.
   */
-  { "fcc_clear",        DT_BOOL, R_NONE, OPT_FCC_CLEAR, 0 },
+  { "fcc_clear",        DT_BOOL, R_NONE, UL &OPT_FCC_CLEAR, 0 },
   /*
   ** .pp
   ** When this variable is \fIset\fP, FCCs will be stored unencrypted and
@@ -883,7 +883,7 @@ struct Option MuttVars[] = {
   ** signed.
   ** (PGP only)
   */
-  { "flag_safe", DT_BOOL, R_NONE, OPT_FLAG_SAFE, 0 },
+  { "flag_safe", DT_BOOL, R_NONE, UL &OPT_FLAG_SAFE, 0 },
   /*
   ** .pp
   ** If set, flagged messages cannot be deleted.
@@ -932,7 +932,7 @@ struct Option MuttVars[] = {
   ** %m requires $$mail_check_stats to be set.
   ** %n requires $$mail_check_stats to be set (except for IMAP mailboxes).
   */
-  { "followup_to",      DT_BOOL, R_NONE, OPT_FOLLOWUP_TO, 1 },
+  { "followup_to",      DT_BOOL, R_NONE, UL &OPT_FOLLOWUP_TO, 1 },
   /*
   ** .pp
   ** Controls whether or not the ``Mail-Followup-To:'' header field is
@@ -954,7 +954,7 @@ struct Option MuttVars[] = {
   ** of the same email for you.
   */
 #ifdef USE_NNTP
-  { "followup_to_poster", DT_QUAD, R_NONE, OPT_FOLLOWUP_TO_POSTER, MUTT_ASKYES },
+  { "followup_to_poster", DT_QUAD, R_NONE, UL &OPT_FOLLOWUP_TO_POSTER, MUTT_ASKYES },
   /*
   ** .pp
   ** If this variable is \fIset\fP and the keyword "poster" is present in
@@ -963,7 +963,7 @@ struct Option MuttVars[] = {
   ** message via mail.
   */
 #endif
-  { "force_name",       DT_BOOL, R_NONE, OPT_FORCE_NAME, 0 },
+  { "force_name",       DT_BOOL, R_NONE, UL &OPT_FORCE_NAME, 0 },
   /*
   ** .pp
   ** This variable is similar to $$save_name, except that NeoMutt will
@@ -988,7 +988,7 @@ struct Option MuttVars[] = {
   ** For a full listing of defined \fCprintf(3)\fP-like sequences see
   ** the section on $$index_format.  See also $$attribution_locale.
   */
-  { "forward_decode",   DT_BOOL, R_NONE, OPT_FORWARD_DECODE, 1 },
+  { "forward_decode",   DT_BOOL, R_NONE, UL &OPT_FORWARD_DECODE, 1 },
   /*
   ** .pp
   ** Controls the decoding of complex MIME messages into \fCtext/plain\fP when
@@ -999,7 +999,7 @@ struct Option MuttVars[] = {
   { "forw_decode",      DT_SYNONYM,  R_NONE, UL "forward_decode", 0 },
   /*
   */
-  { "forward_decrypt",  DT_BOOL, R_NONE, OPT_FORWARD_DECRYPT, 1 },
+  { "forward_decrypt",  DT_BOOL, R_NONE, UL &OPT_FORWARD_DECRYPT, 1 },
   /*
   ** .pp
   ** Controls the handling of encrypted messages when forwarding a message.
@@ -1011,7 +1011,7 @@ struct Option MuttVars[] = {
   { "forw_decrypt",     DT_SYNONYM,  R_NONE, UL "forward_decrypt", 0 },
   /*
   */
-  { "forward_edit",     DT_QUAD, R_NONE, OPT_FORWARD_EDIT, MUTT_YES },
+  { "forward_edit",     DT_QUAD, R_NONE, UL &OPT_FORWARD_EDIT, MUTT_YES },
   /*
   ** .pp
   ** This quadoption controls whether or not the user is automatically
@@ -1027,7 +1027,7 @@ struct Option MuttVars[] = {
   { "forw_format",      DT_SYNONYM,  R_NONE, UL "forward_format", 0 },
   /*
   */
-  { "forward_quote",    DT_BOOL, R_NONE, OPT_FORWARD_QUOTE, 0 },
+  { "forward_quote",    DT_BOOL, R_NONE, UL &OPT_FORWARD_QUOTE, 0 },
   /*
   ** .pp
   ** When \fIset\fP, forwarded messages included in the main body of the
@@ -1037,7 +1037,7 @@ struct Option MuttVars[] = {
   { "forw_quote",       DT_SYNONYM,  R_NONE, UL "forward_quote", 0 },
   /*
   */
-  { "forward_references", DT_BOOL, R_NONE, OPT_FORWARD_REFERENCES, 0 },
+  { "forward_references", DT_BOOL, R_NONE, UL &OPT_FORWARD_REFERENCES, 0 },
   /*
   ** .pp
   ** When \fIset\fP, forwarded messages set the ``In-Reply-To:'' and
@@ -1116,7 +1116,7 @@ struct Option MuttVars[] = {
   { "hdr_format",       DT_SYNONYM,  R_NONE, UL "index_format", 0 },
   /*
   */
-  { "hdrs",             DT_BOOL, R_NONE, OPT_HDRS, 1 },
+  { "hdrs",             DT_BOOL, R_NONE, UL &OPT_HDRS, 1 },
   /*
   ** .pp
   ** When \fIunset\fP, the header fields normally added by the ``$my_hdr''
@@ -1124,7 +1124,7 @@ struct Option MuttVars[] = {
   ** composing a new message or replying in order to take effect.  If \fIset\fP,
   ** the user defined header fields are added to every new message.
   */
-  { "header",           DT_BOOL, R_NONE, OPT_HEADER, 0 },
+  { "header",           DT_BOOL, R_NONE, UL &OPT_HEADER, 0 },
   /*
   ** .pp
   ** When \fIset\fP, this variable causes NeoMutt to include the header
@@ -1150,7 +1150,7 @@ struct Option MuttVars[] = {
   ** This variable specifies the header cache backend.
   */
 #if defined(HAVE_QDBM) || defined(HAVE_TC) || defined(HAVE_KC)
-  { "header_cache_compress", DT_BOOL, R_NONE, OPT_HEADER_CACHE_COMPRESS, 1 },
+  { "header_cache_compress", DT_BOOL, R_NONE, UL &OPT_HEADER_CACHE_COMPRESS, 1 },
   /*
   ** .pp
   ** When NeoMutt is compiled with qdbm, tokyocabinet or kyotocabinet
@@ -1173,7 +1173,7 @@ struct Option MuttVars[] = {
   */
 #endif /* HAVE_GDBM || HAVE_BDB */
 #endif /* USE_HCACHE */
-  { "header_color_partial", DT_BOOL, R_PAGER_FLOW, OPT_HEADER_COLOR_PARTIAL, 0 },
+  { "header_color_partial", DT_BOOL, R_PAGER_FLOW, UL &OPT_HEADER_COLOR_PARTIAL, 0 },
   /*
   ** .pp
   ** When \fIset\fP, color header regexes behave like color body regexes:
@@ -1184,7 +1184,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** See ``$color'' for more details.
   */
-  { "help",             DT_BOOL, R_REFLOW, OPT_HELP, 1 },
+  { "help",             DT_BOOL, R_REFLOW, UL &OPT_HELP, 1 },
   /*
   ** .pp
   ** When \fIset\fP, help lines describing the bindings for the major functions
@@ -1196,7 +1196,7 @@ struct Option MuttVars[] = {
   ** running.  Since this variable is primarily aimed at new users, neither
   ** of these should present a major problem.
   */
-  { "hidden_host",      DT_BOOL, R_NONE, OPT_HIDDEN_HOST, 0 },
+  { "hidden_host",      DT_BOOL, R_NONE, UL &OPT_HIDDEN_HOST, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will skip the host name part of $$hostname variable
@@ -1204,33 +1204,33 @@ struct Option MuttVars[] = {
   ** affect the generation of Message-IDs, and it will not lead to the
   ** cut-off of first-level domains.
   */
-  { "hide_limited",     DT_BOOL, R_TREE|R_INDEX, OPT_HIDE_LIMITED, 0 },
+  { "hide_limited",     DT_BOOL, R_TREE|R_INDEX, UL &OPT_HIDE_LIMITED, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will not show the presence of messages that are hidden
   ** by limiting, in the thread tree.
   */
-  { "hide_missing",     DT_BOOL, R_TREE|R_INDEX, OPT_HIDE_MISSING, 1 },
+  { "hide_missing",     DT_BOOL, R_TREE|R_INDEX, UL &OPT_HIDE_MISSING, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will not show the presence of missing messages in the
   ** thread tree.
   */
-  { "hide_thread_subject", DT_BOOL, R_TREE|R_INDEX, OPT_HIDE_THREAD_SUBJECT, 1 },
+  { "hide_thread_subject", DT_BOOL, R_TREE|R_INDEX, UL &OPT_HIDE_THREAD_SUBJECT, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will not show the subject of messages in the thread
   ** tree that have the same subject as their parent or closest previously
   ** displayed sibling.
   */
-  { "hide_top_limited", DT_BOOL, R_TREE|R_INDEX, OPT_HIDE_TOP_LIMITED, 0 },
+  { "hide_top_limited", DT_BOOL, R_TREE|R_INDEX, UL &OPT_HIDE_TOP_LIMITED, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will not show the presence of messages that are hidden
   ** by limiting, at the top of threads in the thread tree.  Note that when
   ** $$hide_limited is \fIset\fP, this option will have no effect.
   */
-  { "hide_top_missing", DT_BOOL, R_TREE|R_INDEX, OPT_HIDE_TOP_MISSING, 1 },
+  { "hide_top_missing", DT_BOOL, R_TREE|R_INDEX, UL &OPT_HIDE_TOP_MISSING, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will not show the presence of missing messages at the
@@ -1251,14 +1251,14 @@ struct Option MuttVars[] = {
   ** .pp
   ** Also see $$save_history.
   */
-  { "history_remove_dups", DT_BOOL, R_NONE, OPT_HISTORY_REMOVE_DUPS, 0 },
+  { "history_remove_dups", DT_BOOL, R_NONE, UL &OPT_HISTORY_REMOVE_DUPS, 0 },
   /*
   ** .pp
   ** When \fIset\fP, all of the string history will be scanned for duplicates
   ** when a new entry is added.  Duplicate entries in the $$history_file will
   ** also be removed when it is periodically compacted.
   */
-  { "honor_disposition", DT_BOOL, R_NONE, OPT_HONOR_DISPOSITION, 0 },
+  { "honor_disposition", DT_BOOL, R_NONE, UL &OPT_HONOR_DISPOSITION, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will not display attachments with a
@@ -1269,7 +1269,7 @@ struct Option MuttVars[] = {
   ** If \fIunset\fP, NeoMutt will render all MIME parts it can
   ** properly transform to plain text.
   */
-  { "honor_followup_to", DT_QUAD, R_NONE, OPT_HONOR_FOLLOWUP_TO, MUTT_YES },
+  { "honor_followup_to", DT_QUAD, R_NONE, UL &OPT_HONOR_FOLLOWUP_TO, MUTT_YES },
   /*
   ** .pp
   ** This variable controls whether or not a Mail-Followup-To header is
@@ -1294,14 +1294,14 @@ struct Option MuttVars[] = {
   ** Also see $$use_domain and $$hidden_host.
   */
 #ifdef HAVE_LIBIDN
-  { "idn_decode",       DT_BOOL, R_MENU, OPT_IDN_DECODE, 1 },
+  { "idn_decode",       DT_BOOL, R_MENU, UL &OPT_IDN_DECODE, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will show you international domain names decoded.
   ** Note: You can use IDNs for addresses even if this is \fIunset\fP.
   ** This variable only affects decoding. (IDN only)
   */
-  { "idn_encode",       DT_BOOL, R_MENU, OPT_IDN_ENCODE, 1 },
+  { "idn_encode",       DT_BOOL, R_MENU, UL &OPT_IDN_ENCODE, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will encode international domain names using
@@ -1309,14 +1309,14 @@ struct Option MuttVars[] = {
   ** UTF-8 encoded domains. (IDN only)
   */
 #endif /* HAVE_LIBIDN */
-  { "ignore_linear_white_space",    DT_BOOL, R_NONE, OPT_IGNORE_LINEAR_WHITE_SPACE, 0 },
+  { "ignore_linear_white_space",    DT_BOOL, R_NONE, UL &OPT_IGNORE_LINEAR_WHITE_SPACE, 0 },
   /*
   ** .pp
   ** This option replaces linear-white-space between encoded-word
   ** and text to a single space to prevent the display of MIME-encoded
   ** ``Subject:'' field from being divided into multiple lines.
   */
-  { "ignore_list_reply_to", DT_BOOL, R_NONE, OPT_IGNORE_LIST_REPLY_TO, 0 },
+  { "ignore_list_reply_to", DT_BOOL, R_NONE, UL &OPT_IGNORE_LIST_REPLY_TO, 0 },
   /*
   ** .pp
   ** Affects the behavior of the \fC<reply>\fP function when replying to
@@ -1358,7 +1358,7 @@ struct Option MuttVars[] = {
   ** the previous methods are unavailable. If a method is available but
   ** authentication fails, NeoMutt will not connect to the IMAP server.
   */
-  { "imap_check_subscribed",  DT_BOOL, R_NONE, OPT_IMAP_CHECK_SUBSCRIBED, 0 },
+  { "imap_check_subscribed",  DT_BOOL, R_NONE, UL &OPT_IMAP_CHECK_SUBSCRIBED, 0 },
   /*
    ** .pp
    ** When \fIset\fP, NeoMutt will fetch the set of subscribed folders from
@@ -1387,7 +1387,7 @@ struct Option MuttVars[] = {
   ** and not contain the colon, e.g. ``X-BOGOSITY X-SPAM-STATUS'' for the
   ** ``X-Bogosity:'' and ``X-Spam-Status:'' header fields.
   */
-  { "imap_idle",                DT_BOOL, R_NONE, OPT_IMAP_IDLE, 0 },
+  { "imap_idle",                DT_BOOL, R_NONE, UL &OPT_IMAP_IDLE, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will attempt to use the IMAP IDLE extension
@@ -1407,7 +1407,7 @@ struct Option MuttVars[] = {
   ** violated every now and then. Reduce this number if you find yourself
   ** getting disconnected from your IMAP server due to inactivity.
   */
-  { "imap_list_subscribed",     DT_BOOL, R_NONE, OPT_IMAP_LIST_SUBSCRIBED, 0 },
+  { "imap_list_subscribed",     DT_BOOL, R_NONE, UL &OPT_IMAP_LIST_SUBSCRIBED, 0 },
   /*
   ** .pp
   ** This variable configures whether IMAP folder browsing will look for
@@ -1432,7 +1432,7 @@ struct Option MuttVars[] = {
   ** fairly secure machine, because the superuser can read your neomuttrc even
   ** if you are the only one who can read the file.
   */
-  { "imap_passive",             DT_BOOL, R_NONE, OPT_IMAP_PASSIVE, 1 },
+  { "imap_passive",             DT_BOOL, R_NONE, UL &OPT_IMAP_PASSIVE, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will not open new IMAP connections to check for new
@@ -1441,7 +1441,7 @@ struct Option MuttVars[] = {
   ** user/password pairs on NeoMutt invocation, or if opening the connection
   ** is slow.
   */
-  { "imap_peek", DT_BOOL, R_NONE, OPT_IMAP_PEEK, 1 },
+  { "imap_peek", DT_BOOL, R_NONE, UL &OPT_IMAP_PEEK, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will avoid implicitly marking your mail as read whenever
@@ -1468,7 +1468,7 @@ struct Option MuttVars[] = {
   ** for new mail, before timing out and closing the connection.  Set
   ** to 0 to disable timing out.
   */
-  { "imap_servernoise",         DT_BOOL, R_NONE, OPT_IMAP_SERVERNOISE, 1 },
+  { "imap_servernoise",         DT_BOOL, R_NONE, UL &OPT_IMAP_SERVERNOISE, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will display warning messages from the IMAP
@@ -1486,7 +1486,7 @@ struct Option MuttVars[] = {
   ** This variable defaults to your user name on the local machine.
   */
 #endif
-  { "implicit_autoview", DT_BOOL,R_NONE, OPT_IMPLICIT_AUTOVIEW, 0 },
+  { "implicit_autoview", DT_BOOL,R_NONE, UL &OPT_IMPLICIT_AUTOVIEW, 0 },
   /*
   ** .pp
   ** If set to ``yes'', NeoMutt will look for a mailcap entry with the
@@ -1495,13 +1495,13 @@ struct Option MuttVars[] = {
   ** use the viewer defined in that entry to convert the body part to text
   ** form.
   */
-  { "include",          DT_QUAD, R_NONE, OPT_INCLUDE, MUTT_ASKYES },
+  { "include",          DT_QUAD, R_NONE, UL &OPT_INCLUDE, MUTT_ASKYES },
   /*
   ** .pp
   ** Controls whether or not a copy of the message(s) you are replying to
   ** is included in your reply.
   */
-  { "include_onlyfirst",        DT_BOOL, R_NONE, OPT_INCLUDE_ONLYFIRST, 0 },
+  { "include_onlyfirst",        DT_BOOL, R_NONE, UL &OPT_INCLUDE_ONLYFIRST, 0 },
   /*
   ** .pp
   ** Controls whether or not NeoMutt includes only the first attachment
@@ -1648,7 +1648,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** How to invoke ispell (GNU's spell-checking software).
   */
-  { "keep_flagged", DT_BOOL, R_NONE, OPT_KEEP_FLAGGED, 0 },
+  { "keep_flagged", DT_BOOL, R_NONE, UL &OPT_KEEP_FLAGGED, 0 },
   /*
   ** .pp
   ** If \fIset\fP, read messages marked as flagged will not be moved
@@ -1661,7 +1661,7 @@ struct Option MuttVars[] = {
   ** This variable configures how often (in seconds) NeoMutt should look for
   ** new mail. Also see the $$timeout variable.
   */
-  { "mail_check_recent",DT_BOOL, R_NONE, OPT_MAIL_CHECK_RECENT, 1 },
+  { "mail_check_recent",DT_BOOL, R_NONE, UL &OPT_MAIL_CHECK_RECENT, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will only notify you about new mail that has been received
@@ -1672,7 +1672,7 @@ struct Option MuttVars[] = {
   ** When \fI$$mark_old\fP is set, NeoMutt does not consider the mailbox to contain new
   ** mail if only old messages exist.
   */
-  { "mail_check_stats", DT_BOOL, R_NONE, OPT_MAIL_CHECK_STATS, 0 },
+  { "mail_check_stats", DT_BOOL, R_NONE, UL &OPT_MAIL_CHECK_STATS, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will periodically calculate message
@@ -1694,7 +1694,7 @@ struct Option MuttVars[] = {
   ** This variable specifies which files to consult when attempting to
   ** display MIME bodies not directly supported by NeoMutt.
   */
-  { "mailcap_sanitize", DT_BOOL, R_NONE, OPT_MAILCAP_SANITIZE, 1 },
+  { "mailcap_sanitize", DT_BOOL, R_NONE, UL &OPT_MAILCAP_SANITIZE, 1 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will restrict possible characters in mailcap % expandos
@@ -1705,7 +1705,7 @@ struct Option MuttVars[] = {
   ** DOING!\fP
   */
 #ifdef USE_HCACHE
-  { "maildir_header_cache_verify", DT_BOOL, R_NONE, OPT_MAILDIR_HEADER_CACHE_VERIFY, 1 },
+  { "maildir_header_cache_verify", DT_BOOL, R_NONE, UL &OPT_MAILDIR_HEADER_CACHE_VERIFY, 1 },
   /*
   ** .pp
   ** Check for Maildir unaware programs other than NeoMutt having modified maildir
@@ -1714,7 +1714,7 @@ struct Option MuttVars[] = {
   ** folders).
   */
 #endif
-  { "maildir_trash", DT_BOOL, R_NONE, OPT_MAILDIR_TRASH, 0 },
+  { "maildir_trash", DT_BOOL, R_NONE, UL &OPT_MAILDIR_TRASH, 0 },
   /*
   ** .pp
   ** If \fIset\fP, messages marked as deleted will be saved with the maildir
@@ -1722,7 +1722,7 @@ struct Option MuttVars[] = {
   ** to maildir-style mailboxes.  Setting it will have no effect on other
   ** mailbox types.
   */
-  { "maildir_check_cur", DT_BOOL, R_NONE, OPT_MAILDIR_CHECK_CUR, 0 },
+  { "maildir_check_cur", DT_BOOL, R_NONE, UL &OPT_MAILDIR_CHECK_CUR, 0 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will poll both the new and cur directories of
@@ -1739,7 +1739,7 @@ struct Option MuttVars[] = {
   ** automatically generated with \fI<mark-message>a\fP will be composed
   ** from this prefix and the letter \fIa\fP.
   */
-  { "mark_old",         DT_BOOL, R_BOTH, OPT_MARK_OLD, 1 },
+  { "mark_old",         DT_BOOL, R_BOTH, UL &OPT_MARK_OLD, 1 },
   /*
   ** .pp
   ** Controls whether or not NeoMutt marks \fInew\fP \fBunread\fP
@@ -1748,7 +1748,7 @@ struct Option MuttVars[] = {
   ** will show up with an ``O'' next to them in the index menu,
   ** indicating that they are old.
   */
-  { "markers",          DT_BOOL, R_PAGER_FLOW, OPT_MARKERS, 1 },
+  { "markers",          DT_BOOL, R_PAGER_FLOW, UL &OPT_MARKERS, 1 },
   /*
   ** .pp
   ** Controls the display of wrapped lines in the internal pager. If set, a
@@ -1784,14 +1784,14 @@ struct Option MuttVars[] = {
   ** This variable controls the number of lines of context that are given
   ** when scrolling through menus. (Similar to $$pager_context.)
   */
-  { "menu_move_off",    DT_BOOL, R_NONE, OPT_MENU_MOVE_OFF, 1 },
+  { "menu_move_off",    DT_BOOL, R_NONE, UL &OPT_MENU_MOVE_OFF, 1 },
   /*
   ** .pp
   ** When \fIunset\fP, the bottom entry of menus will never scroll up past
   ** the bottom of the screen, unless there are less entries than lines.
   ** When \fIset\fP, the bottom entry may move off the bottom.
   */
-  { "menu_scroll",      DT_BOOL, R_NONE, OPT_MENU_SCROLL, 0 },
+  { "menu_scroll",      DT_BOOL, R_NONE, UL &OPT_MENU_SCROLL, 0 },
   /*
   ** .pp
   ** When \fIset\fP, menus will be scrolled up or down one line when you
@@ -1800,7 +1800,7 @@ struct Option MuttVars[] = {
   ** (useful for slow links to avoid many redraws).
   */
 #if defined(USE_IMAP) || defined(USE_POP)
-  { "message_cache_clean", DT_BOOL, R_NONE, OPT_MESSAGE_CACHE_CLEAN, 0 },
+  { "message_cache_clean", DT_BOOL, R_NONE, UL &OPT_MESSAGE_CACHE_CLEAN, 0 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will clean out obsolete entries from the message cache when
@@ -1832,7 +1832,7 @@ struct Option MuttVars[] = {
   { "msg_format",       DT_SYNONYM,  R_NONE, UL "message_format", 0 },
   /*
   */
-  { "meta_key",         DT_BOOL, R_NONE, OPT_META_KEY, 0 },
+  { "meta_key",         DT_BOOL, R_NONE, UL &OPT_META_KEY, 0 },
   /*
   ** .pp
   ** If \fIset\fP, forces NeoMutt to interpret keystrokes with the high bit (bit 8)
@@ -1843,13 +1843,13 @@ struct Option MuttVars[] = {
   ** high bit from \fC0xf8\fP is \fC0x78\fP, which is the ASCII character
   ** ``x''.
   */
-  { "metoo",            DT_BOOL, R_NONE, OPT_METOO, 0 },
+  { "metoo",            DT_BOOL, R_NONE, UL &OPT_METOO, 0 },
   /*
   ** .pp
   ** If \fIunset\fP, NeoMutt will remove your address (see the ``$alternates''
   ** command) from the list of recipients when replying to a message.
   */
-  { "mh_purge",         DT_BOOL, R_NONE, OPT_MH_PURGE, 0 },
+  { "mh_purge",         DT_BOOL, R_NONE, UL &OPT_MH_PURGE, 0 },
   /*
   ** .pp
   ** When \fIunset\fP, NeoMutt will mimic mh's behavior and rename deleted messages
@@ -1875,7 +1875,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** The name of the MH sequence used for unseen messages.
   */
-  { "mime_forward",     DT_QUAD, R_NONE, OPT_MIME_FORWARD, MUTT_NO },
+  { "mime_forward",     DT_QUAD, R_NONE, UL &OPT_MIME_FORWARD, MUTT_NO },
   /*
   ** .pp
   ** When \fIset\fP, the message you are forwarding will be attached as a
@@ -1887,7 +1887,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** Also see $$forward_decode and $$mime_forward_decode.
   */
-  { "mime_forward_decode", DT_BOOL, R_NONE, OPT_MIME_FORWARD_DECODE, 0 },
+  { "mime_forward_decode", DT_BOOL, R_NONE, UL &OPT_MIME_FORWARD_DECODE, 0 },
   /*
   ** .pp
   ** Controls the decoding of complex MIME messages into \fCtext/plain\fP when
@@ -1897,7 +1897,7 @@ struct Option MuttVars[] = {
   { "mime_fwd",         DT_SYNONYM,  R_NONE, UL "mime_forward", 0 },
   /*
   */
-  { "mime_forward_rest", DT_QUAD, R_NONE, OPT_MIME_FORWARD_REST, MUTT_YES },
+  { "mime_forward_rest", DT_QUAD, R_NONE, UL &OPT_MIME_FORWARD_REST, MUTT_YES },
   /*
   ** .pp
   ** When forwarding multiple attachments of a MIME message from the attachment
@@ -1905,7 +1905,7 @@ struct Option MuttVars[] = {
   ** be attached to the newly composed message if this option is \fIset\fP.
   */
 #ifdef USE_NNTP
-  { "mime_subject",     DT_BOOL, R_NONE, OPT_MIME_SUBJECT, 1 },
+  { "mime_subject",     DT_BOOL, R_NONE, UL &OPT_MIME_SUBJECT, 1 },
   /*
   ** .pp
   ** If \fIunset\fP, 8-bit ``subject:'' line in article header will not be
@@ -1933,7 +1933,7 @@ struct Option MuttVars[] = {
   ** Suggested values are ``xdg-mime query filetype'' or
   ** ``file -bi''.
   */
-  { "mime_type_query_first", DT_BOOL, R_NONE, OPT_MIME_TYPE_QUERY_FIRST, 0 },
+  { "mime_type_query_first", DT_BOOL, R_NONE, UL &OPT_MIME_TYPE_QUERY_FIRST, 0 },
   /*
   ** .pp
   ** When \fIset\fP, the $$mime_type_query_command will be run before the
@@ -1962,14 +1962,14 @@ struct Option MuttVars[] = {
   ** mixmaster chain.
   */
 #endif
-  { "move",             DT_QUAD, R_NONE, OPT_MOVE, MUTT_NO },
+  { "move",             DT_QUAD, R_NONE, UL &OPT_MOVE, MUTT_NO },
   /*
   ** .pp
   ** Controls whether or not NeoMutt will move read messages
   ** from your spool mailbox to your $$mbox mailbox, or as a result of
   ** a ``$mbox-hook'' command.
   */
-  { "narrow_tree",      DT_BOOL, R_TREE|R_INDEX, OPT_NARROW_TREE, 0 },
+  { "narrow_tree",      DT_BOOL, R_TREE|R_INDEX, UL &OPT_NARROW_TREE, 0 },
   /*
   ** .pp
   ** This variable, when \fIset\fP, makes the thread tree narrower, allowing
@@ -2059,13 +2059,13 @@ struct Option MuttVars[] = {
   ** number, oldest articles will be ignored.  Also controls how many
   ** articles headers will be saved in cache when you quit newsgroup.
   */
-  { "nntp_listgroup",   DT_BOOL, R_NONE, OPT_NNTP_LISTGROUP, 1 },
+  { "nntp_listgroup",   DT_BOOL, R_NONE, UL &OPT_NNTP_LISTGROUP, 1 },
   /*
   ** .pp
   ** This variable controls whether or not existence of each article is
   ** checked when newsgroup is entered.
   */
-  { "nntp_load_description", DT_BOOL, R_NONE, OPT_NNTP_LOAD_DESCRIPTION, 1 },
+  { "nntp_load_description", DT_BOOL, R_NONE, UL &OPT_NNTP_LOAD_DESCRIPTION, 1 },
   /*
   ** .pp
   ** This variable controls whether or not descriptions for each newsgroup
@@ -2128,7 +2128,7 @@ struct Option MuttVars[] = {
    ** .pp
    ** This variable specifies the default query type (threads or messages) used in notmuch queries.
    */
-  { "nm_record", DT_BOOL, R_NONE, OPT_NM_RECORD, 0 },
+  { "nm_record", DT_BOOL, R_NONE, UL &OPT_NM_RECORD, 0 },
   /*
    ** .pp
    ** This variable specifies if the NeoMutt record should indexed by notmuch.
@@ -2217,14 +2217,14 @@ struct Option MuttVars[] = {
   ** is less than $$pager_index_lines, then the index will only use as
   ** many lines as it needs.
   */
-  { "pager_stop",       DT_BOOL, R_NONE, OPT_PAGER_STOP, 0 },
+  { "pager_stop",       DT_BOOL, R_NONE, UL &OPT_PAGER_STOP, 0 },
   /*
   ** .pp
   ** When \fIset\fP, the internal-pager will \fBnot\fP move to the next message
   ** when you are at the end of a message and invoke the \fC<next-page>\fP
   ** function.
   */
-  { "pgp_auto_decode", DT_BOOL, R_NONE, OPT_PGP_AUTO_DECODE, 0 },
+  { "pgp_auto_decode", DT_BOOL, R_NONE, UL &OPT_PGP_AUTO_DECODE, 0 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will automatically attempt to decrypt traditional PGP
@@ -2235,7 +2235,7 @@ struct Option MuttVars[] = {
   ** check the message for traditional pgp.
   */
   { "pgp_create_traditional",   DT_SYNONYM, R_NONE, UL "pgp_autoinline", 0 },
-  { "pgp_autoinline",           DT_BOOL, R_NONE, OPT_PGP_AUTOINLINE, 0 },
+  { "pgp_autoinline",           DT_BOOL, R_NONE, UL &OPT_PGP_AUTOINLINE, 0 },
   /*
   ** .pp
   ** This option controls whether NeoMutt generates old-style inline
@@ -2255,7 +2255,7 @@ struct Option MuttVars[] = {
   ** \fBdeprecated\fP.
   ** (PGP only)
   */
-  { "pgp_check_exit",   DT_BOOL, R_NONE, OPT_PGP_CHECK_EXIT, 1 },
+  { "pgp_check_exit",   DT_BOOL, R_NONE, UL &OPT_PGP_CHECK_EXIT, 1 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will check the exit code of the PGP subprocess when
@@ -2385,7 +2385,7 @@ struct Option MuttVars[] = {
   ** even for bad signatures.
   ** (PGP only)
   */
-  { "pgp_ignore_subkeys", DT_BOOL, R_NONE, OPT_PGP_IGNORE_SUBKEYS, 1 },
+  { "pgp_ignore_subkeys", DT_BOOL, R_NONE, UL &OPT_PGP_IGNORE_SUBKEYS, 1 },
   /*
   ** .pp
   ** Setting this variable will cause NeoMutt to ignore OpenPGP subkeys. Instead,
@@ -2443,7 +2443,7 @@ struct Option MuttVars[] = {
   ** possible \fCprintf(3)\fP-like sequences.
   ** (PGP only)
   */
-  { "pgp_long_ids",     DT_BOOL, R_NONE, OPT_PGP_LONG_IDS, 1 },
+  { "pgp_long_ids",     DT_BOOL, R_NONE, UL &OPT_PGP_LONG_IDS, 1 },
   /*
   ** .pp
   ** If \fIset\fP, use 64 bit PGP key IDs, if \fIunset\fP use the normal 32 bit key IDs.
@@ -2452,7 +2452,7 @@ struct Option MuttVars[] = {
   ** in the key selection menu and a few other places.
   ** (PGP only)
   */
-  { "pgp_mime_auto", DT_QUAD, R_NONE, OPT_PGP_MIME_AUTO, MUTT_ASKYES },
+  { "pgp_mime_auto", DT_QUAD, R_NONE, UL &OPT_PGP_MIME_AUTO, MUTT_ASKYES },
   /*
   ** .pp
   ** This option controls whether NeoMutt will prompt you for
@@ -2464,7 +2464,7 @@ struct Option MuttVars[] = {
   ** (PGP only)
   */
   { "pgp_auto_traditional",     DT_SYNONYM, R_NONE, UL "pgp_replyinline", 0 },
-  { "pgp_replyinline",          DT_BOOL, R_NONE, OPT_PGP_REPLYINLINE, 0 },
+  { "pgp_replyinline",          DT_BOOL, R_NONE, UL &OPT_PGP_REPLYINLINE, 0 },
   /*
   ** .pp
   ** Setting this variable will cause NeoMutt to always attempt to
@@ -2487,7 +2487,7 @@ struct Option MuttVars[] = {
   ** (PGP only)
   **
   */
-  { "pgp_retainable_sigs", DT_BOOL, R_NONE, OPT_PGP_RETAINABLE_SIGS, 0 },
+  { "pgp_retainable_sigs", DT_BOOL, R_NONE, UL &OPT_PGP_RETAINABLE_SIGS, 0 },
   /*
   ** .pp
   ** If \fIset\fP, signed and encrypted messages will consist of nested
@@ -2498,7 +2498,7 @@ struct Option MuttVars[] = {
   ** removed, while the inner \fCmultipart/signed\fP part is retained.
   ** (PGP only)
   */
-  { "pgp_self_encrypt",    DT_BOOL, R_NONE, OPT_PGP_SELF_ENCRYPT, 0 },
+  { "pgp_self_encrypt",    DT_BOOL, R_NONE, UL &OPT_PGP_SELF_ENCRYPT, 0 },
   /*
   ** .pp
   ** When \fIset\fP, PGP encrypted messages will also be encrypted
@@ -2513,7 +2513,7 @@ struct Option MuttVars[] = {
   ** It should be in keyid or fingerprint form (e.g. 0x00112233).
   ** (PGP only)
   */
-  { "pgp_show_unusable", DT_BOOL, R_NONE, OPT_PGP_SHOW_UNUSABLE, 1 },
+  { "pgp_show_unusable", DT_BOOL, R_NONE, UL &OPT_PGP_SHOW_UNUSABLE, 1 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will display non-usable keys on the PGP key selection
@@ -2555,7 +2555,7 @@ struct Option MuttVars[] = {
   ** ``reverse-''.
   ** (PGP only)
   */
-  { "pgp_strict_enc",   DT_BOOL, R_NONE, OPT_PGP_STRICT_ENC, 1 },
+  { "pgp_strict_enc",   DT_BOOL, R_NONE, UL &OPT_PGP_STRICT_ENC, 1 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will automatically encode PGP/MIME signed messages as
@@ -2571,7 +2571,7 @@ struct Option MuttVars[] = {
   ** not used.
   ** (PGP only)
   */
-  { "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPT_PGP_USE_GPG_AGENT, 0 },
+  { "pgp_use_gpg_agent", DT_BOOL, R_NONE, UL &OPT_PGP_USE_GPG_AGENT, 0 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will use a possibly-running \fCgpg-agent(1)\fP process.
@@ -2598,7 +2598,7 @@ struct Option MuttVars[] = {
   ** possible \fCprintf(3)\fP-like sequences.
   ** (PGP only)
   */
-  { "pipe_decode",      DT_BOOL, R_NONE, OPT_PIPE_DECODE, 0 },
+  { "pipe_decode",      DT_BOOL, R_NONE, UL &OPT_PIPE_DECODE, 0 },
   /*
   ** .pp
   ** Used in connection with the \fC<pipe-message>\fP command.  When \fIunset\fP,
@@ -2612,7 +2612,7 @@ struct Option MuttVars[] = {
   ** The separator to add between messages when piping a list of tagged
   ** messages to an external Unix command.
   */
-  { "pipe_split",       DT_BOOL, R_NONE, OPT_PIPE_SPLIT, 0 },
+  { "pipe_split",       DT_BOOL, R_NONE, UL &OPT_PIPE_SPLIT, 0 },
   /*
   ** .pp
   ** Used in connection with the \fC<pipe-message>\fP function following
@@ -2623,7 +2623,7 @@ struct Option MuttVars[] = {
   ** and the $$pipe_sep separator is added after each message.
   */
 #ifdef USE_POP
-  { "pop_auth_try_all", DT_BOOL, R_NONE, OPT_POP_AUTH_TRY_ALL, 1 },
+  { "pop_auth_try_all", DT_BOOL, R_NONE, UL &OPT_POP_AUTH_TRY_ALL, 1 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will try all available authentication methods.
@@ -2653,7 +2653,7 @@ struct Option MuttVars[] = {
   ** This variable configures how often (in seconds) NeoMutt should look for
   ** new mail in the currently selected mailbox if it is a POP mailbox.
   */
-  { "pop_delete",       DT_QUAD, R_NONE, OPT_POP_DELETE, MUTT_ASKNO },
+  { "pop_delete",       DT_QUAD, R_NONE, UL &OPT_POP_DELETE, MUTT_ASKNO },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will delete successfully downloaded messages from the POP
@@ -2671,7 +2671,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** where ``[...]'' denotes an optional part.
   */
-  { "pop_last",         DT_BOOL, R_NONE, OPT_POP_LAST, 0 },
+  { "pop_last",         DT_BOOL, R_NONE, UL &OPT_POP_LAST, 0 },
   /*
   ** .pp
   ** If this variable is \fIset\fP, NeoMutt will try to use the ``\fCLAST\fP'' POP command
@@ -2688,7 +2688,7 @@ struct Option MuttVars[] = {
   ** fairly secure machine, because the superuser can read your neomuttrc
   ** even if you are the only one who can read the file.
   */
-  { "pop_reconnect",    DT_QUAD, R_NONE, OPT_POP_RECONNECT, MUTT_ASKYES },
+  { "pop_reconnect",    DT_QUAD, R_NONE, UL &OPT_POP_RECONNECT, MUTT_ASKYES },
   /*
   ** .pp
   ** Controls whether or not NeoMutt will try to reconnect to the POP server if
@@ -2712,7 +2712,7 @@ struct Option MuttVars[] = {
   /*
   */
 #ifdef USE_NNTP
-  { "post_moderated",   DT_QUAD, R_NONE, OPT_POST_MODERATED, MUTT_ASKYES },
+  { "post_moderated",   DT_QUAD, R_NONE, UL &OPT_POST_MODERATED, MUTT_ASKYES },
   /*
   ** .pp
   ** If set to \fIyes\fP, NeoMutt will post article to newsgroup that have
@@ -2721,7 +2721,7 @@ struct Option MuttVars[] = {
   ** posting will not have an effect.
   */
 #endif
-  { "postpone",         DT_QUAD, R_NONE, OPT_POSTPONE, MUTT_ASKYES },
+  { "postpone",         DT_QUAD, R_NONE, UL &OPT_POSTPONE, MUTT_ASKYES },
   /*
   ** .pp
   ** Controls whether or not messages are saved in the $$postponed
@@ -2738,7 +2738,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** Also see the $$postpone variable.
   */
-  { "postpone_encrypt",    DT_BOOL, R_NONE, OPT_POSTPONE_ENCRYPT, 0 },
+  { "postpone_encrypt",    DT_BOOL, R_NONE, UL &OPT_POSTPONE_ENCRYPT, 0 },
   /*
   ** .pp
   ** When \fIset\fP, postponed messages that are marked for encryption will be
@@ -2774,7 +2774,7 @@ struct Option MuttVars[] = {
   ** remote machine without having to enter a password.
   */
 #endif /* USE_SOCKET */
-  { "print",            DT_QUAD, R_NONE, OPT_PRINT, MUTT_ASKNO },
+  { "print",            DT_QUAD, R_NONE, UL &OPT_PRINT, MUTT_ASKNO },
   /*
   ** .pp
   ** Controls whether or not NeoMutt really prints messages.
@@ -2789,7 +2789,7 @@ struct Option MuttVars[] = {
   { "print_cmd",        DT_SYNONYM,  R_NONE, UL "print_command", 0 },
   /*
   */
-  { "print_decode",     DT_BOOL, R_NONE, OPT_PRINT_DECODE, 1 },
+  { "print_decode",     DT_BOOL, R_NONE, UL &OPT_PRINT_DECODE, 1 },
   /*
   ** .pp
   ** Used in connection with the \fC<print-message>\fP command.  If this
@@ -2800,7 +2800,7 @@ struct Option MuttVars[] = {
   ** some advanced printer filter which is able to properly format
   ** e-mail messages for printing.
   */
-  { "print_split",      DT_BOOL, R_NONE, OPT_PRINT_SPLIT,  0 },
+  { "print_split",      DT_BOOL, R_NONE, UL &OPT_PRINT_SPLIT,  0 },
   /*
   ** .pp
   ** Used in connection with the \fC<print-message>\fP command.  If this option
@@ -2813,7 +2813,7 @@ struct Option MuttVars[] = {
   ** Those who use the \fCenscript\fP(1) program's mail-printing mode will
   ** most likely want to \fIset\fP this option.
   */
-  { "prompt_after",     DT_BOOL, R_NONE, OPT_PROMPT_AFTER, 1 },
+  { "prompt_after",     DT_BOOL, R_NONE, UL &OPT_PROMPT_AFTER, 1 },
   /*
   ** .pp
   ** If you use an \fIexternal\fP $$pager, setting this variable will
@@ -2852,7 +2852,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** * = can be optionally printed if nonzero, see the $$status_format documentation.
   */
-  { "quit",             DT_QUAD, R_NONE, OPT_QUIT, MUTT_YES },
+  { "quit",             DT_QUAD, R_NONE, UL &OPT_QUIT, MUTT_YES },
   /*
   ** .pp
   ** This variable controls whether ``quit'' and ``exit'' actually quit
@@ -2891,7 +2891,7 @@ struct Option MuttVars[] = {
   ** Also see the $$write_inc, $$net_inc and $$time_inc variables and the
   ** ``$tuning'' section of the manual for performance considerations.
   */
-  { "read_only",        DT_BOOL, R_NONE, OPT_READ_ONLY, 0 },
+  { "read_only",        DT_BOOL, R_NONE, UL &OPT_READ_ONLY, 0 },
   /*
   ** .pp
   ** If \fIset\fP, all folders are opened in read-only mode.
@@ -2906,7 +2906,7 @@ struct Option MuttVars[] = {
   ** variable will \fInot\fP be used when the user has set a real name
   ** in the $$from variable.
   */
-  { "recall",           DT_QUAD, R_NONE, OPT_RECALL, MUTT_ASKYES },
+  { "recall",           DT_QUAD, R_NONE, UL &OPT_RECALL, MUTT_ASKYES },
   /*
   ** .pp
   ** Controls whether or not NeoMutt recalls postponed messages
@@ -2929,7 +2929,7 @@ struct Option MuttVars[] = {
   ** The value of \fI$$record\fP is overridden by the $$force_name and
   ** $$save_name variables, and the ``$fcc-hook'' command.
   */
-  { "reflow_space_quotes",      DT_BOOL, R_NONE, OPT_REFLOW_SPACE_QUOTES, 1 },
+  { "reflow_space_quotes",      DT_BOOL, R_NONE, UL &OPT_REFLOW_SPACE_QUOTES, 1 },
   /*
   ** .pp
   ** This option controls how quotes from format=flowed messages are displayed
@@ -2940,7 +2940,7 @@ struct Option MuttVars[] = {
   ** \fBNote:\fP If $$reflow_text is \fIunset\fP, this option has no effect.
   ** Also, this option does not affect replies when $$text_flowed is \fIset\fP.
   */
-  { "reflow_text",      DT_BOOL, R_NONE, OPT_REFLOW_TEXT, 1 },
+  { "reflow_text",      DT_BOOL, R_NONE, UL &OPT_REFLOW_TEXT, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will reformat paragraphs in text/plain
@@ -2968,7 +2968,7 @@ struct Option MuttVars[] = {
   ** and replying. The default value corresponds to the English "Re:" and
   ** the German "Aw:".
   */
-  { "reply_self",       DT_BOOL, R_NONE, OPT_REPLY_SELF, 0 },
+  { "reply_self",       DT_BOOL, R_NONE, UL &OPT_REPLY_SELF, 0 },
   /*
   ** .pp
   ** If \fIunset\fP and you are replying to a message sent by you, NeoMutt will
@@ -2977,7 +2977,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** Also see the ``$alternates'' command.
   */
-  { "reply_to",         DT_QUAD, R_NONE, OPT_REPLY_TO, MUTT_ASKYES },
+  { "reply_to",         DT_QUAD, R_NONE, UL &OPT_REPLY_TO, MUTT_ASKYES },
   /*
   ** .pp
   ** If \fIset\fP, when replying to a message, NeoMutt will use the address listed
@@ -2987,7 +2987,7 @@ struct Option MuttVars[] = {
   ** header field to the list address and you want to send a private
   ** message to the author of a message.
   */
-  { "reply_with_xorig", DT_BOOL, R_NONE, OPT_REPLY_WITH_XORIG, 0 },
+  { "reply_with_xorig", DT_BOOL, R_NONE, UL &OPT_REPLY_WITH_XORIG, 0 },
   /*
   ** .pp
   ** This variable provides a toggle. When active, the From: header will be
@@ -2997,14 +2997,14 @@ struct Option MuttVars[] = {
   ** Assuming `fast_reply' is disabled, this option will prompt the user with a
   ** prefilled From: header.
   */
-  { "resolve",          DT_BOOL, R_NONE, OPT_RESOLVE, 1 },
+  { "resolve",          DT_BOOL, R_NONE, UL &OPT_RESOLVE, 1 },
   /*
   ** .pp
   ** When \fIset\fP, the cursor will be automatically advanced to the next
   ** (possibly undeleted) message whenever a command that modifies the
   ** current message is executed.
   */
-  { "resume_draft_files", DT_BOOL, R_NONE, OPT_RESUME_DRAFT_FILES, 0 },
+  { "resume_draft_files", DT_BOOL, R_NONE, UL &OPT_RESUME_DRAFT_FILES, 0 },
   /*
   ** .pp
   ** If \fIset\fP, draft files (specified by \fC-H\fP on the command
@@ -3013,7 +3013,7 @@ struct Option MuttVars[] = {
   ** evaluated; no alias expansion takes place; user-defined headers
   ** and signatures are not added to the message.
   */
-  { "resume_edited_draft_files", DT_BOOL, R_NONE, OPT_RESUME_EDITED_DRAFT_FILES, 1 },
+  { "resume_edited_draft_files", DT_BOOL, R_NONE, UL &OPT_RESUME_EDITED_DRAFT_FILES, 1 },
   /*
   ** .pp
   ** If \fIset\fP, draft files previously edited (via \fC-E -H\fP on
@@ -3029,7 +3029,7 @@ struct Option MuttVars[] = {
   ** user-defined headers, and other processing effects from being
   ** made multiple times to the draft file.
   */
-  { "reverse_alias",    DT_BOOL, R_BOTH, OPT_REVERSE_ALIAS, 0 },
+  { "reverse_alias",    DT_BOOL, R_BOTH, UL &OPT_REVERSE_ALIAS, 0 },
   /*
   ** .pp
   ** This variable controls whether or not NeoMutt will display the ``personal''
@@ -3049,7 +3049,7 @@ struct Option MuttVars[] = {
   ** ``abd30425@somewhere.net.''  This is useful when the person's e-mail
   ** address is not human friendly.
   */
-  { "reverse_name",     DT_BOOL, R_BOTH, OPT_REVERSE_NAME, 0 },
+  { "reverse_name",     DT_BOOL, R_BOTH, UL &OPT_REVERSE_NAME, 0 },
   /*
   ** .pp
   ** It may sometimes arrive that you receive mail to a certain machine,
@@ -3063,7 +3063,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** Also see the ``$alternates'' command.
   */
-  { "reverse_realname", DT_BOOL, R_BOTH, OPT_REVERSE_REALNAME, 1 },
+  { "reverse_realname", DT_BOOL, R_BOTH, UL &OPT_REVERSE_REALNAME, 1 },
   /*
   ** .pp
   ** This variable fine-tunes the behavior of the $$reverse_name feature.
@@ -3071,7 +3071,7 @@ struct Option MuttVars[] = {
   ** possibly including eventual real names.  When it is \fIunset\fP, NeoMutt will
   ** override any such real names with the setting of the $$realname variable.
   */
-  { "rfc2047_parameters", DT_BOOL, R_NONE, OPT_RFC2047_PARAMETERS, 0 },
+  { "rfc2047_parameters", DT_BOOL, R_NONE, UL &OPT_RFC2047_PARAMETERS, 0 },
   /*
   ** .pp
   ** When this variable is \fIset\fP, NeoMutt will decode RFC2047-encoded MIME
@@ -3092,14 +3092,14 @@ struct Option MuttVars[] = {
   ** that NeoMutt \fIgenerates\fP this kind of encoding.  Instead, NeoMutt will
   ** unconditionally use the encoding specified in RFC2231.
   */
-  { "save_address",     DT_BOOL, R_NONE, OPT_SAVE_ADDRESS, 0 },
+  { "save_address",     DT_BOOL, R_NONE, UL &OPT_SAVE_ADDRESS, 0 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will take the sender's full address when choosing a
   ** default folder for saving a mail. If $$save_name or $$force_name
   ** is \fIset\fP too, the selection of the Fcc folder will be changed as well.
   */
-  { "save_empty",       DT_BOOL, R_NONE, OPT_SAVE_EMPTY, 1 },
+  { "save_empty",       DT_BOOL, R_NONE, UL &OPT_SAVE_EMPTY, 1 },
   /*
   ** .pp
   ** When \fIunset\fP, mailboxes which contain no saved messages will be removed
@@ -3115,7 +3115,7 @@ struct Option MuttVars[] = {
   ** This variable controls the size of the history (per category) saved in the
   ** $$history_file file.
   */
-  { "save_name",        DT_BOOL, R_NONE, OPT_SAVE_NAME, 0 },
+  { "save_name",        DT_BOOL, R_NONE, UL &OPT_SAVE_NAME, 0 },
   /*
   ** .pp
   ** This variable controls how copies of outgoing messages are saved.
@@ -3128,7 +3128,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** Also see the $$force_name variable.
   */
-  { "score",            DT_BOOL, R_NONE, OPT_SCORE, 1 },
+  { "score",            DT_BOOL, R_NONE, UL &OPT_SCORE, 1 },
   /*
   ** .pp
   ** When this variable is \fIunset\fP, scoring is turned off.  This can
@@ -3212,13 +3212,13 @@ struct Option MuttVars[] = {
   ** shell from \fC/etc/passwd\fP is used.
   */
 #ifdef USE_NNTP
-  { "save_unsubscribed", DT_BOOL, R_NONE, OPT_SAVE_UNSUBSCRIBED, 0 },
+  { "save_unsubscribed", DT_BOOL, R_NONE, UL &OPT_SAVE_UNSUBSCRIBED, 0 },
   /*
   ** .pp
   ** When \fIset\fP, info about unsubscribed newsgroups will be saved into
   ** ``newsrc'' file and into cache.
   */
-  { "show_new_news",    DT_BOOL, R_NONE, OPT_SHOW_NEW_NEWS, 1 },
+  { "show_new_news",    DT_BOOL, R_NONE, UL &OPT_SHOW_NEW_NEWS, 1 },
   /*
   ** .pp
   ** If \fIset\fP, news server will be asked for new newsgroups on entering
@@ -3226,7 +3226,7 @@ struct Option MuttVars[] = {
   ** Also controls whether or not number of new articles of subscribed
   ** newsgroups will be then checked.
   */
-  { "show_only_unread", DT_BOOL, R_NONE, OPT_SHOW_ONLY_UNREAD, 0 },
+  { "show_only_unread", DT_BOOL, R_NONE, UL &OPT_SHOW_ONLY_UNREAD, 0 },
   /*
   ** .pp
   ** If \fIset\fP, only subscribed newsgroups that contain unread articles
@@ -3259,7 +3259,7 @@ struct Option MuttVars[] = {
   ** visible) and the other NeoMutt panels. ASCII and Unicode line-drawing
   ** characters are supported.
   */
-  { "sidebar_folder_indent", DT_BOOL, R_SIDEBAR, OPT_SIDEBAR_FOLDER_INDENT, 0 },
+  { "sidebar_folder_indent", DT_BOOL, R_SIDEBAR, UL &OPT_SIDEBAR_FOLDER_INDENT, 0 },
   /*
   ** .pp
   ** Set this to indent mailboxes in the sidebar.
@@ -3305,7 +3305,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** \fBSee also:\fP $$sidebar_short_path, $$sidebar_folder_indent, $$sidebar_delim_chars.
   */
-  { "sidebar_new_mail_only", DT_BOOL, R_SIDEBAR, OPT_SIDEBAR_NEW_MAIL_ONLY, 0 },
+  { "sidebar_new_mail_only", DT_BOOL, R_SIDEBAR, UL &OPT_SIDEBAR_NEW_MAIL_ONLY, 0 },
   /*
   ** .pp
   ** When set, the sidebar will only display mailboxes containing new, or
@@ -3313,7 +3313,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** \fBSee also:\fP $sidebar_whitelist.
   */
-  { "sidebar_next_new_wrap", DT_BOOL, R_NONE, OPT_SIDEBAR_NEXT_NEW_WRAP, 0 },
+  { "sidebar_next_new_wrap", DT_BOOL, R_NONE, UL &OPT_SIDEBAR_NEXT_NEW_WRAP, 0 },
   /*
   ** .pp
   ** When set, the \fC<sidebar-next-new>\fP command will not stop and the end of
@@ -3321,12 +3321,12 @@ struct Option MuttVars[] = {
   ** \fC<sidebar-prev-new>\fP command is similarly affected, wrapping around to
   ** the end of the list.
   */
-  { "sidebar_on_right", DT_BOOL, R_BOTH|R_REFLOW, OPT_SIDEBAR_ON_RIGHT, 0 },
+  { "sidebar_on_right", DT_BOOL, R_BOTH|R_REFLOW, UL &OPT_SIDEBAR_ON_RIGHT, 0 },
   /*
   ** .pp
   ** When set, the sidebar will appear on the right-hand side of the screen.
   */
-  { "sidebar_short_path", DT_BOOL, R_SIDEBAR, OPT_SIDEBAR_SHORT_PATH, 0 },
+  { "sidebar_short_path", DT_BOOL, R_SIDEBAR, UL &OPT_SIDEBAR_SHORT_PATH, 0 },
   /*
   ** .pp
   ** By default the sidebar will show the mailbox's path, relative to the
@@ -3362,7 +3362,7 @@ struct Option MuttVars[] = {
   ** You may optionally use the ``reverse-'' prefix to specify reverse sorting
   ** order (example: ``\fCset sort_browser=reverse-date\fP'').
   */
-  { "sidebar_component_depth", DT_NUMBER, R_SIDEBAR, UL &SidebarComponentDepth, UL 0 },
+  { "sidebar_component_depth", DT_NUMBER, R_SIDEBAR, UL &SidebarComponentDepth, 0 },
   /*
   ** .pp
   ** By default the sidebar will show the mailbox's path, relative to the
@@ -3374,7 +3374,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** \fBSee also:\fP $$sidebar_short_path
   */
-  { "sidebar_visible", DT_BOOL, R_REFLOW, OPT_SIDEBAR_VISIBLE, 0 },
+  { "sidebar_visible", DT_BOOL, R_REFLOW, UL &OPT_SIDEBAR_VISIBLE, 0 },
   /*
   ** .pp
   ** This specifies whether or not to show sidebar. The sidebar shows a list of
@@ -3390,7 +3390,7 @@ struct Option MuttVars[] = {
   ** Chinese characters.
   */
 #endif
-  { "sig_dashes",       DT_BOOL, R_NONE, OPT_SIG_DASHES, 1 },
+  { "sig_dashes",       DT_BOOL, R_NONE, UL &OPT_SIG_DASHES, 1 },
   /*
   ** .pp
   ** If \fIset\fP, a line containing ``-- '' (note the trailing space) will be inserted before your
@@ -3400,7 +3400,7 @@ struct Option MuttVars[] = {
   ** detect your signature.  For example, NeoMutt has the ability to highlight
   ** the signature in a different color in the built-in pager.
   */
-  { "sig_on_top",       DT_BOOL, R_NONE, OPT_SIG_ON_TOP, 0 },
+  { "sig_on_top",       DT_BOOL, R_NONE, UL &OPT_SIG_ON_TOP, 0 },
   /*
   ** .pp
   ** If \fIset\fP, the signature will be included before any quoted or forwarded
@@ -3442,7 +3442,7 @@ struct Option MuttVars[] = {
   ** messages from the current folder.  The default is to pause one second, so
   ** a value of zero for this option suppresses the pause.
   */
-  { "smart_wrap",       DT_BOOL, R_PAGER_FLOW, OPT_SMART_WRAP, 1 },
+  { "smart_wrap",       DT_BOOL, R_PAGER_FLOW, UL &OPT_SMART_WRAP, 1 },
   /*
   ** .pp
   ** Controls the display of lines longer than the screen width in the
@@ -3458,7 +3458,7 @@ struct Option MuttVars[] = {
   ** a line quoted text if it also matches $$smileys. This mostly
   ** happens at the beginning of a line.
   */
-  { "smime_ask_cert_label",     DT_BOOL, R_NONE, OPT_SMIME_ASK_CERT_LABEL, 1 },
+  { "smime_ask_cert_label",     DT_BOOL, R_NONE, UL &OPT_SMIME_ASK_CERT_LABEL, 1 },
   /*
   ** .pp
   ** This flag controls whether you want to be asked to enter a label
@@ -3512,7 +3512,7 @@ struct Option MuttVars[] = {
   ** alongside the documentation.
   ** (S/MIME only)
   */
-  { "smime_decrypt_use_default_key",    DT_BOOL, R_NONE, OPT_SMIME_DECRYPT_USE_DEFAULT_KEY, 1 },
+  { "smime_decrypt_use_default_key",    DT_BOOL, R_NONE, UL &OPT_SMIME_DECRYPT_USE_DEFAULT_KEY, 1 },
   /*
   ** .pp
   ** If \fIset\fP (default) this tells NeoMutt to use the default key for decryption. Otherwise,
@@ -3589,7 +3589,7 @@ struct Option MuttVars[] = {
   ** possible \fCprintf(3)\fP-like sequences.
   ** (S/MIME only)
   */
-  { "smime_is_default", DT_BOOL,  R_NONE, OPT_SMIME_IS_DEFAULT, 0 },
+  { "smime_is_default", DT_BOOL,  R_NONE, UL &OPT_SMIME_IS_DEFAULT, 0 },
   /*
   ** .pp
   ** The default behavior of NeoMutt is to use PGP on all auto-sign/encryption
@@ -3620,7 +3620,7 @@ struct Option MuttVars[] = {
   ** possible \fCprintf(3)\fP-like sequences.
   ** (S/MIME only)
   */
-  { "smime_self_encrypt",    DT_BOOL, R_NONE, OPT_SMIME_SELF_ENCRYPT, 0 },
+  { "smime_self_encrypt",    DT_BOOL, R_NONE, UL &OPT_SMIME_SELF_ENCRYPT, 0 },
   /*
   ** .pp
   ** When \fIset\fP, S/MIME encrypted messages will also be encrypted
@@ -3801,7 +3801,7 @@ struct Option MuttVars[] = {
   ** You may optionally use the ``reverse-'' prefix to specify reverse sorting
   ** order (example: ``\fCset sort_browser=reverse-date\fP'').
   */
-  { "sort_re",          DT_BOOL, R_INDEX|R_RESORT|R_RESORT_INIT, OPT_SORT_RE, 1 },
+  { "sort_re",          DT_BOOL, R_INDEX|R_RESORT|R_RESORT_INIT, UL &OPT_SORT_RE, 1 },
   /*
   ** .pp
   ** This variable is only useful when sorting by mailboxes in sidebar. By default,
@@ -3852,7 +3852,7 @@ struct Option MuttVars[] = {
   ** The file containing a client certificate and its associated private
   ** key.
   */
-  { "ssl_force_tls",            DT_BOOL, R_NONE, OPT_SSL_FORCE_TLS, 0 },
+  { "ssl_force_tls",            DT_BOOL, R_NONE, UL &OPT_SSL_FORCE_TLS, 0 },
   /*
    ** .pp
    ** If this variable is \fIset\fP, NeoMutt will require that all connections
@@ -3870,7 +3870,7 @@ struct Option MuttVars[] = {
   ** the default from the GNUTLS library. (GnuTLS only)
   */
 #endif /* USE_SSL_GNUTLS */
-  { "ssl_starttls", DT_QUAD, R_NONE, OPT_SSL_STARTTLS, MUTT_YES },
+  { "ssl_starttls", DT_QUAD, R_NONE, UL &OPT_SSL_STARTTLS, MUTT_YES },
   /*
   ** .pp
   ** If \fIset\fP (the default), NeoMutt will attempt to use \fCSTARTTLS\fP on servers
@@ -3878,7 +3878,7 @@ struct Option MuttVars[] = {
   ** use \fCSTARTTLS\fP regardless of the server's capabilities.
   */
 #ifdef USE_SSL_OPENSSL
-  { "ssl_use_sslv2", DT_BOOL, R_NONE, OPT_SSL_USE_SSLV2, 0 },
+  { "ssl_use_sslv2", DT_BOOL, R_NONE, UL &OPT_SSL_USE_SSLV2, 0 },
   /*
   ** .pp
   ** This variable specifies whether to attempt to use SSLv2 in the
@@ -3887,33 +3887,33 @@ struct Option MuttVars[] = {
   ** (OpenSSL only)
   */
 #endif /* defined USE_SSL_OPENSSL */
-  { "ssl_use_sslv3", DT_BOOL, R_NONE, OPT_SSL_USE_SSLV3, 0 },
+  { "ssl_use_sslv3", DT_BOOL, R_NONE, UL &OPT_SSL_USE_SSLV3, 0 },
   /*
   ** .pp
   ** This variable specifies whether to attempt to use SSLv3 in the
   ** SSL authentication process. Note that SSLv2 and SSLv3 are now
   ** considered fundamentally insecure and are no longer recommended.
   */
-  { "ssl_use_tlsv1", DT_BOOL, R_NONE, OPT_SSL_USE_TLSV1, 1 },
+  { "ssl_use_tlsv1", DT_BOOL, R_NONE, UL &OPT_SSL_USE_TLSV1, 1 },
   /*
   ** .pp
   ** This variable specifies whether to attempt to use TLSv1.0 in the
   ** SSL authentication process.
   */
-  { "ssl_use_tlsv1_1", DT_BOOL, R_NONE, OPT_SSL_USE_TLSV1_1, 1 },
+  { "ssl_use_tlsv1_1", DT_BOOL, R_NONE, UL &OPT_SSL_USE_TLSV1_1, 1 },
   /*
   ** .pp
   ** This variable specifies whether to attempt to use TLSv1.1 in the
   ** SSL authentication process.
   */
-  { "ssl_use_tlsv1_2", DT_BOOL, R_NONE, OPT_SSL_USE_TLSV1_2, 1 },
+  { "ssl_use_tlsv1_2", DT_BOOL, R_NONE, UL &OPT_SSL_USE_TLSV1_2, 1 },
   /*
   ** .pp
   ** This variable specifies whether to attempt to use TLSv1.2 in the
   ** SSL authentication process.
   */
 #ifdef USE_SSL_OPENSSL
-  { "ssl_usesystemcerts", DT_BOOL, R_NONE, OPT_SSL_USESYSTEMCERTS, 1 },
+  { "ssl_usesystemcerts", DT_BOOL, R_NONE, UL &OPT_SSL_USESYSTEMCERTS, 1 },
   /*
   ** .pp
   ** If set to \fIyes\fP, NeoMutt will use CA certificates in the
@@ -3921,7 +3921,7 @@ struct Option MuttVars[] = {
   ** is signed by a trusted CA. (OpenSSL only)
   */
 #endif
-  { "ssl_verify_dates", DT_BOOL, R_NONE, OPT_SSL_VERIFY_DATES, 1 },
+  { "ssl_verify_dates", DT_BOOL, R_NONE, UL &OPT_SSL_VERIFY_DATES, 1 },
   /*
   ** .pp
   ** If \fIset\fP (the default), NeoMutt will not automatically accept a server
@@ -3929,7 +3929,7 @@ struct Option MuttVars[] = {
   ** only unset this for particular known hosts, using the
   ** \fC$<account-hook>\fP function.
   */
-  { "ssl_verify_host", DT_BOOL, R_NONE, OPT_SSL_VERIFY_HOST, 1 },
+  { "ssl_verify_host", DT_BOOL, R_NONE, UL &OPT_SSL_VERIFY_HOST, 1 },
   /*
   ** .pp
   ** If \fIset\fP (the default), NeoMutt will not automatically accept a server
@@ -3939,7 +3939,7 @@ struct Option MuttVars[] = {
   */
 #ifdef USE_SSL_OPENSSL
 #ifdef HAVE_SSL_PARTIAL_CHAIN
-  { "ssl_verify_partial_chains", DT_BOOL, R_NONE, OPT_SSL_VERIFY_PARTIAL_CHAINS, 0 },
+  { "ssl_verify_partial_chains", DT_BOOL, R_NONE, UL &OPT_SSL_VERIFY_PARTIAL_CHAINS, 0 },
   /*
   ** .pp
   ** This option should not be changed from the default unless you understand
@@ -4058,14 +4058,14 @@ struct Option MuttVars[] = {
   ** will replace any dots in the expansion by underscores. This might be helpful
   ** with IMAP folders that don't like dots in folder names.
   */
-  { "status_on_top",    DT_BOOL, R_REFLOW, OPT_STATUS_ON_TOP, 0 },
+  { "status_on_top",    DT_BOOL, R_REFLOW, UL &OPT_STATUS_ON_TOP, 0 },
   /*
   ** .pp
   ** Setting this variable causes the ``status bar'' to be displayed on
   ** the first line of the screen rather than near the bottom. If $$help
   ** is \fIset\fP, too it'll be placed at the bottom.
   */
-  { "strict_threads",   DT_BOOL, R_RESORT|R_RESORT_INIT|R_INDEX, OPT_STRICT_THREADS, 0 },
+  { "strict_threads",   DT_BOOL, R_RESORT|R_RESORT_INIT|R_INDEX, UL &OPT_STRICT_THREADS, 0 },
   /*
   ** .pp
   ** If \fIset\fP, threading will only make use of the ``In-Reply-To'' and
@@ -4077,14 +4077,14 @@ struct Option MuttVars[] = {
   ** $$sort_re for a less drastic way of controlling this
   ** behavior.
   */
-  { "suspend",          DT_BOOL, R_NONE, OPT_SUSPEND, 1 },
+  { "suspend",          DT_BOOL, R_NONE, UL &OPT_SUSPEND, 1 },
   /*
   ** .pp
   ** When \fIunset\fP, NeoMutt won't stop when the user presses the terminal's
   ** \fIsusp\fP key, usually ``^Z''. This is useful if you run NeoMutt
   ** inside an xterm using a command like ``\fCxterm -e neomutt\fP''.
   */
-  { "text_flowed",      DT_BOOL, R_NONE, OPT_TEXT_FLOWED,  0 },
+  { "text_flowed",      DT_BOOL, R_NONE, UL &OPT_TEXT_FLOWED,  0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will generate ``format=flowed'' bodies with a content type
@@ -4095,7 +4095,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** Note that $$indent_string is ignored when this option is \fIset\fP.
   */
-  { "thorough_search",  DT_BOOL, R_NONE, OPT_THOROUGH_SEARCH, 1 },
+  { "thorough_search",  DT_BOOL, R_NONE, UL &OPT_THOROUGH_SEARCH, 1 },
   /*
   ** .pp
   ** Affects the \fC~b\fP and \fC~h\fP search operations described in
@@ -4109,13 +4109,13 @@ struct Option MuttVars[] = {
   ** raw message received (for example quoted-printable encoded or with encoded
   ** headers) which may lead to incorrect search results.
   */
-  { "thread_received",  DT_BOOL, R_RESORT|R_RESORT_INIT|R_INDEX, OPT_THREAD_RECEIVED, 0 },
+  { "thread_received",  DT_BOOL, R_RESORT|R_RESORT_INIT|R_INDEX, UL &OPT_THREAD_RECEIVED, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt uses the date received rather than the date sent
   ** to thread messages by subject.
   */
-  { "tilde",            DT_BOOL, R_PAGER, OPT_TILDE, 0 },
+  { "tilde",            DT_BOOL, R_PAGER, UL &OPT_TILDE, 0 },
   /*
   ** .pp
   ** When \fIset\fP, the internal-pager will pad blank lines to the bottom of the
@@ -4205,7 +4205,7 @@ struct Option MuttVars[] = {
   ** This string is identical in formatting to the one used by
   ** ``$$status_format''.
   */
-  { "ts_enabled",        DT_BOOL,  R_BOTH, OPT_TS_ENABLED, 0 },
+  { "ts_enabled",        DT_BOOL,  R_BOTH, UL &OPT_TS_ENABLED, 0 },
   /* The default must be off to force in the validity checking. */
   /*
   ** .pp
@@ -4238,13 +4238,13 @@ struct Option MuttVars[] = {
   ** tunnel commands per connection.
   */
 #endif
-  { "uncollapse_jump",  DT_BOOL, R_NONE, OPT_UNCOLLAPSE_JUMP, 0 },
+  { "uncollapse_jump",  DT_BOOL, R_NONE, UL &OPT_UNCOLLAPSE_JUMP, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will jump to the next unread message, if any,
   ** when the current thread is \fIun\fPcollapsed.
   */
-  { "uncollapse_new",   DT_BOOL, R_NONE, OPT_UNCOLLAPSE_NEW, 1 },
+  { "uncollapse_new",   DT_BOOL, R_NONE, UL &OPT_UNCOLLAPSE_NEW, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will automatically uncollapse any collapsed thread
@@ -4252,7 +4252,7 @@ struct Option MuttVars[] = {
   ** remain collapsed. the presence of the new message will still affect
   ** index sorting, though.
   */
-  { "use_8bitmime",     DT_BOOL, R_NONE, OPT_USE_8BITMIME, 0 },
+  { "use_8bitmime",     DT_BOOL, R_NONE, UL &OPT_USE_8BITMIME, 0 },
   /*
   ** .pp
   ** \fBWarning:\fP do not set this variable unless you are using a version
@@ -4262,14 +4262,14 @@ struct Option MuttVars[] = {
   ** When \fIset\fP, NeoMutt will invoke $$sendmail with the \fC-B8BITMIME\fP
   ** flag when sending 8-bit messages to enable ESMTP negotiation.
   */
-  { "use_domain",       DT_BOOL, R_NONE, OPT_USE_DOMAIN, 1 },
+  { "use_domain",       DT_BOOL, R_NONE, UL &OPT_USE_DOMAIN, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will qualify all local addresses (ones without the
   ** ``@host'' portion) with the value of $$hostname.  If \fIunset\fP, no
   ** addresses will be qualified.
   */
-  { "use_envelope_from",        DT_BOOL, R_NONE, OPT_USE_ENVELOPE_FROM, 0 },
+  { "use_envelope_from",        DT_BOOL, R_NONE, UL &OPT_USE_ENVELOPE_FROM, 0 },
   /*
    ** .pp
    ** When \fIset\fP, NeoMutt will set the \fIenvelope\fP sender of the message.
@@ -4285,7 +4285,7 @@ struct Option MuttVars[] = {
   { "envelope_from",    DT_SYNONYM,  R_NONE, UL "use_envelope_from", 0 },
   /*
   */
-  { "use_from",         DT_BOOL, R_NONE, OPT_USE_FROM, 1 },
+  { "use_from",         DT_BOOL, R_NONE, UL &OPT_USE_FROM, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will generate the ``From:'' header field when
@@ -4294,7 +4294,7 @@ struct Option MuttVars[] = {
   ** command.
   */
 #ifdef HAVE_GETADDRINFO
-  { "use_ipv6",         DT_BOOL, R_NONE, OPT_USE_IPV6, 1 },
+  { "use_ipv6",         DT_BOOL, R_NONE, UL &OPT_USE_IPV6, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will look for IPv6 addresses of hosts it tries to
@@ -4302,7 +4302,7 @@ struct Option MuttVars[] = {
   ** Normally, the default should work.
   */
 #endif /* HAVE_GETADDRINFO */
-  { "user_agent",       DT_BOOL, R_NONE, OPT_USER_AGENT, 1 },
+  { "user_agent",       DT_BOOL, R_NONE, UL &OPT_USER_AGENT, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will add a ``User-Agent:'' header to outgoing
@@ -4323,14 +4323,14 @@ struct Option MuttVars[] = {
   ** folders to your personal taste.  This string uses many of the same
   ** expandos as $$folder_format.
   */
-  { "virtual_spoolfile", DT_BOOL, R_NONE, OPT_VIRTUAL_SPOOLFILE, 0 },
+  { "virtual_spoolfile", DT_BOOL, R_NONE, UL &OPT_VIRTUAL_SPOOLFILE, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will use the first defined virtual mailbox (see
   ** virtual-mailboxes) as a spool file.
   */
 #endif
-  { "wait_key",         DT_BOOL, R_NONE, OPT_WAIT_KEY, 1 },
+  { "wait_key",         DT_BOOL, R_NONE, UL &OPT_WAIT_KEY, 1 },
   /*
   ** .pp
   ** Controls whether NeoMutt will ask you to press a key after an external command
@@ -4345,7 +4345,7 @@ struct Option MuttVars[] = {
   ** When \fIset\fP, NeoMutt will always ask for a key. When \fIunset\fP, NeoMutt will wait
   ** for a key only if the external command returned a non-zero status.
   */
-  { "weed",             DT_BOOL, R_NONE, OPT_WEED, 1 },
+  { "weed",             DT_BOOL, R_NONE, UL &OPT_WEED, 1 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will weed headers when displaying, forwarding,
@@ -4372,7 +4372,7 @@ struct Option MuttVars[] = {
   ** recommends a line length of 78 (the default), so \fBplease only change
   ** this setting when you know what you're doing\fP.
   */
-  { "wrap_search",      DT_BOOL, R_NONE, OPT_WRAP_SEARCH, 1 },
+  { "wrap_search",      DT_BOOL, R_NONE, UL &OPT_WRAP_SEARCH, 1 },
   /*
   ** .pp
   ** Controls whether searches wrap around the end.
@@ -4385,7 +4385,7 @@ struct Option MuttVars[] = {
   ** .pp
   ** (DEPRECATED) Equivalent to setting $$wrap with a negative value.
   */
-  { "write_bcc",        DT_BOOL, R_NONE, OPT_WRITE_BCC, 1 },
+  { "write_bcc",        DT_BOOL, R_NONE, UL &OPT_WRITE_BCC, 1 },
   /*
   ** .pp
   ** Controls whether NeoMutt writes out the ``Bcc:'' header when preparing
@@ -4414,21 +4414,21 @@ struct Option MuttVars[] = {
   /*
   */
 #ifdef USE_NNTP
-  { "x_comment_to",     DT_BOOL, R_NONE, OPT_X_COMMENT_TO, 0 },
+  { "x_comment_to",     DT_BOOL, R_NONE, UL &OPT_X_COMMENT_TO, 0 },
   /*
   ** .pp
   ** If \fIset\fP, NeoMutt will add ``X-Comment-To:'' field (that contains full
   ** name of original article author) to article that followuped to newsgroup.
   */
 #endif
-  { "collapse_all",     DT_BOOL, R_NONE, OPT_COLLAPSE_ALL, 0 },
+  { "collapse_all",     DT_BOOL, R_NONE, UL &OPT_COLLAPSE_ALL, 0 },
   /*
   ** .pp
   ** When \fIset\fP, NeoMutt will collapse all threads when entering a folder.
   */
   /*--*/
-  { "pgp_encrypt_self",   DT_QUAD, R_NONE, OPT_PGP_ENCRYPT_SELF,   MUTT_NO },
-  { "smime_encrypt_self", DT_QUAD, R_NONE, OPT_SMIME_ENCRYPT_SELF, MUTT_NO },
+  { "pgp_encrypt_self",   DT_QUAD, R_NONE, UL &OPT_PGP_ENCRYPT_SELF,   MUTT_NO },
+  { "smime_encrypt_self", DT_QUAD, R_NONE, UL &OPT_SMIME_ENCRYPT_SELF, MUTT_NO },
   { NULL, 0, 0, 0, 0 },
 };
 
index 4e956b660eaf4eb981cd4f20efda4be8c656a778..01db3a6b4f4e12365c74132b55aa8e863026818c 100644 (file)
--- a/keymap.c
+++ b/keymap.c
@@ -586,7 +586,7 @@ int km_dokey(int menu)
       if (map->op != OP_MACRO)
         return map->op;
 
-      if (option(OPT_IGNORE_MACRO_EVENTS))
+      if (OPT_IGNORE_MACRO_EVENTS)
       {
         mutt_error(_("Macros are currently disabled."));
         return -1;
diff --git a/main.c b/main.c
index dab9fdc2627e574366719e3195fe245dd4d6b0ea..8611a93b134c870fb17e960bbbb6be0428994acc 100644 (file)
--- a/main.c
+++ b/main.c
@@ -235,9 +235,6 @@ int main(int argc, char **argv, char **env)
   (void) mutt_rand32();
   umask(077);
 
-  memset(Options, 0, sizeof(Options));
-  memset(QuadOptions, 0, sizeof(QuadOptions));
-
   /* Init envlist */
   {
     char **srcp, **dstp;
@@ -437,7 +434,7 @@ int main(int argc, char **argv, char **env)
   if (!isatty(0) || !STAILQ_EMPTY(&queries) || !STAILQ_EMPTY(&alias_queries) ||
       dump_variables || batch_mode)
   {
-    set_option(OPT_NO_CURSES);
+    OPT_NO_CURSES = true;
     sendflags = SENDBATCH;
   }
 
@@ -447,7 +444,7 @@ int main(int argc, char **argv, char **env)
 
   /* This must come before mutt_init() because curses needs to be started
      before calling the init_pair() function to set the color scheme.  */
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
   {
     start_curses();
 
@@ -500,7 +497,7 @@ int main(int argc, char **argv, char **env)
     return rc;
   }
 
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
   {
     NORMAL_COLOR;
     clear();
@@ -509,7 +506,7 @@ int main(int argc, char **argv, char **env)
   }
 
   /* Create the Folder directory if it doesn't exist. */
-  if (!option(OPT_NO_CURSES) && Folder)
+  if (!OPT_NO_CURSES && Folder)
   {
     struct stat sb;
     char fpath[_POSIX_PATH_MAX];
@@ -541,7 +538,7 @@ int main(int argc, char **argv, char **env)
 
   if (sendflags & SENDPOSTPONED)
   {
-    if (!option(OPT_NO_CURSES))
+    if (!OPT_NO_CURSES)
       mutt_flushinp();
     ci_send_message(SENDPOSTPONED, NULL, NULL, NULL, NULL);
     mutt_free_windows();
@@ -558,7 +555,7 @@ int main(int argc, char **argv, char **env)
     int rv = 0;
     char expanded_infile[_POSIX_PATH_MAX];
 
-    if (!option(OPT_NO_CURSES))
+    if (!OPT_NO_CURSES)
       mutt_flushinp();
 
     if (!msg)
@@ -572,7 +569,7 @@ int main(int argc, char **argv, char **env)
       {
         if (url_parse_mailto(msg->env, &bodytext, argv[i]) < 0)
         {
-          if (!option(OPT_NO_CURSES))
+          if (!OPT_NO_CURSES)
             mutt_endwin(NULL);
           fputs(_("Failed to parse mailto: link\n"), stderr);
           exit(1);
@@ -582,9 +579,9 @@ int main(int argc, char **argv, char **env)
         msg->env->to = mutt_addr_parse_list(msg->env->to, argv[i]);
     }
 
-    if (!draft_file && option(OPT_AUTOEDIT) && !msg->env->to && !msg->env->cc)
+    if (!draft_file && OPT_AUTOEDIT && !msg->env->to && !msg->env->cc)
     {
-      if (!option(OPT_NO_CURSES))
+      if (!OPT_NO_CURSES)
         mutt_endwin(NULL);
       fputs(_("No recipients specified.\n"), stderr);
       exit(1);
@@ -624,7 +621,7 @@ int main(int argc, char **argv, char **env)
           fin = fopen(expanded_infile, "r");
           if (!fin)
           {
-            if (!option(OPT_NO_CURSES))
+            if (!OPT_NO_CURSES)
               mutt_endwin(NULL);
             perror(expanded_infile);
             exit(1);
@@ -644,7 +641,7 @@ int main(int argc, char **argv, char **env)
         fout = mutt_file_fopen(tempfile, "w");
         if (!fout)
         {
-          if (!option(OPT_NO_CURSES))
+          if (!OPT_NO_CURSES)
             mutt_endwin(NULL);
           perror(tempfile);
           mutt_file_fclose(&fin);
@@ -664,7 +661,7 @@ int main(int argc, char **argv, char **env)
         fin = fopen(tempfile, "r");
         if (!fin)
         {
-          if (!option(OPT_NO_CURSES))
+          if (!OPT_NO_CURSES)
             mutt_endwin(NULL);
           perror(tempfile);
           FREE(&tempfile);
@@ -710,8 +707,8 @@ int main(int argc, char **argv, char **env)
         {
           if (mutt_str_strncasecmp("X-Mutt-Resume-Draft:", np->data, 20) == 0)
           {
-            if (option(OPT_RESUME_EDITED_DRAFT_FILES))
-              set_option(OPT_RESUME_DRAFT_FILES);
+            if (OPT_RESUME_EDITED_DRAFT_FILES)
+              OPT_RESUME_DRAFT_FILES = true;
 
             STAILQ_REMOVE(&msg->env->userhdrs, np, ListNode, entries);
             FREE(&np->data);
@@ -763,7 +760,7 @@ int main(int argc, char **argv, char **env)
           msg->content = a = mutt_make_file_attach(np->data);
         if (!a)
         {
-          if (!option(OPT_NO_CURSES))
+          if (!OPT_NO_CURSES)
             mutt_endwin(NULL);
           fprintf(stderr, _("%s: unable to attach file.\n"), np->data);
           mutt_list_free(&attach);
@@ -783,7 +780,7 @@ int main(int argc, char **argv, char **env)
       {
         if (truncate(expanded_infile, 0) == -1)
         {
-          if (!option(OPT_NO_CURSES))
+          if (!OPT_NO_CURSES)
             mutt_endwin(NULL);
           perror(expanded_infile);
           exit(1);
@@ -791,7 +788,7 @@ int main(int argc, char **argv, char **env)
         fout = mutt_file_fopen(expanded_infile, "a");
         if (!fout)
         {
-          if (!option(OPT_NO_CURSES))
+          if (!OPT_NO_CURSES)
             mutt_endwin(NULL);
           perror(expanded_infile);
           exit(1);
@@ -810,12 +807,12 @@ int main(int argc, char **argv, char **env)
         }
 
         mutt_write_rfc822_header(fout, msg->env, msg->content, -1, 0);
-        if (option(OPT_RESUME_EDITED_DRAFT_FILES))
+        if (OPT_RESUME_EDITED_DRAFT_FILES)
           fprintf(fout, "X-Mutt-Resume-Draft: 1\n");
         fputc('\n', fout);
         if ((mutt_write_mime_body(msg->content, fout) == -1))
         {
-          if (!option(OPT_NO_CURSES))
+          if (!OPT_NO_CURSES)
             mutt_endwin(NULL);
           mutt_file_fclose(&fout);
           exit(1);
@@ -834,7 +831,7 @@ int main(int argc, char **argv, char **env)
     }
 
     mutt_free_windows();
-    if (!option(OPT_NO_CURSES))
+    if (!OPT_NO_CURSES)
       mutt_endwin(NULL);
 
     if (rv)
@@ -857,7 +854,7 @@ int main(int argc, char **argv, char **env)
 #ifdef USE_NNTP
       if (flags & MUTT_NEWS)
       {
-        set_option(OPT_NEWS);
+        OPT_NEWS = true;
         CurrentNewsSrv = nntp_select_server(NewsServer, false);
         if (!CurrentNewsSrv)
         {
@@ -891,9 +888,9 @@ int main(int argc, char **argv, char **env)
     }
 
 #ifdef USE_NNTP
-    if (option(OPT_NEWS))
+    if (OPT_NEWS)
     {
-      unset_option(OPT_NEWS);
+      OPT_NEWS = false;
       nntp_expand_path(folder, sizeof(folder), &CurrentNewsSrv->conn->account);
     }
     else
@@ -920,8 +917,7 @@ int main(int argc, char **argv, char **env)
     mutt_folder_hook(folder);
     mutt_startup_shutdown_hook(MUTT_STARTUPHOOK);
 
-    Context = mx_open_mailbox(
-        folder, ((flags & MUTT_RO) || option(OPT_READ_ONLY)) ? MUTT_READONLY : 0, NULL);
+    Context = mx_open_mailbox(folder, ((flags & MUTT_RO) || OPT_READ_ONLY) ? MUTT_READONLY : 0, NULL);
     if (Context || !explicit_folder)
     {
 #ifdef USE_SIDEBAR
diff --git a/mbox.c b/mbox.c
index 89dcd29d1d71a564ffef333b84569e42093ea041..5177ee9c2935d68e4a019469efeaadc169302132 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -921,8 +921,7 @@ void mbox_reset_atime(struct Context *ctx, struct stat *st)
    * When $mbox_check_recent is set, existing new mail is ignored, so do not
    * reset the atime to mtime-1 to signal new mail.
    */
-  if (!option(OPT_MAIL_CHECK_RECENT) && utimebuf.actime >= utimebuf.modtime &&
-      mbox_has_new(ctx))
+  if (!OPT_MAIL_CHECK_RECENT && utimebuf.actime >= utimebuf.modtime && mbox_has_new(ctx))
   {
     utimebuf.actime = utimebuf.modtime - 1;
   }
@@ -1259,7 +1258,7 @@ static int mbox_sync_mailbox(struct Context *ctx, int *index_hint)
   unlink(tempfile); /* remove partial copy of the mailbox */
   mutt_sig_unblock();
 
-  if (option(OPT_CHECK_MBOX_SIZE))
+  if (OPT_CHECK_MBOX_SIZE)
   {
     tmp = mutt_find_mailbox(ctx->path);
     if (tmp && tmp->new == false)
diff --git a/menu.c b/menu.c
index 6994052146de33b3ede54a1fd20de1146beb3184..47be7e240a5370524f6902d7d4e8d440fc5a5a68 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -125,7 +125,7 @@ static void print_enriched_string(int index, int attr, unsigned char *s, int do_
         switch (*s)
         {
           case MUTT_TREE_LLCORNER:
-            if (option(OPT_ASCII_CHARS))
+            if (OPT_ASCII_CHARS)
               addch('`');
 #ifdef WACS_LLCORNER
             else
@@ -138,7 +138,7 @@ static void print_enriched_string(int index, int attr, unsigned char *s, int do_
 #endif
             break;
           case MUTT_TREE_ULCORNER:
-            if (option(OPT_ASCII_CHARS))
+            if (OPT_ASCII_CHARS)
               addch(',');
 #ifdef WACS_ULCORNER
             else
@@ -151,7 +151,7 @@ static void print_enriched_string(int index, int attr, unsigned char *s, int do_
 #endif
             break;
           case MUTT_TREE_LTEE:
-            if (option(OPT_ASCII_CHARS))
+            if (OPT_ASCII_CHARS)
               addch('|');
 #ifdef WACS_LTEE
             else
@@ -164,7 +164,7 @@ static void print_enriched_string(int index, int attr, unsigned char *s, int do_
 #endif
             break;
           case MUTT_TREE_HLINE:
-            if (option(OPT_ASCII_CHARS))
+            if (OPT_ASCII_CHARS)
               addch('-');
 #ifdef WACS_HLINE
             else
@@ -177,7 +177,7 @@ static void print_enriched_string(int index, int attr, unsigned char *s, int do_
 #endif
             break;
           case MUTT_TREE_VLINE:
-            if (option(OPT_ASCII_CHARS))
+            if (OPT_ASCII_CHARS)
               addch('|');
 #ifdef WACS_VLINE
             else
@@ -190,7 +190,7 @@ static void print_enriched_string(int index, int attr, unsigned char *s, int do_
 #endif
             break;
           case MUTT_TREE_TTEE:
-            if (option(OPT_ASCII_CHARS))
+            if (OPT_ASCII_CHARS)
               addch('-');
 #ifdef WACS_TTEE
             else
@@ -203,7 +203,7 @@ static void print_enriched_string(int index, int attr, unsigned char *s, int do_
 #endif
             break;
           case MUTT_TREE_BTEE:
-            if (option(OPT_ASCII_CHARS))
+            if (OPT_ASCII_CHARS)
               addch('-');
 #ifdef WACS_BTEE
             else
@@ -289,7 +289,7 @@ static void menu_make_entry(char *s, int l, struct Menu *menu, int i)
 static void menu_pad_string(struct Menu *menu, char *buf, size_t buflen)
 {
   char *scratch = mutt_str_strdup(buf);
-  int shift = option(OPT_ARROW_CURSOR) ? 3 : 0;
+  int shift = OPT_ARROW_CURSOR ? 3 : 0;
   int cols = menu->indexwin->cols - shift;
 
   mutt_simple_format(buf, buflen, cols, cols, FMT_LEFT, ' ', scratch,
@@ -308,7 +308,7 @@ void menu_redraw_full(struct Menu *menu)
   move(0, 0);
   clrtobot();
 
-  if (option(OPT_HELP))
+  if (OPT_HELP)
   {
     SETCOLOR(MT_COLOR_STATUS);
     mutt_window_move(menu->helpwin, 0, 0);
@@ -368,7 +368,7 @@ void menu_redraw_index(struct Menu *menu)
       if (i == menu->current)
       {
         SETCOLOR(MT_COLOR_INDICATOR);
-        if (option(OPT_ARROW_CURSOR))
+        if (OPT_ARROW_CURSOR)
         {
           addstr("->");
           ATTRSET(attr);
@@ -377,7 +377,7 @@ void menu_redraw_index(struct Menu *menu)
         else
           do_color = false;
       }
-      else if (option(OPT_ARROW_CURSOR))
+      else if (OPT_ARROW_CURSOR)
         addstr("   ");
 
       print_enriched_string(i, attr, (unsigned char *) buf, do_color);
@@ -411,7 +411,7 @@ void menu_redraw_motion(struct Menu *menu)
   mutt_window_move(menu->indexwin, menu->oldcurrent + menu->offset - menu->top, 0);
   ATTRSET(old_color);
 
-  if (option(OPT_ARROW_CURSOR))
+  if (OPT_ARROW_CURSOR)
   {
     /* clear the pointer */
     addstr("  ");
@@ -457,7 +457,7 @@ void menu_redraw_current(struct Menu *menu)
   menu_pad_string(menu, buf, sizeof(buf));
 
   SETCOLOR(MT_COLOR_INDICATOR);
-  if (option(OPT_ARROW_CURSOR))
+  if (OPT_ARROW_CURSOR)
   {
     addstr("->");
     ATTRSET(attr);
@@ -475,10 +475,10 @@ static void menu_redraw_prompt(struct Menu *menu)
 {
   if (menu->dialog)
   {
-    if (option(OPT_MSG_ERR))
+    if (OPT_MSG_ERR)
     {
       mutt_sleep(1);
-      unset_option(OPT_MSG_ERR);
+      OPT_MSG_ERR = false;
     }
 
     if (*ErrorBuf)
@@ -494,7 +494,7 @@ void menu_check_recenter(struct Menu *menu)
   int c = MIN(MenuContext, menu->pagelen / 2);
   int old_top = menu->top;
 
-  if (!option(OPT_MENU_MOVE_OFF) && menu->max <= menu->pagelen) /* less entries than lines */
+  if (!OPT_MENU_MOVE_OFF && menu->max <= menu->pagelen) /* less entries than lines */
   {
     if (menu->top != 0)
     {
@@ -504,7 +504,7 @@ void menu_check_recenter(struct Menu *menu)
   }
   else
   {
-    if (option(OPT_MENU_SCROLL) || (menu->pagelen <= 0) || (c < MenuContext))
+    if (OPT_MENU_SCROLL || (menu->pagelen <= 0) || (c < MenuContext))
     {
       if (menu->current < menu->top + c)
         menu->top = menu->current - c;
@@ -523,7 +523,7 @@ void menu_check_recenter(struct Menu *menu)
     }
   }
 
-  if (!option(OPT_MENU_MOVE_OFF)) /* make entries stick to bottom */
+  if (!OPT_MENU_MOVE_OFF) /* make entries stick to bottom */
     menu->top = MIN(menu->top, menu->max - menu->pagelen);
   menu->top = MAX(menu->top, 0);
 
@@ -563,7 +563,7 @@ void menu_next_line(struct Menu *menu)
     int c = MIN(MenuContext, menu->pagelen / 2);
 
     if (menu->top + 1 < menu->max - c &&
-        (option(OPT_MENU_MOVE_OFF) ||
+        (OPT_MENU_MOVE_OFF ||
          (menu->max > menu->pagelen && menu->top < menu->max - menu->pagelen)))
     {
       menu->top++;
@@ -616,7 +616,7 @@ static void menu_length_jump(struct Menu *menu, int jumplen)
       menu->top += jumplen;
 
       /* jumped too long? */
-      if ((neg || !option(OPT_MENU_MOVE_OFF)) && DIRECTION * menu->top > tmp)
+      if ((neg || !OPT_MENU_MOVE_OFF) && DIRECTION * menu->top > tmp)
         menu->top = tmp;
 
       /* need to move the cursor? */
@@ -985,7 +985,7 @@ search_next:
     r += search_dir;
   }
 
-  if (option(OPT_WRAP_SEARCH) && wrap++ == 0)
+  if (OPT_WRAP_SEARCH && wrap++ == 0)
   {
     r = search_dir == 1 ? 0 : menu->max - 1;
     goto search_next;
@@ -1094,9 +1094,9 @@ int mutt_menu_loop(struct Menu *menu)
 
   while (true)
   {
-    if (option(OPT_MENU_CALLER))
+    if (OPT_MENU_CALLER)
     {
-      unset_option(OPT_MENU_CALLER);
+      OPT_MENU_CALLER = false;
       return OP_NULL;
     }
 
@@ -1121,9 +1121,9 @@ int mutt_menu_loop(struct Menu *menu)
     menu->oldcurrent = menu->current;
 
     /* move the cursor out of the way */
-    if (option(OPT_ARROW_CURSOR))
+    if (OPT_ARROW_CURSOR)
       mutt_window_move(menu->indexwin, menu->current - menu->top + menu->offset, 2);
-    else if (option(OPT_BRAILLE_FRIENDLY))
+    else if (OPT_BRAILLE_FRIENDLY)
       mutt_window_move(menu->indexwin, menu->current - menu->top + menu->offset, 0);
     else
       mutt_window_move(menu->indexwin, menu->current - menu->top + menu->offset,
@@ -1162,7 +1162,7 @@ int mutt_menu_loop(struct Menu *menu)
         i = -1;
       }
     }
-    else if (menu->tagged && option(OPT_AUTO_TAG))
+    else if (menu->tagged && OPT_AUTO_TAG)
       menu->tagprefix = true;
 
     mutt_curs_set(1);
@@ -1271,7 +1271,7 @@ int mutt_menu_loop(struct Menu *menu)
       case OP_TAG:
         if (menu->tag && !menu->dialog)
         {
-          if (menu->tagprefix && !option(OPT_AUTO_TAG))
+          if (menu->tagprefix && !OPT_AUTO_TAG)
           {
             for (i = 0; i < menu->max; i++)
               menu->tagged += menu->tag(menu, i, 0);
@@ -1281,7 +1281,7 @@ int mutt_menu_loop(struct Menu *menu)
           {
             int j = menu->tag(menu, menu->current, -1);
             menu->tagged += j;
-            if (j && option(OPT_RESOLVE) && menu->current < menu->max - 1)
+            if (j && OPT_RESOLVE && menu->current < menu->max - 1)
             {
               menu->current++;
               menu->redraw |= REDRAW_MOTION_RESYNCH;
diff --git a/mh.c b/mh.c
index c1c0402242c7fe8212fc5a3ef9f8a1495247a88a..a17bf2e4e7c4c34fdec161bdbc97d527bf26cc24 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -313,7 +313,7 @@ bool mh_buffy(struct Buffy *mailbox, bool check_stats)
 
   /* when $mail_check_recent is set and the .mh_sequences file hasn't changed
    * since the last mailbox visit, there is no "new mail" */
-  if (option(OPT_MAIL_CHECK_RECENT) && mh_sequences_changed(mailbox) <= 0)
+  if (OPT_MAIL_CHECK_RECENT && mh_sequences_changed(mailbox) <= 0)
   {
     rc = false;
     check_new = false;
@@ -345,7 +345,7 @@ bool mh_buffy(struct Buffy *mailbox, bool check_stats)
       {
         /* if the first unseen message we encounter was in the mailbox during the
            last visit, don't notify about it */
-        if (!option(OPT_MAIL_CHECK_RECENT) || mh_already_notified(mailbox, i) == 0)
+        if (!OPT_MAIL_CHECK_RECENT || mh_already_notified(mailbox, i) == 0)
         {
           mailbox->new = true;
           rc = true;
@@ -735,7 +735,7 @@ void maildir_parse_flags(struct Header *h, const char *path)
           break;
 
         case 'T': /* trashed */
-          if (!h->flagged || !option(OPT_FLAG_SAFE))
+          if (!h->flagged || !OPT_FLAG_SAFE)
           {
             h->trash = true;
             h->deleted = true;
@@ -854,7 +854,7 @@ static int maildir_parse_dir(struct Context *ctx, struct Maildir ***last,
   if (subdir)
   {
     snprintf(buf, sizeof(buf), "%s/%s", ctx->path, subdir);
-    is_old = option(OPT_MARK_OLD) ? (mutt_str_strcmp("cur", subdir) == 0) : false;
+    is_old = OPT_MARK_OLD ? (mutt_str_strcmp("cur", subdir) == 0) : false;
   }
   else
     mutt_str_strfcpy(buf, ctx->path, sizeof(buf));
@@ -1180,7 +1180,7 @@ static void maildir_delayed_parsing(struct Context *ctx, struct Maildir **md,
     snprintf(fn, sizeof(fn), "%s/%s", ctx->path, p->h->path);
 
 #ifdef USE_HCACHE
-    if (option(OPT_MAILDIR_HEADER_CACHE_VERIFY))
+    if (OPT_MAILDIR_HEADER_CACHE_VERIFY)
     {
       ret = stat(fn, &lastchanged);
     }
@@ -1921,10 +1921,10 @@ int mh_sync_mailbox_message(struct Context *ctx, int msgno)
   char path[_POSIX_PATH_MAX], tmp[_POSIX_PATH_MAX];
   struct Header *h = ctx->hdrs[msgno];
 
-  if (h->deleted && (ctx->magic != MUTT_MAILDIR || !option(OPT_MAILDIR_TRASH)))
+  if (h->deleted && (ctx->magic != MUTT_MAILDIR || !OPT_MAILDIR_TRASH))
   {
     snprintf(path, sizeof(path), "%s/%s", ctx->path, h->path);
-    if (ctx->magic == MUTT_MAILDIR || (option(OPT_MH_PURGE) && ctx->magic == MUTT_MH))
+    if (ctx->magic == MUTT_MAILDIR || (OPT_MH_PURGE && ctx->magic == MUTT_MH))
     {
 #ifdef USE_HCACHE
       if (hc)
@@ -1956,8 +1956,8 @@ int mh_sync_mailbox_message(struct Context *ctx, int msgno)
     }
   }
   else if (h->changed || h->attach_del || h->xlabel_changed ||
-           (ctx->magic == MUTT_MAILDIR &&
-            (option(OPT_MAILDIR_TRASH) || h->trash) && (h->deleted != h->trash)))
+           (ctx->magic == MUTT_MAILDIR && (OPT_MAILDIR_TRASH || h->trash) &&
+            (h->deleted != h->trash)))
   {
     if (ctx->magic == MUTT_MAILDIR)
     {
@@ -2065,7 +2065,7 @@ static int maildir_check_mailbox(struct Context *ctx, int *index_hint)
   /* XXX seems like this check belongs in mx_check_mailbox()
    * rather than here.
    */
-  if (!option(OPT_CHECK_NEW))
+  if (!OPT_CHECK_NEW)
     return 0;
 
   snprintf(buf, sizeof(buf), "%s/new", ctx->path);
@@ -2215,7 +2215,7 @@ static int mh_check_mailbox(struct Context *ctx, int *index_hint)
   int i;
   struct MhData *data = mh_data(ctx);
 
-  if (!option(OPT_CHECK_NEW))
+  if (!OPT_CHECK_NEW)
     return 0;
 
   mutt_str_strfcpy(buf, ctx->path, sizeof(buf));
@@ -2373,7 +2373,7 @@ static int mh_sync_mailbox(struct Context *ctx, int *index_hint)
   {
     for (i = 0, j = 0; i < ctx->msgcount; i++)
     {
-      if (!ctx->hdrs[i]->deleted || (ctx->magic == MUTT_MAILDIR && option(OPT_MAILDIR_TRASH)))
+      if (!ctx->hdrs[i]->deleted || (ctx->magic == MUTT_MAILDIR && OPT_MAILDIR_TRASH))
         ctx->hdrs[i]->index = j++;
     }
   }
diff --git a/mutt.h b/mutt.h
index 06b0d092b5bb46e2eed666f04052c394f0b1161f..8af2389455e39f36d1cf0d491661298d70a16a38 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -29,6 +29,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdio.h>
+#include "where.h"
 
 struct ListHead;
 struct Mapping;
@@ -228,48 +229,41 @@ enum QuadOptionResponse
   MUTT_ASKYES
 };
 
-/**
- * enum QuadOptionVars - Index of all QuadOptions
- */
-enum QuadOptionVars
-{
-  OPT_ABORT_UNMODIFIED,
-  OPT_BOUNCE,
-  OPT_COPY,
-  OPT_DELETE,
-  OPT_FORWARD_EDIT,
-  OPT_FCC_ATTACH,
-  OPT_INCLUDE,
-  OPT_HONOR_FOLLOWUP_TO,
-  OPT_MIME_FORWARD,
-  OPT_MIME_FORWARD_REST,
-  OPT_MOVE,
-  OPT_PGP_MIME_AUTO, /* ask to revert to PGP/MIME when inline fails */
-  OPT_SMIME_ENCRYPT_SELF,
-  OPT_PGP_ENCRYPT_SELF,
+/* Quad-options */
+WHERE unsigned char OPT_ABORT_UNMODIFIED;
+WHERE unsigned char OPT_BOUNCE;
+WHERE unsigned char OPT_COPY;
+WHERE unsigned char OPT_DELETE;
+WHERE unsigned char OPT_FORWARD_EDIT;
+WHERE unsigned char OPT_FCC_ATTACH;
+WHERE unsigned char OPT_INCLUDE;
+WHERE unsigned char OPT_HONOR_FOLLOWUP_TO;
+WHERE unsigned char OPT_MIME_FORWARD;
+WHERE unsigned char OPT_MIME_FORWARD_REST;
+WHERE unsigned char OPT_MOVE;
+WHERE unsigned char OPT_PGP_MIME_AUTO; /* ask to revert to PGP/MIME when inline fails */
+WHERE unsigned char OPT_SMIME_ENCRYPT_SELF;
+WHERE unsigned char OPT_PGP_ENCRYPT_SELF;
 #ifdef USE_POP
-  OPT_POP_DELETE,
-  OPT_POP_RECONNECT,
+WHERE unsigned char OPT_POP_DELETE;
+WHERE unsigned char OPT_POP_RECONNECT;
 #endif
-  OPT_POSTPONE,
-  OPT_PRINT,
-  OPT_QUIT,
-  OPT_REPLY_TO,
-  OPT_RECALL,
+WHERE unsigned char OPT_POSTPONE;
+WHERE unsigned char OPT_PRINT;
+WHERE unsigned char OPT_QUIT;
+WHERE unsigned char OPT_REPLY_TO;
+WHERE unsigned char OPT_RECALL;
 #ifdef USE_SSL
-  OPT_SSL_STARTTLS,
+WHERE unsigned char OPT_SSL_STARTTLS;
 #endif
-  OPT_ABORT_NOSUBJECT,
-  OPT_CRYPT_VERIFY_SIG, /* verify PGP signatures */
+WHERE unsigned char OPT_ABORT_NOSUBJECT;
+WHERE unsigned char OPT_CRYPT_VERIFY_SIG; /* verify PGP signatures */
 #ifdef USE_NNTP
-  OPT_POST_MODERATED,
-  OPT_CATCHUP_NEWSGROUP,
-  OPT_FOLLOWUP_TO_POSTER,
+WHERE unsigned char OPT_POST_MODERATED;
+WHERE unsigned char OPT_CATCHUP_NEWSGROUP;
+WHERE unsigned char OPT_FOLLOWUP_TO_POSTER;
 #endif
-  OPT_ABORT_NOATTACH, /* forgotten attachment detector */
-  /* THIS MUST BE THE LAST VALUE. */
-  OPT_QUAD_MAX,
-};
+WHERE unsigned char OPT_ABORT_NOATTACH; /* forgotten attachment detector */
 
 /* flags to ci_send_message() */
 #define SENDREPLY        (1 << 0)
index 9b2f9dbff4893d8790d06629bb619d2cff7197fe..e407516633025e9216a1b23372f332512119227a 100644 (file)
@@ -205,7 +205,7 @@ int mutt_account_getuser(struct Account *account)
   else if ((account->type == MUTT_ACCT_TYPE_NNTP) && NntpUser)
     mutt_str_strfcpy(account->user, NntpUser, sizeof(account->user));
 #endif
-  else if (option(OPT_NO_CURSES))
+  else if (OPT_NO_CURSES)
     return -1;
   /* prompt (defaults to unix username), copy into account->user */
   else
@@ -289,7 +289,7 @@ int mutt_account_getpass(struct Account *account)
   else if ((account->type == MUTT_ACCT_TYPE_NNTP) && NntpPass)
     mutt_str_strfcpy(account->pass, NntpPass, sizeof(account->pass));
 #endif
-  else if (option(OPT_NO_CURSES))
+  else if (OPT_NO_CURSES)
     return -1;
   else
   {
index eb6af86e7cdbc6e4bad73a5a2cf91d431b12c1d8..e77e1a16ff8ecb774803b729cf74529e0ad7e0ca 100644 (file)
@@ -81,7 +81,7 @@
 #define BEEP()                                                                 \
   do                                                                           \
   {                                                                            \
-    if (option(OPT_BEEP))                                                       \
+    if (OPT_BEEP)                                                       \
       beep();                                                                  \
   } while (0)
 
index ac4719ca62de80434e38125cf345e16d02a5dce4..0d5f01356c17d9bb679cbcc794eb09433dfca0c8 100644 (file)
@@ -143,7 +143,7 @@ char *mutt_idna_intl_to_local(char *orig_user, char *orig_domain, int flags)
 
 #ifdef HAVE_LIBIDN
   is_idn_encoded = check_idn(local_domain);
-  if (is_idn_encoded && option(OPT_IDN_DECODE))
+  if (is_idn_encoded && OPT_IDN_DECODE)
   {
     if (idna_to_unicode_8z8z(local_domain, &tmp, IDNA_ALLOW_UNASSIGNED) != IDNA_SUCCESS)
       goto cleanup;
@@ -197,7 +197,7 @@ char *mutt_idna_intl_to_local(char *orig_user, char *orig_domain, int flags)
      * produce a non-matching domain!  Thus we only want to do the
      * idna_to_ascii_8z() if the original domain was IDNA encoded.
      */
-    if (is_idn_encoded && option(OPT_IDN_DECODE))
+    if (is_idn_encoded && OPT_IDN_DECODE)
     {
       if (idna_to_ascii_8z(reversed_domain, &tmp, IDNA_ALLOW_UNASSIGNED) != IDNA_SUCCESS)
       {
@@ -247,7 +247,7 @@ char *mutt_idna_local_to_intl(char *user, char *domain)
     goto cleanup;
 
 #ifdef HAVE_LIBIDN
-  if (option(OPT_IDN_ENCODE))
+  if (OPT_IDN_ENCODE)
   {
     if (idna_to_ascii_8z(intl_domain, &tmp, IDNA_ALLOW_UNASSIGNED) != IDNA_SUCCESS)
       goto cleanup;
index 8ac9a5958c572204cbc5d7e4b3dcc93bc7c44a47..447eb86691d2a5d6fcdeb10f227048d93fc72493 100644 (file)
@@ -232,7 +232,7 @@ static int lua_mutt_get(lua_State *l)
         }
         return 1;
       case DT_QUAD:
-        lua_pushinteger(l, quadoption(opt.data));
+        lua_pushinteger(l, opt.data);
         return 1;
       case DT_REGEX:
       case DT_MAGIC:
@@ -251,7 +251,7 @@ static int lua_mutt_get(lua_State *l)
         lua_pushinteger(l, (signed short) *((unsigned long *) opt.data));
         return 1;
       case DT_BOOL:
-        lua_pushboolean(l, option(opt.data));
+        lua_pushboolean(l, opt.data);
         return 1;
       default:
         luaL_error(l, "NeoMutt parameter type %d unknown for %s", opt.type, param);
index a1a522f20f9ff5e860e3b706afa694a0edd5e5f6..0ca9c916c2a0e7485f8fd850fa77b4f61f95db9f 100644 (file)
@@ -41,7 +41,7 @@ static void curses_signal_handler(int sig)
   switch (sig)
   {
     case SIGTSTP: /* user requested a suspend */
-      if (!option(OPT_SUSPEND))
+      if (!OPT_SUSPEND)
         break;
       IsEndwin = isendwin();
       curs_set(1);
index ae6dad7342183b13c32c25b3e2a0fe52f2a492f2..55597ad89c8e24794b1d0902d37a78dca8025b0a 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -726,7 +726,7 @@ void mutt_save_path(char *d, size_t dsize, struct Address *a)
   if (a && a->mailbox)
   {
     mutt_str_strfcpy(d, a->mailbox, dsize);
-    if (!option(OPT_SAVE_ADDRESS))
+    if (!OPT_SAVE_ADDRESS)
     {
       char *p = NULL;
 
@@ -776,7 +776,7 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c
 
   prefix[0] = '\0';
   buflen--; /* save room for the terminal \0 */
-  wlen = ((flags & MUTT_FORMAT_ARROWCURSOR) && option(OPT_ARROW_CURSOR)) ? 3 : 0;
+  wlen = ((flags & MUTT_FORMAT_ARROWCURSOR) && OPT_ARROW_CURSOR) ? 3 : 0;
   col += wlen;
 
   if ((flags & MUTT_FORMAT_NOFILTER) == 0)
@@ -843,7 +843,7 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c
 
       col -= wlen; /* reset to passed in value */
       wptr = buf;  /* reset write ptr */
-      wlen = ((flags & MUTT_FORMAT_ARROWCURSOR) && option(OPT_ARROW_CURSOR)) ? 3 : 0;
+      wlen = ((flags & MUTT_FORMAT_ARROWCURSOR) && OPT_ARROW_CURSOR) ? 3 : 0;
       pid = mutt_create_filter(command->data, NULL, &filter, NULL);
       if (pid != -1)
       {
@@ -1120,8 +1120,7 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c
           }
           else if (soft && pad < 0)
           {
-            int offset =
-                ((flags & MUTT_FORMAT_ARROWCURSOR) && option(OPT_ARROW_CURSOR)) ? 3 : 0;
+            int offset = ((flags & MUTT_FORMAT_ARROWCURSOR) && OPT_ARROW_CURSOR) ? 3 : 0;
             int avail_cols = (cols > offset) ? (cols - offset) : 0;
             /* \0-terminate buf for length computation in mutt_wstr_trunc() */
             *wptr = 0;
@@ -1341,7 +1340,7 @@ int mutt_save_confirm(const char *s, struct stat *st)
 
   if (magic > 0 && !mx_access(s, W_OK))
   {
-    if (option(OPT_CONFIRMAPPEND))
+    if (OPT_CONFIRMAPPEND)
     {
       snprintf(tmp, sizeof(tmp), _("Append messages to %s?"), s);
       rc = mutt_yesorno(tmp, MUTT_YES);
@@ -1376,7 +1375,7 @@ int mutt_save_confirm(const char *s, struct stat *st)
     /* pathname does not exist */
     if (errno == ENOENT)
     {
-      if (option(OPT_CONFIRMCREATE))
+      if (OPT_CONFIRMCREATE)
       {
         snprintf(tmp, sizeof(tmp), _("Create %s?"), s);
         rc = mutt_yesorno(tmp, MUTT_YES);
diff --git a/mx.c b/mx.c
index 5eda153a1deb026fac26a6850079d24a954e0223..147c0c6c285de16ae2ad38fd88cc9056463806eb 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -287,7 +287,7 @@ int mx_get_magic(const char *path)
     }
     mutt_file_fclose(&f);
 
-    if (!option(OPT_CHECK_MBOX_SIZE))
+    if (!OPT_CHECK_MBOX_SIZE)
     {
       /* need to restore the times here, the file was not really accessed,
        * only the type was accessed.  This is important, because detection
@@ -475,7 +475,7 @@ struct Context *mx_open_mailbox(const char *path, int flags, struct Context *pct
    * mutt_refresh() will think we are in the middle of a macro.  so set a
    * flag to indicate that we should really refresh the screen.
    */
-  set_option(OPT_FORCE_REFRESH);
+  OPT_FORCE_REFRESH = true;
 
   if (!ctx->quiet)
     mutt_message(_("Reading %s..."), ctx->path);
@@ -488,8 +488,8 @@ struct Context *mx_open_mailbox(const char *path, int flags, struct Context *pct
     {
       /* avoid unnecessary work since the mailbox is completely unthreaded
          to begin with */
-      unset_option(OPT_SORT_SUBTHREADS);
-      unset_option(OPT_NEED_RESCORE);
+      OPT_SORT_SUBTHREADS = false;
+      OPT_NEED_RESCORE = false;
       mutt_sort_headers(ctx, 1);
     }
     if (!ctx->quiet)
@@ -504,7 +504,7 @@ struct Context *mx_open_mailbox(const char *path, int flags, struct Context *pct
       FREE(&ctx);
   }
 
-  unset_option(OPT_FORCE_REFRESH);
+  OPT_FORCE_REFRESH = false;
   return ctx;
 }
 
@@ -577,7 +577,7 @@ static int trash_append(struct Context *ctx)
   struct stat st, stc;
   int opt_confappend, rc;
 
-  if (!Trash || !ctx->deleted || (ctx->magic == MUTT_MAILDIR && option(OPT_MAILDIR_TRASH)))
+  if (!Trash || !ctx->deleted || (ctx->magic == MUTT_MAILDIR && OPT_MAILDIR_TRASH))
     return 0;
 
   for (i = 0; i < ctx->msgcount; i++)
@@ -587,12 +587,12 @@ static int trash_append(struct Context *ctx)
     return 0; /* nothing to be done */
 
   /* avoid the "append messages" prompt */
-  opt_confappend = option(OPT_CONFIRMAPPEND);
+  opt_confappend = OPT_CONFIRMAPPEND;
   if (opt_confappend)
-    unset_option(OPT_CONFIRMAPPEND);
+    OPT_CONFIRMAPPEND = false;
   rc = mutt_save_confirm(Trash, &st);
   if (opt_confappend)
-    set_option(OPT_CONFIRMAPPEND);
+    OPT_CONFIRMAPPEND = true;
   if (rc != 0)
   {
     mutt_error(_("message(s) not deleted"));
@@ -685,7 +685,7 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint)
   for (i = 0; i < ctx->msgcount; i++)
   {
     if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->read &&
-        !(ctx->hdrs[i]->flagged && option(OPT_KEEP_FLAGGED)))
+        !(ctx->hdrs[i]->flagged && OPT_KEEP_FLAGGED))
     {
       read_msgs++;
     }
@@ -697,7 +697,7 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint)
     read_msgs = 0;
 #endif
 
-  if (read_msgs && quadoption(OPT_MOVE) != MUTT_NO)
+  if (read_msgs && OPT_MOVE != MUTT_NO)
   {
     char *p = NULL;
 
@@ -730,7 +730,7 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint)
    * There is no point in asking whether or not to purge if we are
    * just marking messages as "trash".
    */
-  if (ctx->deleted && !(ctx->magic == MUTT_MAILDIR && option(OPT_MAILDIR_TRASH)))
+  if (ctx->deleted && !(ctx->magic == MUTT_MAILDIR && OPT_MAILDIR_TRASH))
   {
     snprintf(buf, sizeof(buf),
              ctx->deleted == 1 ? _("Purge %d deleted message?") :
@@ -744,7 +744,7 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint)
     }
   }
 
-  if (option(OPT_MARK_OLD))
+  if (OPT_MARK_OLD)
   {
     for (i = 0; i < ctx->msgcount; i++)
     {
@@ -768,7 +768,7 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint)
       for (i = 0; i < ctx->msgcount; i++)
       {
         if (ctx->hdrs[i]->read && !ctx->hdrs[i]->deleted &&
-            !(ctx->hdrs[i]->flagged && option(OPT_KEEP_FLAGGED)))
+            !(ctx->hdrs[i]->flagged && OPT_KEEP_FLAGGED))
         {
           ctx->hdrs[i]->tagged = true;
         }
@@ -800,7 +800,7 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint)
       for (i = 0; i < ctx->msgcount; i++)
       {
         if (ctx->hdrs[i]->read && !ctx->hdrs[i]->deleted &&
-            !(ctx->hdrs[i]->flagged && option(OPT_KEEP_FLAGGED)))
+            !(ctx->hdrs[i]->flagged && OPT_KEEP_FLAGGED))
         {
           if (mutt_append_message(&f, ctx, ctx->hdrs[i], 0, CH_UPDATE_LEN) == 0)
           {
@@ -884,7 +884,7 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint)
   }
 
   if (ctx->msgcount == ctx->deleted && (ctx->magic == MUTT_MMDF || ctx->magic == MUTT_MBOX) &&
-      !mutt_is_spool(ctx->path) && !option(OPT_SAVE_EMPTY))
+      !mutt_is_spool(ctx->path) && !OPT_SAVE_EMPTY)
   {
     mutt_file_unlink_empty(ctx->path);
   }
@@ -931,8 +931,7 @@ void mx_update_tables(struct Context *ctx, bool committing)
   for (i = 0, j = 0; i < ctx->msgcount; i++)
   {
     if (!ctx->hdrs[i]->quasi_deleted &&
-        ((committing && (!ctx->hdrs[i]->deleted ||
-                         (ctx->magic == MUTT_MAILDIR && option(OPT_MAILDIR_TRASH)))) ||
+        ((committing && (!ctx->hdrs[i]->deleted || (ctx->magic == MUTT_MAILDIR && OPT_MAILDIR_TRASH))) ||
          (!committing && ctx->hdrs[i]->active)))
     {
       if (i != j)
@@ -954,7 +953,7 @@ void mx_update_tables(struct Context *ctx, bool committing)
       else if (ctx->hdrs[j]->changed)
         ctx->changed = true;
 
-      if (!committing || (ctx->magic == MUTT_MAILDIR && option(OPT_MAILDIR_TRASH)))
+      if (!committing || (ctx->magic == MUTT_MAILDIR && OPT_MAILDIR_TRASH))
       {
         if (ctx->hdrs[j]->deleted)
           ctx->deleted++;
@@ -1099,7 +1098,7 @@ int mx_sync_mailbox(struct Context *ctx, int *index_hint)
     mutt_sleep(0);
 
     if (ctx->msgcount == ctx->deleted && (ctx->magic == MUTT_MBOX || ctx->magic == MUTT_MMDF) &&
-        !mutt_is_spool(ctx->path) && !option(OPT_SAVE_EMPTY))
+        !mutt_is_spool(ctx->path) && !OPT_SAVE_EMPTY)
     {
       unlink(ctx->path);
       mx_fastclose_mailbox(ctx);
@@ -1330,7 +1329,7 @@ void mx_update_context(struct Context *ctx, int new_messages)
       if (h2)
       {
         h2->superseded = true;
-        if (option(OPT_SCORE))
+        if (OPT_SCORE)
           mutt_score_message(ctx, h2, 1);
       }
     }
@@ -1342,7 +1341,7 @@ void mx_update_context(struct Context *ctx, int new_messages)
       mutt_hash_insert(ctx->subj_hash, h->env->real_subj, h);
     mutt_label_hash_add(ctx, h);
 
-    if (option(OPT_SCORE))
+    if (OPT_SCORE)
       mutt_score_message(ctx, h, 0);
 
     if (h->changed)
index 80439767766af0b48e12e14e301135f91466b06c..aec2dceb0ac535d55816bb3eb25c096851b5e815 100644 (file)
@@ -65,7 +65,7 @@ void crypt_current_time(struct State *s, char *app_name)
   if (!WithCrypto)
     return;
 
-  if (option(OPT_CRYPT_TIMESTAMP))
+  if (OPT_CRYPT_TIMESTAMP)
   {
     t = time(NULL);
     strftime(p, sizeof(p), _(" (current time: %c)"), localtime(&t));
@@ -202,7 +202,7 @@ int mutt_protect(struct Header *msg, char *keylist)
   if ((WithCrypto & APPLICATION_PGP))
     tmp_pgp_pbody = msg->content;
 
-  if (option(OPT_CRYPT_USE_PKA) && (msg->security & SIGN))
+  if (OPT_CRYPT_USE_PKA && (msg->security & SIGN))
   {
     /* Set sender (necessary for e.g. PKA).  */
     const char *mailbox = NULL;
@@ -235,7 +235,7 @@ int mutt_protect(struct Header *msg, char *keylist)
     }
 
     if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP) &&
-        (!(flags & ENCRYPT) || option(OPT_PGP_RETAINABLE_SIGS)))
+        (!(flags & ENCRYPT) || OPT_PGP_RETAINABLE_SIGS))
     {
       tmp_pbody = crypt_pgp_sign_message(msg->content);
       if (!tmp_pbody)
@@ -686,7 +686,7 @@ void convert_to_7bit(struct Body *a)
         a->encoding = ENC7BIT;
         convert_to_7bit(a->parts);
       }
-      else if ((WithCrypto & APPLICATION_PGP) && option(OPT_PGP_STRICT_ENC))
+      else if ((WithCrypto & APPLICATION_PGP) && OPT_PGP_STRICT_ENC)
         convert_to_7bit(a->parts);
     }
     else if (a->type == TYPEMESSAGE &&
@@ -700,7 +700,7 @@ void convert_to_7bit(struct Body *a)
     else if (a->encoding == ENCBINARY)
       a->encoding = ENCBASE64;
     else if (a->content && a->encoding != ENCBASE64 &&
-             (a->content->from || (a->content->space && option(OPT_PGP_STRICT_ENC))))
+             (a->content->from || (a->content->space && OPT_PGP_STRICT_ENC)))
     {
       a->encoding = ENCQUOTEDPRINTABLE;
     }
@@ -726,7 +726,7 @@ void crypt_extract_keys_from_messages(struct Header *h)
   }
 
   if ((WithCrypto & APPLICATION_PGP))
-    set_option(OPT_DONT_HANDLE_PGP_KEYS);
+    OPT_DONT_HANDLE_PGP_KEYS = true;
 
   if (!h)
   {
@@ -823,7 +823,7 @@ void crypt_extract_keys_from_messages(struct Header *h)
   mutt_file_unlink(tempfname);
 
   if ((WithCrypto & APPLICATION_PGP))
-    unset_option(OPT_DONT_HANDLE_PGP_KEYS);
+    OPT_DONT_HANDLE_PGP_KEYS = false;
 }
 
 /**
@@ -850,7 +850,7 @@ int crypt_get_keys(struct Header *msg, char **keylist, int oppenc_mode)
     return 0;
 
   if ((WithCrypto & APPLICATION_PGP))
-    set_option(OPT_PGP_CHECK_TRUST);
+    OPT_PGP_CHECK_TRUST = true;
 
   last = mutt_addr_append(&adrlist, msg->env->to, false);
   last = mutt_addr_append(last ? &last : &adrlist, msg->env->cc, false);
@@ -872,8 +872,8 @@ int crypt_get_keys(struct Header *msg, char **keylist, int oppenc_mode)
         mutt_addr_free(&adrlist);
         return -1;
       }
-      unset_option(OPT_PGP_CHECK_TRUST);
-      if (option(OPT_PGP_SELF_ENCRYPT) || (quadoption(OPT_PGP_ENCRYPT_SELF) == MUTT_YES))
+      OPT_PGP_CHECK_TRUST = false;
+      if (OPT_PGP_SELF_ENCRYPT || (OPT_PGP_ENCRYPT_SELF == MUTT_YES))
         self_encrypt = PgpSelfEncryptAs;
     }
     if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME))
@@ -884,7 +884,7 @@ int crypt_get_keys(struct Header *msg, char **keylist, int oppenc_mode)
         mutt_addr_free(&adrlist);
         return -1;
       }
-      if (option(OPT_SMIME_SELF_ENCRYPT) || (quadoption(OPT_SMIME_ENCRYPT_SELF) == MUTT_YES))
+      if (OPT_SMIME_SELF_ENCRYPT || (OPT_SMIME_ENCRYPT_SELF == MUTT_YES))
         self_encrypt = SmimeSelfEncryptAs;
     }
   }
@@ -914,7 +914,7 @@ void crypt_opportunistic_encrypt(struct Header *msg)
   if (!WithCrypto)
     return;
 
-  if (!(option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT) && (msg->security & OPPENCRYPT)))
+  if (!(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT && (msg->security & OPPENCRYPT)))
     return;
 
   crypt_get_keys(msg, &pgpkeylist, 1);
index 727c899812dfc472f8011f3b0b582130f8365a5a..829bc3770f785bf688cc324894c116351acf1187 100644 (file)
@@ -202,7 +202,7 @@ static const char *crypt_keyid(struct CryptKeyInfo *k)
   if (k->kobj && k->kobj->subkeys)
   {
     s = k->kobj->subkeys->keyid;
-    if ((!option(OPT_PGP_LONG_IDS)) && (strlen(s) == 16))
+    if ((!OPT_PGP_LONG_IDS) && (strlen(s) == 16))
       /* Return only the short keyID.  */
       s += 8;
   }
@@ -883,7 +883,7 @@ static char *encrypt_gpgme_object(gpgme_data_t plaintext, gpgme_key_t *rset,
       return NULL;
     }
 
-    if (option(OPT_CRYPT_USE_PKA))
+    if (OPT_CRYPT_USE_PKA)
     {
       err = set_pka_sig_notation(ctx);
       if (err)
@@ -1010,7 +1010,7 @@ static struct Body *sign_message(struct Body *a, int use_smime)
     return NULL;
   }
 
-  if (option(OPT_CRYPT_USE_PKA))
+  if (OPT_CRYPT_USE_PKA)
   {
     err = set_pka_sig_notation(ctx);
     if (err)
@@ -1343,7 +1343,7 @@ static int show_sig_summary(unsigned long sum, gpgme_ctx_t ctx, gpgme_key_t key,
     state_puts("\n", s);
   }
 
-  if (option(OPT_CRYPT_USE_PKA))
+  if (OPT_CRYPT_USE_PKA)
   {
     if (sig->pka_trust == 1 && sig->pka_address)
     {
@@ -4199,7 +4199,7 @@ static struct CryptKeyInfo *crypt_select_key(struct CryptKeyInfo *keys,
   key_table = NULL;
   for (k = keys; k; k = k->next)
   {
-    if (!option(OPT_PGP_SHOW_UNUSABLE) && (k->flags & KEYFLAG_CANTUSE))
+    if (!OPT_PGP_SHOW_UNUSABLE && (k->flags & KEYFLAG_CANTUSE))
     {
       unusable = true;
       continue;
@@ -4305,7 +4305,7 @@ static struct CryptKeyInfo *crypt_select_key(struct CryptKeyInfo *keys,
       case OP_GENERIC_SELECT_ENTRY:
         /* FIXME make error reporting more verbose - this should be
              easy because gpgme provides more information */
-        if (option(OPT_PGP_CHECK_TRUST))
+        if (OPT_PGP_CHECK_TRUST)
         {
           if (!crypt_key_is_valid(key_table[menu->current]))
           {
@@ -4315,9 +4315,8 @@ static struct CryptKeyInfo *crypt_select_key(struct CryptKeyInfo *keys,
           }
         }
 
-        if (option(OPT_PGP_CHECK_TRUST) &&
-            (!crypt_id_is_valid(key_table[menu->current]) ||
-             !crypt_id_is_strong(key_table[menu->current])))
+        if (OPT_PGP_CHECK_TRUST && (!crypt_id_is_valid(key_table[menu->current]) ||
+                                    !crypt_id_is_strong(key_table[menu->current])))
         {
           const char *warn_s = NULL;
           char buf2[LONG_STRING];
@@ -4670,7 +4669,7 @@ static char *find_keys(struct Address *adrlist, unsigned int app, int oppenc_mod
       {
         crypt_hook_val = crypt_hook->data;
         r = MUTT_YES;
-        if (!oppenc_mode && option(OPT_CRYPT_CONFIRMHOOK))
+        if (!oppenc_mode && OPT_CRYPT_CONFIRMHOOK)
         {
           snprintf(buf, sizeof(buf), _("Use keyID = \"%s\" for %s?"),
                    crypt_hook_val, p->mailbox);
@@ -4782,7 +4781,7 @@ struct Body *pgp_gpgme_make_key_attachment(char *tempf)
   char buf[LONG_STRING];
   struct stat sb;
 
-  unset_option(OPT_PGP_CHECK_TRUST);
+  OPT_PGP_CHECK_TRUST = false;
 
   key = crypt_ask_for_key(_("Please enter the key ID: "), NULL, 0, APPLICATION_PGP, NULL);
   if (!key)
@@ -4900,7 +4899,7 @@ static int gpgme_send_menu(struct Header *msg, int is_smime)
    * NOTE: "Signing" and "Clearing" only adjust the sign bit, so we have different
    *       letter choices for those.
    */
-  if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT) && (msg->security & OPPENCRYPT))
+  if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT && (msg->security & OPPENCRYPT))
   {
     if (is_smime)
     {
@@ -4925,7 +4924,7 @@ static int gpgme_send_menu(struct Header *msg, int is_smime)
    * Opportunistic encryption option is set, but is toggled off
    * for this message.
    */
-  else if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+  else if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
   {
     if (is_smime)
     {
index c22c9a1cf6a64ffdd1ed2d3c19c49cbb0c6cb79a..62a6d79c3364c407f4fa7c6ae0592c88a69d02a8 100644 (file)
@@ -71,7 +71,7 @@ void crypt_init(void)
 #ifdef CRYPT_BACKEND_CLASSIC_PGP
   if (
 #ifdef CRYPT_BACKEND_GPGME
-      (!option(OPT_CRYPT_USE_GPGME))
+      (!OPT_CRYPT_USE_GPGME)
 #else
       1
 #endif
@@ -82,7 +82,7 @@ void crypt_init(void)
 #ifdef CRYPT_BACKEND_CLASSIC_SMIME
   if (
 #ifdef CRYPT_BACKEND_GPGME
-      (!option(OPT_CRYPT_USE_GPGME))
+      (!OPT_CRYPT_USE_GPGME)
 #else
       1
 #endif
@@ -90,7 +90,7 @@ void crypt_init(void)
     crypto_module_register(&crypt_mod_smime_classic);
 #endif
 
-  if (option(OPT_CRYPT_USE_GPGME))
+  if (OPT_CRYPT_USE_GPGME)
   {
 #ifdef CRYPT_BACKEND_GPGME
     crypto_module_register(&crypt_mod_pgp_gpgme);
index a9bdc0dea2bd5666b53cf9e6669000de80267036..3696799f44c1bd839af88f1e44817cfa64ba83ff 100644 (file)
@@ -179,7 +179,7 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe
         else
           return NULL;
 
-        if (!(is_uid || is_fpr || (*is_subkey && option(OPT_PGP_IGNORE_SUBKEYS))))
+        if (!(is_uid || is_fpr || (*is_subkey && OPT_PGP_IGNORE_SUBKEYS)))
           memset(&tmp, 0, sizeof(tmp));
 
         break;
@@ -213,7 +213,7 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe
             break;
         }
 
-        if (!is_uid && !(*is_subkey && option(OPT_PGP_IGNORE_SUBKEYS)))
+        if (!is_uid && !(*is_subkey && OPT_PGP_IGNORE_SUBKEYS))
           tmp.flags |= flags;
 
         break;
@@ -222,8 +222,7 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe
       {
         mutt_debug(2, "key len: %s\n", p);
 
-        if (!(*is_subkey && option(OPT_PGP_IGNORE_SUBKEYS)) &&
-            mutt_str_atos(p, &tmp.keylen) < 0)
+        if (!(*is_subkey && OPT_PGP_IGNORE_SUBKEYS) && mutt_str_atos(p, &tmp.keylen) < 0)
         {
           goto bail;
         }
@@ -233,7 +232,7 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe
       {
         mutt_debug(2, "pubkey algorithm: %s\n", p);
 
-        if (!(*is_subkey && option(OPT_PGP_IGNORE_SUBKEYS)))
+        if (!(*is_subkey && OPT_PGP_IGNORE_SUBKEYS))
         {
           int x = 0;
           if (mutt_str_atoi(p, &x) < 0)
@@ -247,7 +246,7 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe
       {
         mutt_debug(2, "key id: %s\n", p);
 
-        if (!(*is_subkey && option(OPT_PGP_IGNORE_SUBKEYS)))
+        if (!(*is_subkey && OPT_PGP_IGNORE_SUBKEYS))
           mutt_str_replace(&tmp.keyid, p);
         break;
       }
@@ -311,7 +310,7 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe
         }
 
         /* ignore user IDs on subkeys */
-        if (!is_uid && (*is_subkey && option(OPT_PGP_IGNORE_SUBKEYS)))
+        if (!is_uid && (*is_subkey && OPT_PGP_IGNORE_SUBKEYS))
           break;
 
         mutt_debug(2, "user ID: %s\n", NONULL(p));
@@ -354,7 +353,7 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe
           }
         }
 
-        if (!is_uid && (!*is_subkey || !option(OPT_PGP_IGNORE_SUBKEYS) ||
+        if (!is_uid && (!*is_subkey || !OPT_PGP_IGNORE_SUBKEYS ||
                         !((flags & KEYFLAG_DISABLED) || (flags & KEYFLAG_REVOKED) ||
                           (flags & KEYFLAG_EXPIRED))))
           tmp.flags |= flags;
@@ -367,7 +366,7 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe
   }
 
   /* merge temp key back into real key */
-  if (!(is_uid || is_fpr || (*is_subkey && option(OPT_PGP_IGNORE_SUBKEYS))))
+  if (!(is_uid || is_fpr || (*is_subkey && OPT_PGP_IGNORE_SUBKEYS)))
     k = mutt_mem_malloc(sizeof(*k));
   memcpy(k, &tmp, sizeof(*k));
   /* fixup parentship of uids after merging the temp key into
index 8800db73902274bd566d24826ddc31927214a060..e0a3549ff1ab299eb69de9c4a227c759e5ab0634 100644 (file)
@@ -106,7 +106,7 @@ bool pgp_use_gpg_agent(void)
   char *tty = NULL;
 
   /* GnuPG 2.1 no longer exports GPG_AGENT_INFO */
-  if (!option(OPT_PGP_USE_GPG_AGENT))
+  if (!OPT_PGP_USE_GPG_AGENT)
     return false;
 
   tty = ttyname(0);
@@ -121,7 +121,7 @@ bool pgp_use_gpg_agent(void)
 
 static struct PgpKeyInfo *key_parent(struct PgpKeyInfo *k)
 {
-  if ((k->flags & KEYFLAG_SUBKEY) && k->parent && option(OPT_PGP_IGNORE_SUBKEYS))
+  if ((k->flags & KEYFLAG_SUBKEY) && k->parent && OPT_PGP_IGNORE_SUBKEYS)
     k = k->parent;
 
   return k;
@@ -143,7 +143,7 @@ char *pgp_short_keyid(struct PgpKeyInfo *k)
 
 char *pgp_this_keyid(struct PgpKeyInfo *k)
 {
-  if (option(OPT_PGP_LONG_IDS))
+  if (OPT_PGP_LONG_IDS)
     return k->keyid;
   else
     return (k->keyid + 8);
@@ -809,7 +809,7 @@ void pgp_extract_keys_from_attachment_list(FILE *fp, int tag, struct Body *top)
   }
 
   mutt_endwin(NULL);
-  set_option(OPT_DONT_HANDLE_PGP_KEYS);
+  OPT_DONT_HANDLE_PGP_KEYS = true;
 
   for (; top; top = top->next)
   {
@@ -820,7 +820,7 @@ void pgp_extract_keys_from_attachment_list(FILE *fp, int tag, struct Body *top)
       break;
   }
 
-  unset_option(OPT_DONT_HANDLE_PGP_KEYS);
+  OPT_DONT_HANDLE_PGP_KEYS = false;
 }
 
 static struct Body *pgp_decrypt_part(struct Body *a, struct State *s,
@@ -1180,7 +1180,7 @@ struct Body *pgp_sign_message(struct Body *a)
     fputs(buffer, stdout);
   }
 
-  if (mutt_wait_filter(thepid) && option(OPT_PGP_CHECK_EXIT))
+  if (mutt_wait_filter(thepid) && OPT_PGP_CHECK_EXIT)
     empty = true;
 
   mutt_file_fclose(&pgperr);
@@ -1268,7 +1268,7 @@ char *pgp_find_keys(struct Address *adrlist, int oppenc_mode)
       {
         keyID = crypt_hook->data;
         r = MUTT_YES;
-        if (!oppenc_mode && option(OPT_CRYPT_CONFIRMHOOK))
+        if (!oppenc_mode && OPT_CRYPT_CONFIRMHOOK)
         {
           snprintf(buf, sizeof(buf), _("Use keyID = \"%s\" for %s?"), keyID, p->mailbox);
           r = mutt_yesorno(buf, MUTT_YES);
@@ -1427,7 +1427,7 @@ struct Body *pgp_encrypt_message(struct Body *a, char *keylist, int sign)
   }
   mutt_file_fclose(&pgpin);
 
-  if (mutt_wait_filter(thepid) && option(OPT_PGP_CHECK_EXIT))
+  if (mutt_wait_filter(thepid) && OPT_PGP_CHECK_EXIT)
     empty = 1;
 
   unlink(pgpinfile);
@@ -1603,7 +1603,7 @@ struct Body *pgp_traditional_encryptsign(struct Body *a, int flags, char *keylis
     fprintf(pgpin, "%s\n", PgpPass);
   mutt_file_fclose(&pgpin);
 
-  if (mutt_wait_filter(thepid) && option(OPT_PGP_CHECK_EXIT))
+  if (mutt_wait_filter(thepid) && OPT_PGP_CHECK_EXIT)
     empty = true;
 
   mutt_file_unlink(pgpinfile);
@@ -1675,7 +1675,7 @@ int pgp_send_menu(struct Header *msg)
     return msg->security;
 
   /* If autoinline and no crypto options set, then set inline. */
-  if (option(OPT_PGP_AUTOINLINE) &&
+  if (OPT_PGP_AUTOINLINE &&
       !((msg->security & APPLICATION_PGP) && (msg->security & (SIGN | ENCRYPT))))
   {
     msg->security |= INLINE;
@@ -1702,7 +1702,7 @@ int pgp_send_menu(struct Header *msg)
    * NOTE: "Signing" and "Clearing" only adjust the sign bit, so we have different
    *       letter choices for those.
    */
-  if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT) && (msg->security & OPPENCRYPT))
+  if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT && (msg->security & OPPENCRYPT))
   {
     if (msg->security & (ENCRYPT | SIGN))
     {
@@ -1730,7 +1730,7 @@ int pgp_send_menu(struct Header *msg)
    * Opportunistic encryption option is set, but is toggled off
    * for this message.
    */
-  else if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+  else if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
   {
     /* When the message is not selected for signing or encryption, the toggle
     * between PGP/MIME and Traditional doesn't make sense.
@@ -1806,7 +1806,7 @@ int pgp_send_menu(struct Header *msg)
         break;
 
       case 'a': /* sign (a)s */
-        unset_option(OPT_PGP_CHECK_TRUST);
+        OPT_PGP_CHECK_TRUST = false;
 
         p = pgp_ask_for_key(_("Sign as: "), NULL, 0, PGP_SECRING);
         if (p)
index 00eab239c84a61cb464ce0722b512260368fa0f3..6ed2a25ad532275e4799396c58efe2eb801955df 100644 (file)
@@ -483,7 +483,7 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys,
 
   for (i = 0, kp = keys; kp; kp = kp->next)
   {
-    if (!option(OPT_PGP_SHOW_UNUSABLE) && (kp->flags & KEYFLAG_CANTUSE))
+    if (!OPT_PGP_SHOW_UNUSABLE && (kp->flags & KEYFLAG_CANTUSE))
     {
       unusable = true;
       continue;
@@ -491,7 +491,7 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys,
 
     for (a = kp->address; a; a = a->next)
     {
-      if (!option(OPT_PGP_SHOW_UNUSABLE) && (a->flags & KEYFLAG_CANTUSE))
+      if (!OPT_PGP_SHOW_UNUSABLE && (a->flags & KEYFLAG_CANTUSE))
       {
         unusable = true;
         continue;
@@ -616,15 +616,15 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys,
 
         /* XXX make error reporting more verbose */
 
-        if (option(OPT_PGP_CHECK_TRUST))
+        if (OPT_PGP_CHECK_TRUST)
           if (!pgp_key_is_valid(KeyTable[menu->current]->parent))
           {
             mutt_error(_("This key can't be used: expired/disabled/revoked."));
             break;
           }
 
-        if (option(OPT_PGP_CHECK_TRUST) && (!pgp_id_is_valid(KeyTable[menu->current]) ||
-                                            !pgp_id_is_strong(KeyTable[menu->current])))
+        if (OPT_PGP_CHECK_TRUST && (!pgp_id_is_valid(KeyTable[menu->current]) ||
+                                    !pgp_id_is_strong(KeyTable[menu->current])))
         {
           char *str = "";
           char buf2[LONG_STRING];
@@ -738,7 +738,7 @@ struct Body *pgp_make_key_attachment(char *tempf)
   struct stat sb;
   pid_t thepid;
   struct PgpKeyInfo *key = NULL;
-  unset_option(OPT_PGP_CHECK_TRUST);
+  OPT_PGP_CHECK_TRUST = false;
 
   key = pgp_ask_for_key(_("Please enter the key ID: "), NULL, 0, PGP_PUBRING);
 
index 866e7fb9837e8cb4766af2703065a1b362380077..8859fc30d152fa44e89288e9a73ca1a4c0b73445 100644 (file)
@@ -831,7 +831,7 @@ void smime_getkeys(struct Envelope *env)
   struct Address *t = NULL;
   bool found = false;
 
-  if (option(OPT_SMIME_DECRYPT_USE_DEFAULT_KEY) && SmimeDefaultKey && *SmimeDefaultKey)
+  if (OPT_SMIME_DECRYPT_USE_DEFAULT_KEY && SmimeDefaultKey && *SmimeDefaultKey)
   {
     snprintf(SmimeKeyToUse, sizeof(SmimeKeyToUse), "%s/%s", NONULL(SmimeKeys), SmimeDefaultKey);
 
@@ -1205,7 +1205,7 @@ void smime_invoke_import(char *infile, char *mailbox)
   mutt_file_unlink(tmpfname);
 
   buf[0] = '\0';
-  if (option(OPT_SMIME_ASK_CERT_LABEL))
+  if (OPT_SMIME_ASK_CERT_LABEL)
   {
     if ((mutt_get_field(_("Label for certificate: "), buf, sizeof(buf), 0) != 0) ||
         (buf[0] == 0))
@@ -2049,7 +2049,7 @@ int smime_send_menu(struct Header *msg)
    * NOTE: "Signing" and "Clearing" only adjust the sign bit, so we have different
    *       letter choices for those.
    */
-  if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT) && (msg->security & OPPENCRYPT))
+  if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT && (msg->security & OPPENCRYPT))
   {
     /* L10N: S/MIME options (opportunistic encryption is on) */
     prompt = _("S/MIME (s)ign, encrypt (w)ith, sign (a)s, (c)lear, or (o)ppenc "
@@ -2062,7 +2062,7 @@ int smime_send_menu(struct Header *msg)
    * Opportunistic encryption option is set, but is toggled off
    * for this message.
    */
-  else if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+  else if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
   {
     /* L10N: S/MIME options (opportunistic encryption is off) */
     prompt = _("S/MIME (e)ncrypt, (s)ign, encrypt (w)ith, sign (a)s, (b)oth, "
index f66ad3c5fb891c8556fd05668ffd186126baef0f..1c3822a8d14743e768e5c2382174e07eee2d24f1 100644 (file)
--- a/newsrc.c
+++ b/newsrc.c
@@ -681,7 +681,7 @@ header_cache_t *nntp_hcache_open(struct NntpData *nntp_data)
 
   if (!nntp_data->nserv || !nntp_data->nserv->cacheable ||
       !nntp_data->nserv->conn || !nntp_data->group ||
-      !(nntp_data->newsrc_ent || nntp_data->subscribed || option(OPT_SAVE_UNSUBSCRIBED)))
+      !(nntp_data->newsrc_ent || nntp_data->subscribed || OPT_SAVE_UNSUBSCRIBED))
     return NULL;
 
   mutt_account_tourl(&nntp_data->nserv->conn->account, &url);
@@ -848,7 +848,7 @@ void nntp_clear_cache(struct NntpServer *nserv)
         nntp_data->group = group;
         nntp_data->bcache = NULL;
       }
-      else if (nntp_data->newsrc_ent || nntp_data->subscribed || option(OPT_SAVE_UNSUBSCRIBED))
+      else if (nntp_data->newsrc_ent || nntp_data->subscribed || OPT_SAVE_UNSUBSCRIBED)
         continue;
 
       nntp_delete_group_cache(nntp_data);
@@ -1182,7 +1182,7 @@ void nntp_article_status(struct Context *ctx, struct Header *hdr, char *group, a
     return;
 
   /* article isn't read but cached, it's old */
-  if (option(OPT_MARK_OLD))
+  if (OPT_MARK_OLD)
     hdr->old = true;
 }
 
@@ -1223,7 +1223,7 @@ struct NntpData *mutt_newsgroup_unsubscribe(struct NntpServer *nserv, char *grou
     return NULL;
 
   nntp_data->subscribed = false;
-  if (!option(OPT_SAVE_UNSUBSCRIBED))
+  if (!OPT_SAVE_UNSUBSCRIBED)
   {
     nntp_data->newsrc_len = 0;
     FREE(&nntp_data->newsrc_ent);
diff --git a/nntp.c b/nntp.c
index 76e510c40fe2f14654cef3774863806615f6f381..7604479e5d7a05525c101bde99459d6bd2d2016a 100644 (file)
--- a/nntp.c
+++ b/nntp.c
@@ -674,11 +674,11 @@ int nntp_open_connection(struct NntpServer *nserv)
 
 #ifdef USE_SSL
   /* Attempt STARTTLS if available and desired. */
-  if (nserv->use_tls != 1 && (nserv->hasSTARTTLS || option(OPT_SSL_FORCE_TLS)))
+  if (nserv->use_tls != 1 && (nserv->hasSTARTTLS || OPT_SSL_FORCE_TLS))
   {
     if (nserv->use_tls == 0)
       nserv->use_tls =
-          option(OPT_SSL_FORCE_TLS) ||
+          OPT_SSL_FORCE_TLS ||
                   query_quadoption(OPT_SSL_STARTTLS,
                                    _("Secure connection with TLS?")) == MUTT_YES ?
               2 :
@@ -1250,7 +1250,7 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first,
 #endif
 
   /* fetch list of articles */
-  if (option(OPT_NNTP_LISTGROUP) && nntp_data->nserv->hasLISTGROUP && !nntp_data->deleted)
+  if (OPT_NNTP_LISTGROUP && nntp_data->nserv->hasLISTGROUP && !nntp_data->deleted)
   {
     if (!ctx->quiet)
       mutt_message(_("Fetching list of articles..."));
@@ -1347,7 +1347,7 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first,
 
     /* fallback to fetch overview */
     else if (nntp_data->nserv->hasOVER || nntp_data->nserv->hasXOVER)
-      if (option(OPT_NNTP_LISTGROUP) && nntp_data->nserv->hasLISTGROUP)
+      if (OPT_NNTP_LISTGROUP && nntp_data->nserv->hasLISTGROUP)
         break;
       else
         continue;
@@ -1425,7 +1425,7 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first,
     first_over = current + 1;
   }
 
-  if (!option(OPT_NNTP_LISTGROUP) || !nntp_data->nserv->hasLISTGROUP)
+  if (!OPT_NNTP_LISTGROUP || !nntp_data->nserv->hasLISTGROUP)
     current = first_over;
 
   /* fetch overview information */
@@ -1496,7 +1496,7 @@ static int nntp_open_mailbox(struct Context *ctx)
   }
 
   mutt_bit_unset(ctx->rights, MUTT_ACL_INSERT);
-  if (!nntp_data->newsrc_ent && !nntp_data->subscribed && !option(OPT_SAVE_UNSUBSCRIBED))
+  if (!nntp_data->newsrc_ent && !nntp_data->subscribed && !OPT_SAVE_UNSUBSCRIBED)
     ctx->readonly = true;
 
   /* select newsgroup */
@@ -1517,7 +1517,7 @@ static int nntp_open_mailbox(struct Context *ctx)
       nntp_data->deleted = true;
       nntp_active_save_cache(nserv);
     }
-    if (nntp_data->newsrc_ent && !nntp_data->subscribed && !option(OPT_SAVE_UNSUBSCRIBED))
+    if (nntp_data->newsrc_ent && !nntp_data->subscribed && !OPT_SAVE_UNSUBSCRIBED)
     {
       FREE(&nntp_data->newsrc_ent);
       nntp_data->newsrc_len = 0;
@@ -1542,7 +1542,7 @@ static int nntp_open_mailbox(struct Context *ctx)
     nntp_data->deleted = false;
 
     /* get description if empty */
-    if (option(OPT_NNTP_LOAD_DESCRIPTION) && !nntp_data->desc)
+    if (OPT_NNTP_LOAD_DESCRIPTION && !nntp_data->desc)
     {
       if (get_description(nntp_data, NULL, NULL) < 0)
       {
@@ -1556,8 +1556,8 @@ static int nntp_open_mailbox(struct Context *ctx)
 
   time(&nserv->check_time);
   ctx->data = nntp_data;
-  if (!nntp_data->bcache && (nntp_data->newsrc_ent || nntp_data->subscribed ||
-                             option(OPT_SAVE_UNSUBSCRIBED)))
+  if (!nntp_data->bcache &&
+      (nntp_data->newsrc_ent || nntp_data->subscribed || OPT_SAVE_UNSUBSCRIBED))
     nntp_data->bcache = mutt_bcache_open(&nserv->conn->account, nntp_data->group);
 
   /* strip off extra articles if adding context is greater than $nntp_context */
@@ -2250,7 +2250,7 @@ int nntp_active_fetch(struct NntpServer *nserv, bool new)
     }
   }
 
-  if (option(OPT_NNTP_LOAD_DESCRIPTION))
+  if (OPT_NNTP_LOAD_DESCRIPTION)
     rc = get_description(&nntp_data, "*", _("Loading descriptions..."));
 
   nntp_active_save_cache(nserv);
@@ -2280,7 +2280,7 @@ int nntp_check_new_groups(struct NntpServer *nserv)
     return -1;
 
   /* check subscribed newsgroups for new articles */
-  if (option(OPT_SHOW_NEW_NEWS))
+  if (OPT_SHOW_NEW_NEWS)
   {
     mutt_message(_("Checking for new messages..."));
     for (i = 0; i < nserv->groups_num; i++)
@@ -2346,7 +2346,7 @@ int nntp_check_new_groups(struct NntpServer *nserv)
     }
 
     /* loading descriptions */
-    if (option(OPT_NNTP_LOAD_DESCRIPTION))
+    if (OPT_NNTP_LOAD_DESCRIPTION)
     {
       unsigned int count = 0;
       struct Progress progress;
index 74cb3c741b73e794e16832641c0624e8cfbd69fd..7c6a4f01ce3874d108236e90d80e8e79e3858394 100644 (file)
--- a/options.h
+++ b/options.h
 #ifndef _MUTT_OPTIONS_H_
 #define _MUTT_OPTIONS_H_
 
-/**
- * enum GlobalBool - boolean vars
- */
-enum GlobalBool
-{
-  OPT_ALLOW_8BIT,
-  OPT_ALLOW_ANSI,
-  OPT_ARROW_CURSOR,
-  OPT_ASCII_CHARS,
-  OPT_ASKBCC,
-  OPT_ASKCC,
-  OPT_ASK_FOLLOW_UP,
-  OPT_ASK_X_COMMENT_TO,
-  OPT_ATTACH_SPLIT,
-  OPT_AUTOEDIT,
-  OPT_AUTO_TAG,
-  OPT_BEEP,
-  OPT_BEEP_NEW,
-  OPT_BOUNCE_DELIVERED,
-  OPT_BRAILLE_FRIENDLY,
-  OPT_CHANGE_FOLDER_NEXT,
-  OPT_CHECK_MBOX_SIZE,
-  OPT_CHECK_NEW,
-  OPT_COLLAPSE_ALL,
-  OPT_COLLAPSE_UNREAD,
-  OPT_COLLAPSE_FLAGGED,
-  OPT_CONFIRMAPPEND,
-  OPT_CONFIRMCREATE,
-  OPT_DELETE_UNTAG,
-  OPT_DIGEST_COLLAPSE,
-  OPT_DUPLICATE_THREADS,
-  OPT_EDIT_HEADERS,
-  OPT_ENCODE_FROM,
-  OPT_USE_ENVELOPE_FROM,
-  OPT_FAST_REPLY,
-  OPT_FCC_CLEAR,
-  OPT_FLAG_SAFE,
-  OPT_FOLLOWUP_TO,
-  OPT_FORCE_NAME,
-  OPT_FORWARD_DECODE,
-  OPT_FORWARD_QUOTE,
-  OPT_FORWARD_REFERENCES,
+#include <stdbool.h>
+#include "where.h"
+
+WHERE bool OPT_ALLOW_8BIT;
+WHERE bool OPT_ALLOW_ANSI;
+WHERE bool OPT_ARROW_CURSOR;
+WHERE bool OPT_ASCII_CHARS;
+WHERE bool OPT_ASKBCC;
+WHERE bool OPT_ASKCC;
+WHERE bool OPT_ASK_FOLLOW_UP;
+WHERE bool OPT_ASK_X_COMMENT_TO;
+WHERE bool OPT_ATTACH_SPLIT;
+WHERE bool OPT_AUTOEDIT;
+WHERE bool OPT_AUTO_TAG;
+WHERE bool OPT_BEEP;
+WHERE bool OPT_BEEP_NEW;
+WHERE bool OPT_BOUNCE_DELIVERED;
+WHERE bool OPT_BRAILLE_FRIENDLY;
+WHERE bool OPT_CHANGE_FOLDER_NEXT;
+WHERE bool OPT_CHECK_MBOX_SIZE;
+WHERE bool OPT_CHECK_NEW;
+WHERE bool OPT_COLLAPSE_ALL;
+WHERE bool OPT_COLLAPSE_UNREAD;
+WHERE bool OPT_COLLAPSE_FLAGGED;
+WHERE bool OPT_CONFIRMAPPEND;
+WHERE bool OPT_CONFIRMCREATE;
+WHERE bool OPT_DELETE_UNTAG;
+WHERE bool OPT_DIGEST_COLLAPSE;
+WHERE bool OPT_DUPLICATE_THREADS;
+WHERE bool OPT_EDIT_HEADERS;
+WHERE bool OPT_ENCODE_FROM;
+WHERE bool OPT_USE_ENVELOPE_FROM;
+WHERE bool OPT_FAST_REPLY;
+WHERE bool OPT_FCC_CLEAR;
+WHERE bool OPT_FLAG_SAFE;
+WHERE bool OPT_FOLLOWUP_TO;
+WHERE bool OPT_FORCE_NAME;
+WHERE bool OPT_FORWARD_DECODE;
+WHERE bool OPT_FORWARD_QUOTE;
+WHERE bool OPT_FORWARD_REFERENCES;
 #ifdef USE_HCACHE
-  OPT_MAILDIR_HEADER_CACHE_VERIFY,
+WHERE bool OPT_MAILDIR_HEADER_CACHE_VERIFY;
 #if defined(HAVE_QDBM) || defined(HAVE_TC) || defined(HAVE_KC)
-  OPT_HEADER_CACHE_COMPRESS,
+WHERE bool OPT_HEADER_CACHE_COMPRESS;
 #endif /* HAVE_QDBM */
 #endif
-  OPT_HDRS,
-  OPT_HEADER,
-  OPT_HEADER_COLOR_PARTIAL,
-  OPT_HELP,
-  OPT_HIDDEN_HOST,
-  OPT_HIDE_LIMITED,
-  OPT_HIDE_MISSING,
-  OPT_HIDE_THREAD_SUBJECT,
-  OPT_HIDE_TOP_LIMITED,
-  OPT_HIDE_TOP_MISSING,
-  OPT_HISTORY_REMOVE_DUPS,
-  OPT_HONOR_DISPOSITION,
-  OPT_IGNORE_LINEAR_WHITE_SPACE,
-  OPT_IGNORE_LIST_REPLY_TO,
+WHERE bool OPT_HDRS;
+WHERE bool OPT_HEADER;
+WHERE bool OPT_HEADER_COLOR_PARTIAL;
+WHERE bool OPT_HELP;
+WHERE bool OPT_HIDDEN_HOST;
+WHERE bool OPT_HIDE_LIMITED;
+WHERE bool OPT_HIDE_MISSING;
+WHERE bool OPT_HIDE_THREAD_SUBJECT;
+WHERE bool OPT_HIDE_TOP_LIMITED;
+WHERE bool OPT_HIDE_TOP_MISSING;
+WHERE bool OPT_HISTORY_REMOVE_DUPS;
+WHERE bool OPT_HONOR_DISPOSITION;
+WHERE bool OPT_IGNORE_LINEAR_WHITE_SPACE;
+WHERE bool OPT_IGNORE_LIST_REPLY_TO;
 #ifdef USE_IMAP
-  OPT_IMAP_CHECK_SUBSCRIBED,
-  OPT_IMAP_IDLE,
-  OPT_IMAP_LIST_SUBSCRIBED,
-  OPT_IMAP_PASSIVE,
-  OPT_IMAP_PEEK,
-  OPT_IMAP_SERVERNOISE,
+WHERE bool OPT_IMAP_CHECK_SUBSCRIBED;
+WHERE bool OPT_IMAP_IDLE;
+WHERE bool OPT_IMAP_LIST_SUBSCRIBED;
+WHERE bool OPT_IMAP_PASSIVE;
+WHERE bool OPT_IMAP_PEEK;
+WHERE bool OPT_IMAP_SERVERNOISE;
 #endif
 #ifdef USE_SSL
 #ifndef USE_SSL_GNUTLS
-  OPT_SSL_USESYSTEMCERTS,
-  OPT_SSL_USE_SSLV2,
+WHERE bool OPT_SSL_USESYSTEMCERTS;
+WHERE bool OPT_SSL_USE_SSLV2;
 #endif /* USE_SSL_GNUTLS */
-  OPT_SSL_USE_SSLV3,
-  OPT_SSL_USE_TLSV1,
-  OPT_SSL_USE_TLSV1_1,
-  OPT_SSL_USE_TLSV1_2,
-  OPT_SSL_FORCE_TLS,
-  OPT_SSL_VERIFY_DATES,
-  OPT_SSL_VERIFY_HOST,
+WHERE bool OPT_SSL_USE_SSLV3;
+WHERE bool OPT_SSL_USE_TLSV1;
+WHERE bool OPT_SSL_USE_TLSV1_1;
+WHERE bool OPT_SSL_USE_TLSV1_2;
+WHERE bool OPT_SSL_FORCE_TLS;
+WHERE bool OPT_SSL_VERIFY_DATES;
+WHERE bool OPT_SSL_VERIFY_HOST;
 #if defined(USE_SSL_OPENSSL) && defined(HAVE_SSL_PARTIAL_CHAIN)
-  OPT_SSL_VERIFY_PARTIAL_CHAINS,
+WHERE bool OPT_SSL_VERIFY_PARTIAL_CHAINS;
 #endif /* USE_SSL_OPENSSL */
 #endif /* defined(USE_SSL) */
-  OPT_IMPLICIT_AUTOVIEW,
-  OPT_INCLUDE_ONLYFIRST,
-  OPT_KEEP_FLAGGED,
-  OPT_MAILCAP_SANITIZE,
-  OPT_MAIL_CHECK_RECENT,
-  OPT_MAIL_CHECK_STATS,
-  OPT_MAILDIR_TRASH,
-  OPT_MAILDIR_CHECK_CUR,
-  OPT_MARKERS,
-  OPT_MARK_OLD,
-  OPT_MENU_SCROLL,  /**< scroll menu instead of implicit next-page */
-  OPT_MENU_MOVE_OFF, /**< allow menu to scroll past last entry */
+WHERE bool OPT_IMPLICIT_AUTOVIEW;
+WHERE bool OPT_INCLUDE_ONLYFIRST;
+WHERE bool OPT_KEEP_FLAGGED;
+WHERE bool OPT_MAILCAP_SANITIZE;
+WHERE bool OPT_MAIL_CHECK_RECENT;
+WHERE bool OPT_MAIL_CHECK_STATS;
+WHERE bool OPT_MAILDIR_TRASH;
+WHERE bool OPT_MAILDIR_CHECK_CUR;
+WHERE bool OPT_MARKERS;
+WHERE bool OPT_MARK_OLD;
+WHERE bool OPT_MENU_SCROLL;  /**< scroll menu instead of implicit next-page */
+WHERE bool OPT_MENU_MOVE_OFF; /**< allow menu to scroll past last entry */
 #if defined(USE_IMAP) || defined(USE_POP)
-  OPT_MESSAGE_CACHE_CLEAN,
+WHERE bool OPT_MESSAGE_CACHE_CLEAN;
 #endif
-  OPT_META_KEY, /**< interpret ALT-x as ESC-x */
-  OPT_METOO,
-  OPT_MH_PURGE,
-  OPT_MIME_FORWARD_DECODE,
-  OPT_MIME_TYPE_QUERY_FIRST,
+WHERE bool OPT_META_KEY; /**< interpret ALT-x as ESC-x */
+WHERE bool OPT_METOO;
+WHERE bool OPT_MH_PURGE;
+WHERE bool OPT_MIME_FORWARD_DECODE;
+WHERE bool OPT_MIME_TYPE_QUERY_FIRST;
 #ifdef USE_NNTP
-  OPT_MIME_SUBJECT, /**< encode subject line with RFC2047 */
+WHERE bool OPT_MIME_SUBJECT; /**< encode subject line with RFC2047 */
 #endif
-  OPT_NARROW_TREE,
-  OPT_PAGER_STOP,
-  OPT_PIPE_DECODE,
-  OPT_PIPE_SPLIT,
+WHERE bool OPT_NARROW_TREE;
+WHERE bool OPT_PAGER_STOP;
+WHERE bool OPT_PIPE_DECODE;
+WHERE bool OPT_PIPE_SPLIT;
 #ifdef USE_POP
-  OPT_POP_AUTH_TRY_ALL,
-  OPT_POP_LAST,
+WHERE bool OPT_POP_AUTH_TRY_ALL;
+WHERE bool OPT_POP_LAST;
 #endif
-  OPT_POSTPONE_ENCRYPT,
-  OPT_PRINT_DECODE,
-  OPT_PRINT_SPLIT,
-  OPT_PROMPT_AFTER,
-  OPT_READ_ONLY,
-  OPT_REFLOW_SPACE_QUOTES,
-  OPT_REFLOW_TEXT,
-  OPT_REPLY_SELF,
-  OPT_REPLY_WITH_XORIG,
-  OPT_RESOLVE,
-  OPT_RESUME_DRAFT_FILES,
-  OPT_RESUME_EDITED_DRAFT_FILES,
-  OPT_REVERSE_ALIAS,
-  OPT_REVERSE_NAME,
-  OPT_REVERSE_REALNAME,
-  OPT_RFC2047_PARAMETERS,
-  OPT_SAVE_ADDRESS,
-  OPT_SAVE_EMPTY,
-  OPT_SAVE_NAME,
-  OPT_SCORE,
+WHERE bool OPT_POSTPONE_ENCRYPT;
+WHERE bool OPT_PRINT_DECODE;
+WHERE bool OPT_PRINT_SPLIT;
+WHERE bool OPT_PROMPT_AFTER;
+WHERE bool OPT_READ_ONLY;
+WHERE bool OPT_REFLOW_SPACE_QUOTES;
+WHERE bool OPT_REFLOW_TEXT;
+WHERE bool OPT_REPLY_SELF;
+WHERE bool OPT_REPLY_WITH_XORIG;
+WHERE bool OPT_RESOLVE;
+WHERE bool OPT_RESUME_DRAFT_FILES;
+WHERE bool OPT_RESUME_EDITED_DRAFT_FILES;
+WHERE bool OPT_REVERSE_ALIAS;
+WHERE bool OPT_REVERSE_NAME;
+WHERE bool OPT_REVERSE_REALNAME;
+WHERE bool OPT_RFC2047_PARAMETERS;
+WHERE bool OPT_SAVE_ADDRESS;
+WHERE bool OPT_SAVE_EMPTY;
+WHERE bool OPT_SAVE_NAME;
+WHERE bool OPT_SCORE;
 #ifdef USE_SIDEBAR
-  OPT_SIDEBAR_VISIBLE,
-  OPT_SIDEBAR_FOLDER_INDENT,
-  OPT_SIDEBAR_NEW_MAIL_ONLY,
-  OPT_SIDEBAR_NEXT_NEW_WRAP,
-  OPT_SIDEBAR_SHORT_PATH,
-  OPT_SIDEBAR_ON_RIGHT,
+WHERE bool OPT_SIDEBAR_VISIBLE;
+WHERE bool OPT_SIDEBAR_FOLDER_INDENT;
+WHERE bool OPT_SIDEBAR_NEW_MAIL_ONLY;
+WHERE bool OPT_SIDEBAR_NEXT_NEW_WRAP;
+WHERE bool OPT_SIDEBAR_SHORT_PATH;
+WHERE bool OPT_SIDEBAR_ON_RIGHT;
 #endif
-  OPT_SIG_DASHES,
-  OPT_SIG_ON_TOP,
-  OPT_SORT_RE,
-  OPT_STATUS_ON_TOP,
-  OPT_STRICT_THREADS,
-  OPT_SUSPEND,
-  OPT_TEXT_FLOWED,
-  OPT_THOROUGH_SEARCH,
-  OPT_THREAD_RECEIVED,
-  OPT_TILDE,
-  OPT_TS_ENABLED,
-  OPT_UNCOLLAPSE_JUMP,
-  OPT_UNCOLLAPSE_NEW,
-  OPT_USE_8BITMIME,
-  OPT_USE_DOMAIN,
-  OPT_USE_FROM,
-  OPT_PGP_USE_GPG_AGENT,
+WHERE bool OPT_SIG_DASHES;
+WHERE bool OPT_SIG_ON_TOP;
+WHERE bool OPT_SORT_RE;
+WHERE bool OPT_STATUS_ON_TOP;
+WHERE bool OPT_STRICT_THREADS;
+WHERE bool OPT_SUSPEND;
+WHERE bool OPT_TEXT_FLOWED;
+WHERE bool OPT_THOROUGH_SEARCH;
+WHERE bool OPT_THREAD_RECEIVED;
+WHERE bool OPT_TILDE;
+WHERE bool OPT_TS_ENABLED;
+WHERE bool OPT_UNCOLLAPSE_JUMP;
+WHERE bool OPT_UNCOLLAPSE_NEW;
+WHERE bool OPT_USE_8BITMIME;
+WHERE bool OPT_USE_DOMAIN;
+WHERE bool OPT_USE_FROM;
+WHERE bool OPT_PGP_USE_GPG_AGENT;
 #ifdef HAVE_LIBIDN
-  OPT_IDN_DECODE,
-  OPT_IDN_ENCODE,
+WHERE bool OPT_IDN_DECODE;
+WHERE bool OPT_IDN_ENCODE;
 #endif
 #ifdef HAVE_GETADDRINFO
-  OPT_USE_IPV6,
+WHERE bool OPT_USE_IPV6;
 #endif
-  OPT_WAIT_KEY,
-  OPT_WEED,
-  OPT_SMART_WRAP,
-  OPT_WRAP_SEARCH,
-  OPT_WRITE_BCC, /**< write out a bcc header? */
-  OPT_USER_AGENT,
+WHERE bool OPT_WAIT_KEY;
+WHERE bool OPT_WEED;
+WHERE bool OPT_SMART_WRAP;
+WHERE bool OPT_WRAP_SEARCH;
+WHERE bool OPT_WRITE_BCC; /**< write out a bcc header? */
+WHERE bool OPT_USER_AGENT;
 
-  OPT_CRYPT_USE_GPGME,
-  OPT_CRYPT_USE_PKA,
+WHERE bool OPT_CRYPT_USE_GPGME;
+WHERE bool OPT_CRYPT_USE_PKA;
 
-  /* PGP options */
+/* PGP options */
 
-  OPT_CRYPT_AUTOSIGN,
-  OPT_CRYPT_AUTOENCRYPT,
-  OPT_CRYPT_AUTOPGP,
-  OPT_CRYPT_AUTOSMIME,
-  OPT_CRYPT_CONFIRMHOOK,
-  OPT_CRYPT_OPPORTUNISTIC_ENCRYPT,
-  OPT_CRYPT_REPLYENCRYPT,
-  OPT_CRYPT_REPLYSIGN,
-  OPT_CRYPT_REPLYSIGNENCRYPTED,
-  OPT_CRYPT_TIMESTAMP,
-  OPT_SMIME_IS_DEFAULT,
-  OPT_SMIME_SELF_ENCRYPT,
-  OPT_SMIME_ASK_CERT_LABEL,
-  OPT_SMIME_DECRYPT_USE_DEFAULT_KEY,
-  OPT_PGP_IGNORE_SUBKEYS,
-  OPT_PGP_CHECK_EXIT,
-  OPT_PGP_LONG_IDS,
-  OPT_PGP_AUTO_DECODE,
-  OPT_PGP_RETAINABLE_SIGS,
-  OPT_PGP_SELF_ENCRYPT,
-  OPT_PGP_STRICT_ENC,
-  OPT_FORWARD_DECRYPT,
-  OPT_PGP_SHOW_UNUSABLE,
-  OPT_PGP_AUTOINLINE,
-  OPT_PGP_REPLYINLINE,
+WHERE bool OPT_CRYPT_AUTOSIGN;
+WHERE bool OPT_CRYPT_AUTOENCRYPT;
+WHERE bool OPT_CRYPT_AUTOPGP;
+WHERE bool OPT_CRYPT_AUTOSMIME;
+WHERE bool OPT_CRYPT_CONFIRMHOOK;
+WHERE bool OPT_CRYPT_OPPORTUNISTIC_ENCRYPT;
+WHERE bool OPT_CRYPT_REPLYENCRYPT;
+WHERE bool OPT_CRYPT_REPLYSIGN;
+WHERE bool OPT_CRYPT_REPLYSIGNENCRYPTED;
+WHERE bool OPT_CRYPT_TIMESTAMP;
+WHERE bool OPT_SMIME_IS_DEFAULT;
+WHERE bool OPT_SMIME_SELF_ENCRYPT;
+WHERE bool OPT_SMIME_ASK_CERT_LABEL;
+WHERE bool OPT_SMIME_DECRYPT_USE_DEFAULT_KEY;
+WHERE bool OPT_PGP_IGNORE_SUBKEYS;
+WHERE bool OPT_PGP_CHECK_EXIT;
+WHERE bool OPT_PGP_LONG_IDS;
+WHERE bool OPT_PGP_AUTO_DECODE;
+WHERE bool OPT_PGP_RETAINABLE_SIGS;
+WHERE bool OPT_PGP_SELF_ENCRYPT;
+WHERE bool OPT_PGP_STRICT_ENC;
+WHERE bool OPT_FORWARD_DECRYPT;
+WHERE bool OPT_PGP_SHOW_UNUSABLE;
+WHERE bool OPT_PGP_AUTOINLINE;
+WHERE bool OPT_PGP_REPLYINLINE;
 
 /* news options */
 
 #ifdef USE_NNTP
-  OPT_SHOW_NEW_NEWS,
-  OPT_SHOW_ONLY_UNREAD,
-  OPT_SAVE_UNSUBSCRIBED,
-  OPT_NNTP_LISTGROUP,
-  OPT_NNTP_LOAD_DESCRIPTION,
-  OPT_X_COMMENT_TO,
+WHERE bool OPT_SHOW_NEW_NEWS;
+WHERE bool OPT_SHOW_ONLY_UNREAD;
+WHERE bool OPT_SAVE_UNSUBSCRIBED;
+WHERE bool OPT_NNTP_LISTGROUP;
+WHERE bool OPT_NNTP_LOAD_DESCRIPTION;
+WHERE bool OPT_X_COMMENT_TO;
 #endif
 
-  /* pseudo options */
+/* pseudo options */
 
-  OPT_AUX_SORT,           /**< (pseudo) using auxiliary sort function */
-  OPT_FORCE_REFRESH,      /**< (pseudo) refresh even during macros */
-  OPT_NO_CURSES,          /**< (pseudo) when sending in batch mode */
-  OPT_SEARCH_REVERSE,     /**< (pseudo) used by ci_search_command */
-  OPT_MSG_ERR,            /**< (pseudo) used by mutt_error/mutt_message */
-  OPT_SEARCH_INVALID,     /**< (pseudo) used to invalidate the search pat */
-  OPT_NEED_RESORT,        /**< (pseudo) used to force a re-sort */
-  OPT_RESORT_INIT,        /**< (pseudo) used to force the next resort to be from scratch */
-  OPT_VIEW_ATTACH,        /**< (pseudo) signals that we are viewing attachments */
-  OPT_SORT_SUBTHREADS,    /**< (pseudo) used when $sort_aux changes */
-  OPT_NEED_RESCORE,       /**< (pseudo) set when the `score' command is used */
-  OPT_ATTACH_MSG,         /**< (pseudo) used by attach-message */
-  OPT_HIDE_READ,          /**< (pseudo) whether or not hide read messages */
-  OPT_KEEP_QUIET,         /**< (pseudo) shut up the message and refresh
-                         *            functions while we are executing an
-                         *            external program.  */
-  OPT_MENU_CALLER,        /**< (pseudo) tell menu to give caller a take */
-  OPT_REDRAW_TREE,        /**< (pseudo) redraw the thread tree */
-  OPT_PGP_CHECK_TRUST,     /**< (pseudo) used by pgp_select_key () */
-  OPT_DONT_HANDLE_PGP_KEYS, /**< (pseudo) used to extract PGP keys */
-  OPT_IGNORE_MACRO_EVENTS, /**< (pseudo) don't process macro/push/exec events while set */
+WHERE bool OPT_AUX_SORT;           /**< (pseudo) using auxiliary sort function */
+WHERE bool OPT_FORCE_REFRESH;      /**< (pseudo) refresh even during macros */
+WHERE bool OPT_NO_CURSES;          /**< (pseudo) when sending in batch mode */
+WHERE bool OPT_SEARCH_REVERSE;     /**< (pseudo) used by ci_search_command */
+WHERE bool OPT_MSG_ERR;            /**< (pseudo) used by mutt_error/mutt_message */
+WHERE bool OPT_SEARCH_INVALID;     /**< (pseudo) used to invalidate the search pat */
+WHERE bool OPT_NEED_RESORT;        /**< (pseudo) used to force a re-sort */
+WHERE bool OPT_RESORT_INIT;        /**< (pseudo) used to force the next resort to be from scratch */
+WHERE bool OPT_VIEW_ATTACH;        /**< (pseudo) signals that we are viewing attachments */
+WHERE bool OPT_SORT_SUBTHREADS;    /**< (pseudo) used when $sort_aux changes */
+WHERE bool OPT_NEED_RESCORE;       /**< (pseudo) set when the `score' command is used */
+WHERE bool OPT_ATTACH_MSG;         /**< (pseudo) used by attach-message */
+WHERE bool OPT_HIDE_READ;          /**< (pseudo) whether or not hide read messages */
+WHERE bool OPT_KEEP_QUIET;         /**< (pseudo) shut up the message and refresh functions while we are executing an external program.  */
+WHERE bool OPT_MENU_CALLER;        /**< (pseudo) tell menu to give caller a take */
+WHERE bool OPT_REDRAW_TREE;        /**< (pseudo) redraw the thread tree */
+WHERE bool OPT_PGP_CHECK_TRUST;     /**< (pseudo) used by pgp_select_key () */
+WHERE bool OPT_DONT_HANDLE_PGP_KEYS; /**< (pseudo) used to extract PGP keys */
+WHERE bool OPT_IGNORE_MACRO_EVENTS; /**< (pseudo) don't process macro/push/exec events while set */
 
 #ifdef USE_NNTP
-  OPT_NEWS,              /**< (pseudo) used to change reader mode */
-  OPT_NEWS_SEND,          /**< (pseudo) used to change behavior when posting */
+WHERE bool OPT_NEWS;              /**< (pseudo) used to change reader mode */
+WHERE bool OPT_NEWS_SEND;          /**< (pseudo) used to change behavior when posting */
 #endif
 #ifdef USE_NOTMUCH
-  OPT_VIRTUAL_SPOOLFILE,
-  OPT_NM_RECORD,
+WHERE bool OPT_VIRTUAL_SPOOLFILE;
+WHERE bool OPT_NM_RECORD;
 #endif
 
-  OPT_GLOBAL_MAX
-};
 
 #define mutt_bit_set(v, n)    v[n / 8] |= (1 << (n % 8))
 #define mutt_bit_unset(v, n)  v[n / 8] &= ~(1 << (n % 8))
 #define mutt_bit_toggle(v, n) v[n / 8] ^= (1 << (n % 8))
 #define mutt_bit_isset(v, n)  (v[n / 8] & (1 << (n % 8)))
 
-/* bit vector for boolean variables */
-#ifdef MAIN_C
-unsigned char Options[(OPT_GLOBAL_MAX + 7) / 8];
-#else
-extern unsigned char Options[];
-#endif
-
-#define set_option(x) mutt_bit_set(Options, x)
-#define unset_option(x) mutt_bit_unset(Options, x)
-#define toggle_option(x) mutt_bit_toggle(Options, x)
-#define option(x) mutt_bit_isset(Options, x)
-
 #endif /* _MUTT_OPTIONS_H_ */
diff --git a/pager.c b/pager.c
index 673311a12a7b1b7b41b5fd9e798162c7611659bd..32c694eec2e7777a13aa6beb0ed2654cf26dd09b 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -98,7 +98,7 @@ static struct Header *OldHdr = NULL;
   }
 
 #define CHECK_ATTACH                                                           \
-  if (option(OPT_ATTACH_MSG))                                                  \
+  if (OPT_ATTACH_MSG)                                                          \
   {                                                                            \
     mutt_flushinp();                                                           \
     mutt_error(_(Function_not_permitted_in_attach_message_mode));              \
@@ -232,7 +232,7 @@ static void resolve_color(struct Line *line_info, int n, int cnt, int flags,
 
   if (line_info[n].continuation)
   {
-    if (!cnt && option(OPT_MARKERS))
+    if (!cnt && OPT_MARKERS)
     {
       SETCOLOR(MT_COLOR_MARKERS);
       addch('+');
@@ -776,7 +776,7 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n,
       if (n > 0 && (buf[0] == ' ' || buf[0] == '\t'))
       {
         line_info[n].type = line_info[n - 1].type; /* wrapped line */
-        if (!option(OPT_HEADER_COLOR_PARTIAL))
+        if (!OPT_HEADER_COLOR_PARTIAL)
         {
           (line_info[n].syntax)[0].color = (line_info[n - 1].syntax)[0].color;
           line_info[n].is_cont_hdr = 1;
@@ -791,7 +791,7 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n,
        * same color.  Otherwise, we handle the header patterns just
        * like body patterns (further below).
        */
-      if (!option(OPT_HEADER_COLOR_PARTIAL))
+      if (!OPT_HEADER_COLOR_PARTIAL)
       {
         STAILQ_FOREACH(color_line, &ColorHdrList, entries)
         {
@@ -888,7 +888,7 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n,
 
   /* body patterns */
   if (line_info[n].type == MT_COLOR_NORMAL || line_info[n].type == MT_COLOR_QUOTED ||
-      (line_info[n].type == MT_COLOR_HDEFAULT && option(OPT_HEADER_COLOR_PARTIAL)))
+      (line_info[n].type == MT_COLOR_HDEFAULT && OPT_HEADER_COLOR_PARTIAL))
   {
     size_t nl;
 
@@ -1038,7 +1038,7 @@ static int grok_ansi(unsigned char *buf, int pos, struct AnsiAttr *a)
     x++;
 
   /* Character Attributes */
-  if (option(OPT_ALLOW_ANSI) && a != NULL && buf[x] == 'm')
+  if (OPT_ALLOW_ANSI && a != NULL && buf[x] == 'm')
   {
     if (pos == x)
     {
@@ -1212,7 +1212,7 @@ static int format_line(struct Line **line_info, int n, unsigned char *buf, int f
                        int *pcol, int *pspecial, struct MuttWindow *pager_window)
 {
   int space = -1; /* index of the last space or TAB */
-  int col = option(OPT_MARKERS) ? (*line_info)[n].continuation : 0;
+  int col = OPT_MARKERS ? (*line_info)[n].continuation : 0;
   size_t k;
   int ch, vch, last_special = -1, special = 0, t;
   wchar_t wc;
@@ -1557,7 +1557,7 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info,
   buf_ptr = buf + cnt;
 
   /* move the break point only if smart_wrap is set */
-  if (option(OPT_SMART_WRAP))
+  if (OPT_SMART_WRAP)
   {
     if ((cnt < b_read) && (ch != -1) && !ISHEADER((*line_info)[n].type) &&
         !ISSPACE(buf[cnt]))
@@ -1769,7 +1769,7 @@ static void pager_menu_redraw(struct Menu *pager_menu)
       memcpy(rd->index_window, MuttIndexWindow, sizeof(struct MuttWindow));
       rd->index_window->rows = rd->indexlen > 0 ? rd->indexlen - 1 : 0;
 
-      if (option(OPT_STATUS_ON_TOP))
+      if (OPT_STATUS_ON_TOP)
       {
         memcpy(rd->index_status_window, MuttStatusWindow, sizeof(struct MuttWindow));
 
@@ -1795,7 +1795,7 @@ static void pager_menu_redraw(struct Menu *pager_menu)
       }
     }
 
-    if (option(OPT_HELP))
+    if (OPT_HELP)
     {
       SETCOLOR(MT_COLOR_STATUS);
       mutt_window_move(MuttHelpWindow, 0, 0);
@@ -1941,7 +1941,7 @@ static void pager_menu_redraw(struct Menu *pager_menu)
     while (rd->lines < rd->pager_window->rows)
     {
       mutt_window_clrtoeol(rd->pager_window);
-      if (option(OPT_TILDE))
+      if (OPT_TILDE)
         addch('~');
       rd->lines++;
       mutt_window_move(rd->pager_window, rd->lines, 0);
@@ -1989,7 +1989,7 @@ static void pager_menu_redraw(struct Menu *pager_menu)
       mutt_draw_statusline(rd->pager_status_window->cols, bn, sizeof(bn));
     }
     NORMAL_COLOR;
-    if (option(OPT_TS_ENABLED) && TSSupported && rd->index)
+    if (OPT_TS_ENABLED && TSSupported && rd->index)
     {
       menu_status_line(buffer, sizeof(buffer), rd->index, NONULL(TSStatusFormat));
       mutt_ts_status(buffer);
@@ -2130,7 +2130,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
 
     pager_menu_redraw(pager_menu);
 
-    if (option(OPT_BRAILLE_FRIENDLY))
+    if (OPT_BRAILLE_FRIENDLY)
     {
       if (braille_line != -1)
       {
@@ -2164,7 +2164,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
 
     bool do_new_mail = false;
 
-    if (Context && !option(OPT_ATTACH_MSG))
+    if (Context && !OPT_ATTACH_MSG)
     {
       oldcount = Context ? Context->msgcount : 0;
       /* check for new mail */
@@ -2222,13 +2222,13 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
           }
 
           pager_menu->redraw = REDRAW_FULL;
-          set_option(OPT_SEARCH_INVALID);
+          OPT_SEARCH_INVALID = true;
         }
       }
 
       if (mutt_buffy_notify() || do_new_mail)
       {
-        if (option(OPT_BEEP_NEW))
+        if (OPT_BEEP_NEW)
           beep();
         if (NewMailCommand)
         {
@@ -2293,7 +2293,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
         if (query_quadoption(OPT_QUIT, _("Quit NeoMutt?")) == MUTT_YES)
         {
           /* avoid prompting again in the index menu */
-          set_quadoption(OPT_QUIT, MUTT_YES);
+          OPT_QUIT = MUTT_YES;
           ch = -1;
         }
         break;
@@ -2303,7 +2303,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
         {
           rd.topline = up_n_lines(PagerContext, rd.line_info, rd.curline, rd.hide_quoted);
         }
-        else if (option(OPT_PAGER_STOP))
+        else if (OPT_PAGER_STOP)
         {
           /* emulate "less -q" and don't go on to the next message. */
           mutt_error(_("Bottom of message is shown."));
@@ -2368,7 +2368,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
           rd.topline = up_n_lines(rd.pager_window->rows / 2, rd.line_info,
                                   rd.curline, rd.hide_quoted);
         }
-        else if (option(OPT_PAGER_STOP))
+        else if (OPT_PAGER_STOP)
         {
           /* emulate "less -q" and don't go on to the next message. */
           mutt_error(_("Bottom of message is shown."));
@@ -2408,7 +2408,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
 
             if (i < rd.last_line)
               rd.topline = i;
-            else if (wrapped || !option(OPT_WRAP_SEARCH))
+            else if (wrapped || !OPT_WRAP_SEARCH)
               mutt_error(_("Not found."));
             else
             {
@@ -2431,7 +2431,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
 
             if (i >= 0)
               rd.topline = i;
-            else if (wrapped || !option(OPT_WRAP_SEARCH))
+            else if (wrapped || !OPT_WRAP_SEARCH)
               mutt_error(_("Not found."));
             else
             {
@@ -2591,7 +2591,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
         CHECK_MODE(IsHeader(extra))
         if (mutt_select_sort((ch == OP_SORT_REVERSE)) == 0)
         {
-          set_option(OPT_NEED_RESORT);
+          OPT_NEED_RESORT = true;
           ch = -1;
           rc = OP_DISPLAY_MESSAGE;
         }
@@ -2760,10 +2760,10 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
 
         mutt_set_flag(Context, extra->hdr, MUTT_DELETE, 1);
         mutt_set_flag(Context, extra->hdr, MUTT_PURGE, (ch == OP_PURGE_MESSAGE));
-        if (option(OPT_DELETE_UNTAG))
+        if (OPT_DELETE_UNTAG)
           mutt_set_flag(Context, extra->hdr, MUTT_TAG, 0);
         pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
-        if (option(OPT_RESOLVE))
+        if (OPT_RESOLVE)
         {
           ch = -1;
           rc = OP_MAIN_NEXT_UNDELETED;
@@ -2777,7 +2777,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
 
         if (mutt_change_flag(extra->hdr, (ch == OP_MAIN_SET_FLAG)) == 0)
           pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
-        if (extra->hdr->deleted && option(OPT_RESOLVE))
+        if (extra->hdr->deleted && OPT_RESOLVE)
         {
           ch = -1;
           rc = OP_MAIN_NEXT_UNDELETED;
@@ -2804,15 +2804,15 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
               break;
           }
 
-          if (option(OPT_DELETE_UNTAG))
+          if (OPT_DELETE_UNTAG)
             mutt_thread_set_flag(extra->hdr, MUTT_TAG, 0, subthread);
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             rc = OP_MAIN_NEXT_UNDELETED;
             ch = -1;
           }
 
-          if (!option(OPT_RESOLVE) && PagerIndexLines)
+          if (!OPT_RESOLVE && PagerIndexLines)
             pager_menu->redraw = REDRAW_FULL;
           else
             pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
@@ -2832,11 +2832,11 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
 
         mutt_enter_command();
 
-        if (option(OPT_NEED_RESORT))
+        if (OPT_NEED_RESORT)
         {
-          unset_option(OPT_NEED_RESORT);
+          OPT_NEED_RESORT = false;
           CHECK_MODE(IsHeader(extra));
-          set_option(OPT_NEED_RESORT);
+          OPT_NEED_RESORT = true;
         }
 
         if (old_PagerIndexLines != PagerIndexLines)
@@ -2864,7 +2864,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
 
         mutt_set_flag(Context, extra->hdr, MUTT_FLAG, !extra->hdr->flagged);
         pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
-        if (option(OPT_RESOLVE))
+        if (OPT_RESOLVE)
         {
           ch = -1;
           rc = OP_MAIN_NEXT_UNDELETED;
@@ -3032,7 +3032,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
                 (ch == OP_DECRYPT_SAVE) || (ch == OP_DECRYPT_COPY) || 0) == 0 &&
             (ch == OP_SAVE || ch == OP_DECODE_SAVE || ch == OP_DECRYPT_SAVE))
         {
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             ch = -1;
             rc = OP_MAIN_NEXT_UNDELETED;
@@ -3061,7 +3061,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
         }
 
         pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
-        if (option(OPT_RESOLVE))
+        if (OPT_RESOLVE)
         {
           ch = -1;
           rc = OP_NEXT_ENTRY;
@@ -3081,7 +3081,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
         first = 0;
         Context->msgnotreadyet = -1;
         pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
-        if (option(OPT_RESOLVE))
+        if (OPT_RESOLVE)
         {
           ch = -1;
           rc = OP_MAIN_NEXT_UNDELETED;
@@ -3097,7 +3097,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
         mutt_set_flag(Context, extra->hdr, MUTT_DELETE, 0);
         mutt_set_flag(Context, extra->hdr, MUTT_PURGE, 0);
         pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
-        if (option(OPT_RESOLVE))
+        if (OPT_RESOLVE)
         {
           ch = -1;
           rc = OP_NEXT_ENTRY;
@@ -3118,13 +3118,13 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
                                    ch == OP_UNDELETE_THREAD ? 0 : 1);
         if (r != -1)
         {
-          if (option(OPT_RESOLVE))
+          if (OPT_RESOLVE)
           {
             rc = (ch == OP_DELETE_THREAD) ? OP_MAIN_NEXT_THREAD : OP_MAIN_NEXT_SUBTHREAD;
             ch = -1;
           }
 
-          if (!option(OPT_RESOLVE) && PagerIndexLines)
+          if (!OPT_RESOLVE && PagerIndexLines)
             pager_menu->redraw = REDRAW_FULL;
           else
             pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
@@ -3210,7 +3210,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
         break;
 
       case OP_SIDEBAR_TOGGLE_VISIBLE:
-        toggle_option(OPT_SIDEBAR_VISIBLE);
+        OPT_SIDEBAR_VISIBLE = !OPT_SIDEBAR_VISIBLE;
         mutt_reflow_windows();
         break;
 #endif
diff --git a/parse.c b/parse.c
index fb4b86f213d0b5d14f5974ec753db90efa815469..547e92b8b8d40a9d71de40344175f64099d8046a 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -1042,7 +1042,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line,
                 hdr->replied = true;
                 break;
               case 'O':
-                hdr->old = option(OPT_MARK_OLD) ? true : false;
+                hdr->old = OPT_MARK_OLD ? true : false;
                 break;
               case 'R':
                 hdr->read = true;
@@ -1132,7 +1132,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line,
     /* restore the original line */
     line[strlen(line)] = ':';
 
-    if (!(weed && option(OPT_WEED) && mutt_matches_ignore(line)))
+    if (!(weed && OPT_WEED && mutt_matches_ignore(line)))
     {
       struct ListNode *np = mutt_list_insert_tail(&e->userhdrs, mutt_str_strdup(line));
       if (do_2047)
index 9acbec4eeac4c0f1bb5125a8e3f13f64192713d8..3bbb247db3b756808bd47ca78ff82eef942ef149 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -915,7 +915,7 @@ static int msg_search(struct Context *ctx, struct Pattern *pat, int msgno)
   msg = mx_open_message(ctx, msgno);
   if (msg)
   {
-    if (option(OPT_THOROUGH_SEARCH))
+    if (OPT_THOROUGH_SEARCH)
     {
       /* decode the header / body */
       memset(&s, 0, sizeof(s));
@@ -1037,7 +1037,7 @@ static int msg_search(struct Context *ctx, struct Pattern *pat, int msgno)
 
     mx_close_message(ctx, &msg);
 
-    if (option(OPT_THOROUGH_SEARCH))
+    if (OPT_THOROUGH_SEARCH)
     {
       mutt_file_fclose(&fp);
 #ifdef USE_FMEMOPEN
@@ -2028,9 +2028,9 @@ int mutt_search_command(int cur, int op)
       return -1;
 
     if (op == OP_SEARCH || op == OP_SEARCH_NEXT)
-      unset_option(OPT_SEARCH_REVERSE);
+      OPT_SEARCH_REVERSE = false;
     else
-      set_option(OPT_SEARCH_REVERSE);
+      OPT_SEARCH_REVERSE = true;
 
     /* compare the *expanded* version of the search pattern in case
        $simple_search has changed while we were searching */
@@ -2041,7 +2041,7 @@ int mutt_search_command(int cur, int op)
     {
       struct Buffer err;
       mutt_buffer_init(&err);
-      set_option(OPT_SEARCH_INVALID);
+      OPT_SEARCH_INVALID = true;
       mutt_str_strfcpy(LastSearch, buf, sizeof(LastSearch));
       mutt_message(_("Compiling search pattern..."));
       mutt_pattern_free(&SearchPattern);
@@ -2059,7 +2059,7 @@ int mutt_search_command(int cur, int op)
     }
   }
 
-  if (option(OPT_SEARCH_INVALID))
+  if (OPT_SEARCH_INVALID)
   {
     for (int i = 0; i < Context->msgcount; i++)
       Context->hdrs[i]->searched = false;
@@ -2067,10 +2067,10 @@ int mutt_search_command(int cur, int op)
     if (Context->magic == MUTT_IMAP && imap_search(Context, SearchPattern) < 0)
       return -1;
 #endif
-    unset_option(OPT_SEARCH_INVALID);
+    OPT_SEARCH_INVALID = false;
   }
 
-  incr = (option(OPT_SEARCH_REVERSE)) ? -1 : 1;
+  incr = (OPT_SEARCH_REVERSE) ? -1 : 1;
   if (op == OP_SEARCH_OPPOSITE)
     incr = -incr;
 
@@ -2083,7 +2083,7 @@ int mutt_search_command(int cur, int op)
     if (i > Context->vcount - 1)
     {
       i = 0;
-      if (option(OPT_WRAP_SEARCH))
+      if (OPT_WRAP_SEARCH)
         msg = _("Search wrapped to top.");
       else
       {
@@ -2094,7 +2094,7 @@ int mutt_search_command(int cur, int op)
     else if (i < 0)
     {
       i = Context->vcount - 1;
-      if (option(OPT_WRAP_SEARCH))
+      if (OPT_WRAP_SEARCH)
         msg = _("Search wrapped to bottom.");
       else
       {
diff --git a/pop.c b/pop.c
index 10dbf6ff4e721e49b04920dff4999551ad57b1c3..fd8d5356a2347e90ee37e43de9661dd6f520330d 100644 (file)
--- a/pop.c
+++ b/pop.c
@@ -383,7 +383,7 @@ static int pop_fetch_headers(struct Context *ctx)
       {
         if (bcached)
           ctx->hdrs[i]->read = true;
-        else if (option(OPT_MARK_OLD))
+        else if (OPT_MARK_OLD)
           ctx->hdrs[i]->old = true;
       }
       else
@@ -414,7 +414,7 @@ static int pop_fetch_headers(struct Context *ctx)
    * clean up cache, i.e. wipe messages deleted outside
    * the availability of our cache
    */
-  if (option(OPT_MESSAGE_CACHE_CLEAN))
+  if (OPT_MESSAGE_CACHE_CLEAN)
     mutt_bcache_list(pop_data->bcache, msg_cache_check, (void *) ctx);
 
   mutt_clear_error();
@@ -884,7 +884,7 @@ void pop_fetch_mail(void)
   sscanf(buffer, "+OK %d %d", &msgs, &bytes);
 
   /* only get unread messages */
-  if (msgs > 0 && option(OPT_POP_LAST))
+  if (msgs > 0 && OPT_POP_LAST)
   {
     mutt_str_strfcpy(buffer, "LAST\r\n", sizeof(buffer));
     ret = pop_query(pop_data, buffer, sizeof(buffer));
index 49ca5bb1a235e1ad7c9430ec71f75906659d64fd..749b413c665a9247355a5359861fa82af1a3758e 100644 (file)
@@ -380,7 +380,7 @@ int pop_authenticate(struct PopData *pop_data)
           if (ret != POP_A_UNAVAIL)
             attempts++;
           if (ret == POP_A_SUCCESS || ret == POP_A_SOCKET ||
-              (ret == POP_A_FAILURE && !option(OPT_POP_AUTH_TRY_ALL)))
+              (ret == POP_A_FAILURE && !OPT_POP_AUTH_TRY_ALL))
           {
             comma = NULL;
             break;
@@ -418,7 +418,7 @@ int pop_authenticate(struct PopData *pop_data)
       if (ret != POP_A_UNAVAIL)
         attempts++;
       if (ret == POP_A_SUCCESS || ret == POP_A_SOCKET ||
-          (ret == POP_A_FAILURE && !option(OPT_POP_AUTH_TRY_ALL)))
+          (ret == POP_A_FAILURE && !OPT_POP_AUTH_TRY_ALL))
       {
         break;
       }
index 37b1727ee7fb49c0f81029ae2f43b9e2c5a65359..db9b15efab6a8cfc50709418a6622bfd9ae14c70 100644 (file)
--- a/pop_lib.c
+++ b/pop_lib.c
@@ -321,9 +321,9 @@ int pop_open_connection(struct PopData *pop_data)
 
 #ifdef USE_SSL
   /* Attempt STLS if available and desired. */
-  if (!pop_data->conn->ssf && (pop_data->cmd_stls || option(OPT_SSL_FORCE_TLS)))
+  if (!pop_data->conn->ssf && (pop_data->cmd_stls || OPT_SSL_FORCE_TLS))
   {
-    if (option(OPT_SSL_FORCE_TLS))
+    if (OPT_SSL_FORCE_TLS)
       pop_data->use_stls = 2;
     if (pop_data->use_stls == 0)
     {
@@ -366,7 +366,7 @@ int pop_open_connection(struct PopData *pop_data)
     }
   }
 
-  if (option(OPT_SSL_FORCE_TLS) && !pop_data->conn->ssf)
+  if (OPT_SSL_FORCE_TLS && !pop_data->conn->ssf)
   {
     mutt_error(_("Encrypted connection unavailable"));
     mutt_sleep(1);
index 660bee4de30632fe87453355ebd878d3047a23ce..997e7855f103826cb9a45c12f4bfed243105c184 100644 (file)
@@ -143,7 +143,7 @@ int mutt_num_postponed(int force)
   if (LastModify < st.st_mtime)
   {
 #ifdef USE_NNTP
-    int optnews = option(OPT_NEWS);
+    int optnews = OPT_NEWS;
 #endif
     LastModify = st.st_mtime;
 
@@ -151,7 +151,7 @@ int mutt_num_postponed(int force)
       return (PostCount = 0);
 #ifdef USE_NNTP
     if (optnews)
-      unset_option(OPT_NEWS);
+      OPT_NEWS = false;
 #endif
     if (mx_open_mailbox(Postponed, MUTT_NOSORT | MUTT_QUIET, &ctx) == NULL)
       PostCount = 0;
@@ -160,7 +160,7 @@ int mutt_num_postponed(int force)
     mx_fastclose_mailbox(&ctx);
 #ifdef USE_NNTP
     if (optnews)
-      set_option(OPT_NEWS);
+      OPT_NEWS = true;
 #endif
   }
 
@@ -219,7 +219,7 @@ static struct Header *select_msg(void)
         mutt_set_flag(PostContext, PostContext->hdrs[menu->current],
                       MUTT_DELETE, (i == OP_DELETE) ? 1 : 0);
         PostCount = PostContext->msgcount - PostContext->deleted;
-        if (option(OPT_RESOLVE) && menu->current < menu->max - 1)
+        if (OPT_RESOLVE && menu->current < menu->max - 1)
         {
           menu->oldcurrent = menu->current;
           menu->current++;
@@ -319,10 +319,10 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr,
   PostCount = PostContext->msgcount - PostContext->deleted;
 
   /* avoid the "purge deleted messages" prompt */
-  opt_delete = quadoption(OPT_DELETE);
-  set_quadoption(OPT_DELETE, MUTT_YES);
+  opt_delete = OPT_DELETE;
+  OPT_DELETE = MUTT_YES;
   mx_close_mailbox(PostContext, NULL);
-  set_quadoption(OPT_DELETE, opt_delete);
+  OPT_DELETE = opt_delete;
 
   FREE(&PostContext);
 
@@ -399,7 +399,7 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr,
     FREE(&np);
   }
 
-  if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+  if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
     crypt_opportunistic_encrypt(hdr);
 
   return code;
@@ -723,7 +723,7 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr,
   /* Theoretically, both could be set. Take the one the user wants to set by default. */
   if ((newhdr->security & APPLICATION_PGP) && (newhdr->security & APPLICATION_SMIME))
   {
-    if (option(OPT_SMIME_IS_DEFAULT))
+    if (OPT_SMIME_IS_DEFAULT)
       newhdr->security &= ~APPLICATION_PGP;
     else
       newhdr->security &= ~APPLICATION_SMIME;
index e5a16bef41e0fe971a0d40e76c0e94f286f8c683..52a418c92cbc60df282de95e4c40684a0f9081e8 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -92,9 +92,7 @@ int mutt_parse_virtual_mailboxes(struct Buffer *path, struct Buffer *s, unsigned
 
 FILE *mutt_open_read(const char *path, pid_t *thepid);
 
-void set_quadoption(int opt, int flag);
 int query_quadoption(int opt, const char *prompt);
-int quadoption(int opt);
 
 char *mutt_extract_message_id(const char *s, const char **saveptr);
 
index ca232921bfa08ea0f67db995acd73c2e63102ebf..0cb7e0db2e3e2fc3c412b79cae7f005c1fcb7589 100644 (file)
@@ -560,7 +560,7 @@ void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
     }
     if (!tag || top->tagged)
     {
-      if (!option(OPT_ATTACH_SPLIT))
+      if (!OPT_ATTACH_SPLIT)
       {
         if (!buf[0])
         {
@@ -623,7 +623,7 @@ void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
     menu->redraw |= REDRAW_MOTION;
   }
 
-  if (!option(OPT_ATTACH_SPLIT) && (rc == 0))
+  if (!OPT_ATTACH_SPLIT && (rc == 0))
     mutt_message(_("Attachment saved."));
 }
 
@@ -701,7 +701,7 @@ static void pipe_attachment_list(char *command, struct AttachCtx *actx, FILE *fp
     }
     if (!tag || top->tagged)
     {
-      if (!filter && !option(OPT_ATTACH_SPLIT))
+      if (!filter && !OPT_ATTACH_SPLIT)
         pipe_attachment(fp, top, state);
       else
         query_pipe_attachment(command, fp, top, filter);
@@ -733,13 +733,13 @@ void mutt_pipe_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
 
   mutt_expand_path(buf, sizeof(buf));
 
-  if (!filter && !option(OPT_ATTACH_SPLIT))
+  if (!filter && !OPT_ATTACH_SPLIT)
   {
     mutt_endwin(NULL);
     thepid = mutt_create_filter(buf, &state.fpout, NULL, NULL);
     pipe_attachment_list(buf, actx, fp, tag, top, filter, &state);
     mutt_file_fclose(&state.fpout);
-    if (mutt_wait_filter(thepid) != 0 || option(OPT_WAIT_KEY))
+    if (mutt_wait_filter(thepid) != 0 || OPT_WAIT_KEY)
       mutt_any_key_to_continue(NULL);
   }
   else
@@ -791,7 +791,7 @@ static void print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
     if (!tag || top->tagged)
     {
       snprintf(type, sizeof(type), "%s/%s", TYPE(top), top->subtype);
-      if (!option(OPT_ATTACH_SPLIT) && !rfc1524_mailcap_lookup(top, type, NULL, MUTT_PRINT))
+      if (!OPT_ATTACH_SPLIT && !rfc1524_mailcap_lookup(top, type, NULL, MUTT_PRINT))
       {
         if ((mutt_str_strcasecmp("text/plain", top->subtype) == 0) ||
             (mutt_str_strcasecmp("application/postscript", top->subtype) == 0))
@@ -838,7 +838,7 @@ void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, stru
                              _("Print attachment?")) != MUTT_YES)
     return;
 
-  if (!option(OPT_ATTACH_SPLIT))
+  if (!OPT_ATTACH_SPLIT)
   {
     if (!can_print(actx, top, tag))
       return;
@@ -847,7 +847,7 @@ void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, stru
     thepid = mutt_create_filter(NONULL(PrintCommand), &state.fpout, NULL, NULL);
     print_attachment_list(actx, fp, tag, top, &state);
     mutt_file_fclose(&state.fpout);
-    if (mutt_wait_filter(thepid) != 0 || option(OPT_WAIT_KEY))
+    if (mutt_wait_filter(thepid) != 0 || OPT_WAIT_KEY)
       mutt_any_key_to_continue(NULL);
   }
   else
@@ -912,7 +912,7 @@ int mutt_attach_display_loop(struct Menu *menu, int op, struct Header *hdr,
     switch (op)
     {
       case OP_DISPLAY_HEADERS:
-        toggle_option(OPT_WEED);
+        OPT_WEED = !OPT_WEED;
       /* fallthrough */
 
       case OP_VIEW_ATTACH:
@@ -1082,9 +1082,9 @@ void mutt_attach_init(struct AttachCtx *actx)
   {
     actx->idx[i]->content->tagged = false;
 
-    /*OR an inner container is of type 'multipart/digest' */
+    /* OR an inner container is of type 'multipart/digest' */
     actx->idx[i]->content->collapsed =
-        (option(OPT_DIGEST_COLLAPSE) &&
+        (OPT_DIGEST_COLLAPSE &&
          (digest ||
           ((actx->idx[i]->content->type == TYPEMULTIPART) &&
            (mutt_str_strcasecmp(actx->idx[i]->content->subtype, "digest") == 0))));
@@ -1125,7 +1125,7 @@ static void attach_collapse(struct AttachCtx *actx, struct Menu *menu)
 
   while ((rindex < actx->idxlen) && (actx->idx[rindex]->level > curlevel))
   {
-    if (option(OPT_DIGEST_COLLAPSE) && actx->idx[rindex]->content->type == TYPEMULTIPART &&
+    if (OPT_DIGEST_COLLAPSE && actx->idx[rindex]->content->type == TYPEMULTIPART &&
         !mutt_str_strcasecmp(actx->idx[rindex]->content->subtype, "digest"))
     {
       actx->idx[rindex]->content->collapsed = true;
@@ -1142,7 +1142,7 @@ static const char *Function_not_permitted =
     N_("Function not permitted in attach-message mode.");
 
 #define CHECK_ATTACH                                                           \
-  if (option(OPT_ATTACH_MSG))                                                  \
+  if (OPT_ATTACH_MSG)                                                          \
   {                                                                            \
     mutt_flushinp();                                                           \
     mutt_error(_(Function_not_permitted));                                     \
@@ -1248,7 +1248,7 @@ void mutt_view_attachments(struct Header *hdr)
         mutt_save_attachment_list(actx, CURATTACH->fp, menu->tagprefix,
                                   CURATTACH->content, hdr, menu);
 
-        if (!menu->tagprefix && option(OPT_RESOLVE) && menu->current < menu->max - 1)
+        if (!menu->tagprefix && OPT_RESOLVE && menu->current < menu->max - 1)
           menu->current++;
 
         menu->redraw = REDRAW_MOTION_RESYNCH | REDRAW_FULL;
@@ -1291,7 +1291,7 @@ void mutt_view_attachments(struct Header *hdr)
           if (CURATTACH->parent_type == TYPEMULTIPART)
           {
             CURATTACH->content->deleted = true;
-            if (option(OPT_RESOLVE) && menu->current < menu->max - 1)
+            if (OPT_RESOLVE && menu->current < menu->max - 1)
             {
               menu->current++;
               menu->redraw = REDRAW_MOTION_RESYNCH;
@@ -1327,7 +1327,7 @@ void mutt_view_attachments(struct Header *hdr)
         if (!menu->tagprefix)
         {
           CURATTACH->content->deleted = false;
-          if (option(OPT_RESOLVE) && menu->current < menu->max - 1)
+          if (OPT_RESOLVE && menu->current < menu->max - 1)
           {
             menu->current++;
             menu->redraw = REDRAW_MOTION_RESYNCH;
index 22600119b474f955c57bb4a33e8235cc752fea7f..213628fbfde35a4a8e0fb7ef9eedbb54c3f17d95 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -333,14 +333,14 @@ static void include_header(int quote, FILE *ifp, struct Header *hdr, FILE *ofp,
   int chflags = CH_DECODE;
   char prefix2[SHORT_STRING];
 
-  if (option(OPT_WEED))
+  if (OPT_WEED)
     chflags |= CH_WEED | CH_REORDER;
 
   if (quote)
   {
     if (prefix)
       mutt_str_strfcpy(prefix2, prefix, sizeof(prefix2));
-    else if (!option(OPT_TEXT_FLOWED))
+    else if (!OPT_TEXT_FLOWED)
       mutt_make_string_flags(prefix2, sizeof(prefix2), NONULL(IndentString),
                              Context, hdr, 0);
     else
@@ -431,16 +431,16 @@ static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx
 
   /* prepare the prefix here since we'll need it later. */
 
-  if (option(OPT_FORWARD_QUOTE))
+  if (OPT_FORWARD_QUOTE)
   {
-    if (!option(OPT_TEXT_FLOWED))
+    if (!OPT_TEXT_FLOWED)
       mutt_make_string_flags(prefix, sizeof(prefix), NONULL(IndentString),
                              Context, parent_hdr, 0);
     else
       mutt_str_strfcpy(prefix, ">", sizeof(prefix));
   }
 
-  include_header(option(OPT_FORWARD_QUOTE), parent_fp, parent_hdr, tmpfp, prefix);
+  include_header(OPT_FORWARD_QUOTE, parent_fp, parent_hdr, tmpfp, prefix);
 
   /*
    * Now, we have prepared the first part of the message body: The
@@ -480,10 +480,10 @@ static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx
 
   memset(&st, 0, sizeof(st));
 
-  if (option(OPT_FORWARD_QUOTE))
+  if (OPT_FORWARD_QUOTE)
     st.prefix = prefix;
   st.flags = MUTT_CHARCONV;
-  if (option(OPT_WEED))
+  if (OPT_WEED)
     st.flags |= MUTT_WEED;
   st.fpout = tmpfp;
 
@@ -605,16 +605,16 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx, struct Body *c
       return;
     }
 
-    if (option(OPT_FORWARD_QUOTE))
+    if (OPT_FORWARD_QUOTE)
     {
       chflags |= CH_PREFIX;
       cmflags |= MUTT_CM_PREFIX;
     }
 
-    if (option(OPT_FORWARD_DECODE))
+    if (OPT_FORWARD_DECODE)
     {
       cmflags |= MUTT_CM_DECODE | MUTT_CM_CHARCONV;
-      if (option(OPT_WEED))
+      if (OPT_WEED)
       {
         chflags |= CH_WEED | CH_REORDER;
         cmflags |= MUTT_CM_WEED;
@@ -790,9 +790,9 @@ static void attach_include_reply(FILE *fp, FILE *tmpfp, struct Header *cur)
 
   mutt_make_attribution(Context, cur, tmpfp);
 
-  if (!option(OPT_HEADER))
+  if (!OPT_HEADER)
     cmflags |= MUTT_CM_NOHEADER;
-  if (option(OPT_WEED))
+  if (OPT_WEED)
   {
     chflags |= CH_WEED;
     cmflags |= MUTT_CM_WEED;
@@ -822,9 +822,9 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
 
 #ifdef USE_NNTP
   if (flags & SENDNEWS)
-    set_option(OPT_NEWS_SEND);
+    OPT_NEWS_SEND = true;
   else
-    unset_option(OPT_NEWS_SEND);
+    OPT_NEWS_SEND = false;
 #endif
 
   if (!check_all_msg(actx, cur, false))
@@ -895,7 +895,7 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
     memset(&st, 0, sizeof(struct State));
     st.fpout = tmpfp;
 
-    if (!option(OPT_TEXT_FLOWED))
+    if (!OPT_TEXT_FLOWED)
       mutt_make_string_flags(prefix, sizeof(prefix), NONULL(IndentString),
                              Context, parent_hdr, 0);
     else
@@ -904,10 +904,10 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
     st.prefix = prefix;
     st.flags = MUTT_CHARCONV;
 
-    if (option(OPT_WEED))
+    if (OPT_WEED)
       st.flags |= MUTT_WEED;
 
-    if (option(OPT_HEADER))
+    if (OPT_HEADER)
       include_header(1, parent_fp, parent_hdr, tmpfp, prefix);
 
     if (cur)
index 2b2a5b2b5879dd979e26d4e28226731e785f6856..509bb441249f7be029b0e099b938bc48b9d78393 100644 (file)
@@ -759,14 +759,14 @@ int mix_send_message(struct ListHead *chain, const char *tempfile)
              (np == STAILQ_FIRST(chain)) ? " -l " : ",", cd_quoted);
   }
 
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
     mutt_endwin(NULL);
 
   i = mutt_system(cmd);
   if (i != 0)
   {
     fprintf(stderr, _("Error sending message, child exited %d.\n"), i);
-    if (!option(OPT_NO_CURSES))
+    if (!OPT_NO_CURSES)
     {
       mutt_any_key_to_continue(NULL);
       mutt_error(_("Error sending message."));
index 356347ccf4aa87c38911ef5a7e1d224b6d9c60d4..1400a7a01286965901eff3ca0cf13d30e0c98f01 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
@@ -69,7 +69,7 @@ int rfc1524_expand_command(struct Body *a, char *filename, char *type, char *com
 
   mutt_str_strfcpy(type2, type, sizeof(type2));
 
-  if (option(OPT_MAILCAP_SANITIZE))
+  if (OPT_MAILCAP_SANITIZE)
     mutt_file_sanitize_filename(type2, 0);
 
   while (x < clen - 1 && command[x] && y < sizeof(buf) - 1)
@@ -96,7 +96,7 @@ int rfc1524_expand_command(struct Body *a, char *filename, char *type, char *com
 
         pvalue2 = mutt_param_get(param, a->parameter);
         mutt_str_strfcpy(pvalue, NONULL(pvalue2), sizeof(pvalue));
-        if (option(OPT_MAILCAP_SANITIZE))
+        if (OPT_MAILCAP_SANITIZE)
           mutt_file_sanitize_filename(pvalue, 0);
 
         y += mutt_file_quote_filename(buf + y, sizeof(buf) - y, pvalue);
index 663ea75bee434373c813855b4a56761480bba5f1..4399596c5c7a3ac20acf99fb62a4840c7103431e 100644 (file)
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -810,7 +810,7 @@ void rfc2047_decode(char **pd)
     if (!p)
     {
       /* no encoded words */
-      if (option(OPT_IGNORE_LINEAR_WHITE_SPACE))
+      if (OPT_IGNORE_LINEAR_WHITE_SPACE)
       {
         n = mutt_str_strlen(s);
         if (found_encoded && (m = mutt_str_lws_len(s, n)) != 0)
@@ -849,7 +849,7 @@ void rfc2047_decode(char **pd)
       n = (size_t)(p - s);
       /* ignore spaces between encoded word
        * and linear-white-space between encoded word and *text */
-      if (option(OPT_IGNORE_LINEAR_WHITE_SPACE))
+      if (OPT_IGNORE_LINEAR_WHITE_SPACE)
       {
         if (found_encoded && (m = mutt_str_lws_len(s, n)) != 0)
         {
index e5b377628b5f9ceabbcd59a4d868aebbd165cc91..d935a2f85e25c67c4e736d0c3815ee7f21120854 100644 (file)
--- a/rfc2231.c
+++ b/rfc2231.c
@@ -246,7 +246,7 @@ void rfc2231_decode_parameters(struct Parameter **headp)
        * Internet Gateways.  So we actually decode it.
        */
 
-      if (option(OPT_RFC2047_PARAMETERS) && p->value && strstr(p->value, "=?"))
+      if (OPT_RFC2047_PARAMETERS && p->value && strstr(p->value, "=?"))
         rfc2047_decode(&p->value);
       else if (AssumedCharset && *AssumedCharset)
         convert_nonmime_string(&p->value);
index 2c8ca21f18100b00ce7905b2c8b43dcde13c805e..6ca10345d69aae4fe80e9a4e2654931f600da8d8 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -79,10 +79,10 @@ static int space_quotes(struct State *s)
   /* Allow quote spacing in the pager even for OPT_TEXT_FLOWED,
    * but obviously not when replying.
    */
-  if (option(OPT_TEXT_FLOWED) && (s->flags & MUTT_REPLYING))
+  if (OPT_TEXT_FLOWED && (s->flags & MUTT_REPLYING))
     return 0;
 
-  return option(OPT_REFLOW_SPACE_QUOTES);
+  return OPT_REFLOW_SPACE_QUOTES;
 }
 
 /**
@@ -105,7 +105,7 @@ static bool add_quote_suffix(struct State *s, int ql)
     return false;
 
   /* The prefix will add its own space */
-  if (!option(OPT_TEXT_FLOWED) && !ql && s->prefix)
+  if (!OPT_TEXT_FLOWED && !ql && s->prefix)
     return false;
 
   return true;
@@ -120,7 +120,7 @@ static size_t print_indent(int ql, struct State *s, int add_suffix)
     /* use given prefix only for format=fixed replies to format=flowed,
      * for format=flowed replies to format=flowed, use '>' indentation
      */
-    if (option(OPT_TEXT_FLOWED))
+    if (OPT_TEXT_FLOWED)
       ql++;
     else
     {
@@ -162,7 +162,7 @@ static void flush_par(struct State *s, struct FlowedState *fst)
 static int quote_width(struct State *s, int ql)
 {
   int width = mutt_window_wrap_cols(MuttIndexWindow, ReflowWrap);
-  if (option(OPT_TEXT_FLOWED) && (s->flags & MUTT_REPLYING))
+  if (OPT_TEXT_FLOWED && (s->flags & MUTT_REPLYING))
   {
     /* When replying, force a wrap at FLOWED_MAX to comply with RFC3676
      * guidelines */
@@ -230,7 +230,7 @@ static void print_flowed_line(char *line, struct State *s, int ql,
     {
       mutt_debug(4, "f=f: break line at %lu, %lu spaces left\n", fst->width, fst->spaces);
       /* only honor trailing spaces for format=flowed replies */
-      if (option(OPT_TEXT_FLOWED))
+      if (OPT_TEXT_FLOWED)
         for (; fst->spaces; fst->spaces--)
           state_putc(' ', s);
       state_putc('\n', s);
diff --git a/score.c b/score.c
index 20053b9cff612fcc3222c14d27fd34fa0be509f4..a1644fa273847b8f2f798e624f02043e399e3dae 100644 (file)
--- a/score.c
+++ b/score.c
@@ -51,13 +51,13 @@ static struct Score *ScoreList = NULL;
 
 void mutt_check_rescore(struct Context *ctx)
 {
-  if (option(OPT_NEED_RESCORE) && option(OPT_SCORE))
+  if (OPT_NEED_RESCORE && OPT_SCORE)
   {
     if ((Sort & SORT_MASK) == SORT_SCORE || (SortAux & SORT_MASK) == SORT_SCORE)
     {
-      set_option(OPT_NEED_RESORT);
+      OPT_NEED_RESORT = true;
       if ((Sort & SORT_MASK) == SORT_THREADS)
-        set_option(OPT_SORT_SUBTHREADS);
+        OPT_SORT_SUBTHREADS = true;
     }
 
     /* must redraw the index since the user might have %N in it */
@@ -70,7 +70,7 @@ void mutt_check_rescore(struct Context *ctx)
       ctx->hdrs[i]->pair = 0;
     }
   }
-  unset_option(OPT_NEED_RESCORE);
+  OPT_NEED_RESCORE = false;
 }
 
 int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data,
@@ -135,7 +135,7 @@ int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data,
     mutt_str_strfcpy(err->data, _("Error: score: invalid number"), err->dsize);
     return -1;
   }
-  set_option(OPT_NEED_RESCORE);
+  OPT_NEED_RESCORE = true;
   return 0;
 }
 
@@ -206,6 +206,6 @@ int mutt_parse_unscore(struct Buffer *buf, struct Buffer *s, unsigned long data,
       }
     }
   }
-  set_option(OPT_NEED_RESCORE);
+  OPT_NEED_RESCORE = true;
   return 0;
 }
diff --git a/send.c b/send.c
index b05a5ec3c94f0ec73202b5ce2b57705368a2954b..e2bb5d4a14193a3ce5cad6b090ed87fc5ea66c21 100644 (file)
--- a/send.c
+++ b/send.c
@@ -74,7 +74,7 @@ static void append_signature(FILE *f)
 
   if (Signature && (tmpfp = mutt_open_read(Signature, &thepid)))
   {
-    if (option(OPT_SIG_DASHES))
+    if (OPT_SIG_DASHES)
       fputs("\n-- \n", f);
     mutt_file_copy_stream(tmpfp, f);
     mutt_file_fclose(&tmpfp);
@@ -222,7 +222,7 @@ static int edit_envelope(struct Envelope *en, int flags)
   char buf[HUGE_STRING];
 
 #ifdef USE_NNTP
-  if (option(OPT_NEWS_SEND))
+  if (OPT_NEWS_SEND)
   {
     if (en->newsgroups)
       mutt_str_strfcpy(buf, en->newsgroups, sizeof(buf));
@@ -237,8 +237,7 @@ static int edit_envelope(struct Envelope *en, int flags)
       mutt_str_strfcpy(buf, en->followup_to, sizeof(buf));
     else
       buf[0] = 0;
-    if (option(OPT_ASK_FOLLOW_UP) &&
-        mutt_get_field("Followup-To: ", buf, sizeof(buf), 0) != 0)
+    if (OPT_ASK_FOLLOW_UP && mutt_get_field("Followup-To: ", buf, sizeof(buf), 0) != 0)
     {
       return -1;
     }
@@ -249,7 +248,7 @@ static int edit_envelope(struct Envelope *en, int flags)
       mutt_str_strfcpy(buf, en->x_comment_to, sizeof(buf));
     else
       buf[0] = 0;
-    if (option(OPT_X_COMMENT_TO) && option(OPT_ASK_X_COMMENT_TO) &&
+    if (OPT_X_COMMENT_TO && OPT_ASK_X_COMMENT_TO &&
         mutt_get_field("X-Comment-To: ", buf, sizeof(buf), 0) != 0)
     {
       return -1;
@@ -262,19 +261,18 @@ static int edit_envelope(struct Envelope *en, int flags)
   {
     if (edit_address(&en->to, _("To: ")) == -1 || en->to == NULL)
       return -1;
-    if (option(OPT_ASKCC) && edit_address(&en->cc, _("Cc: ")) == -1)
+    if (OPT_ASKCC && edit_address(&en->cc, _("Cc: ")) == -1)
       return -1;
-    if (option(OPT_ASKBCC) && edit_address(&en->bcc, _("Bcc: ")) == -1)
+    if (OPT_ASKBCC && edit_address(&en->bcc, _("Bcc: ")) == -1)
       return -1;
-    if (option(OPT_REPLY_WITH_XORIG) &&
-        (flags & (SENDREPLY | SENDLISTREPLY | SENDGROUPREPLY)) &&
+    if (OPT_REPLY_WITH_XORIG && (flags & (SENDREPLY | SENDLISTREPLY | SENDGROUPREPLY)) &&
         (edit_address(&en->from, "From: ") == -1))
       return -1;
   }
 
   if (en->subject)
   {
-    if (option(OPT_FAST_REPLY))
+    if (OPT_FAST_REPLY)
       return 0;
     else
       mutt_str_strfcpy(buf, en->subject, sizeof(buf));
@@ -417,7 +415,7 @@ static int include_forward(struct Context *ctx, struct Header *cur, FILE *out)
   mutt_parse_mime_message(ctx, cur);
   mutt_message_hook(ctx, cur, MUTT_MESSAGEHOOK);
 
-  if (WithCrypto && (cur->security & ENCRYPT) && option(OPT_FORWARD_DECODE))
+  if (WithCrypto && (cur->security & ENCRYPT) && OPT_FORWARD_DECODE)
   {
     /* make sure we have the user's passphrase before proceeding... */
     if (!crypt_valid_passphrase(cur->security))
@@ -426,16 +424,16 @@ static int include_forward(struct Context *ctx, struct Header *cur, FILE *out)
 
   mutt_forward_intro(ctx, cur, out);
 
-  if (option(OPT_FORWARD_DECODE))
+  if (OPT_FORWARD_DECODE)
   {
     cmflags |= MUTT_CM_DECODE | MUTT_CM_CHARCONV;
-    if (option(OPT_WEED))
+    if (OPT_WEED)
     {
       chflags |= CH_WEED | CH_REORDER;
       cmflags |= MUTT_CM_WEED;
     }
   }
-  if (option(OPT_FORWARD_QUOTE))
+  if (OPT_FORWARD_QUOTE)
     cmflags |= MUTT_CM_PREFIX;
 
   /* wrapping headers for forwarding is considered a display
@@ -488,9 +486,9 @@ static int include_reply(struct Context *ctx, struct Header *cur, FILE *out)
 
   mutt_make_attribution(ctx, cur, out);
 
-  if (!option(OPT_HEADER))
+  if (!OPT_HEADER)
     cmflags |= MUTT_CM_NOHEADER;
-  if (option(OPT_WEED))
+  if (OPT_WEED)
   {
     chflags |= CH_WEED | CH_REORDER;
     cmflags |= MUTT_CM_WEED;
@@ -519,7 +517,7 @@ static int default_to(struct Address **to, struct Envelope *env, int flags, int
   if (flags & SENDLISTREPLY)
     return 0;
 
-  if (!option(OPT_REPLY_SELF) && mutt_addr_is_user(env->from))
+  if (!OPT_REPLY_SELF && mutt_addr_is_user(env->from))
   {
     /* mail is from the user, assume replying to recipients */
     mutt_addr_append(to, env->to, true);
@@ -528,7 +526,7 @@ static int default_to(struct Address **to, struct Envelope *env, int flags, int
   {
     if ((mutt_addr_cmp(env->from, env->reply_to) && !env->reply_to->next &&
          !env->reply_to->personal) ||
-        (option(OPT_IGNORE_LIST_REPLY_TO) && mutt_is_mail_list(env->reply_to) &&
+        (OPT_IGNORE_LIST_REPLY_TO && mutt_is_mail_list(env->reply_to) &&
          (mutt_addr_search(env->reply_to, env->to) ||
           mutt_addr_search(env->reply_to, env->cc))))
     {
@@ -543,7 +541,7 @@ static int default_to(struct Address **to, struct Envelope *env, int flags, int
       mutt_addr_append(to, env->from, false);
     }
     else if (!(mutt_addr_cmp(env->from, env->reply_to) && !env->reply_to->next) &&
-             quadoption(OPT_REPLY_TO) != MUTT_YES)
+             OPT_REPLY_TO != MUTT_YES)
     {
       /* There are quite a few mailing lists which set the Reply-To:
        * header field to the list address, which makes it quite impossible
@@ -644,13 +642,13 @@ static void add_message_id(struct ListHead *head, struct Envelope *e)
 
 void mutt_fix_reply_recipients(struct Envelope *env)
 {
-  if (!option(OPT_METOO))
+  if (!OPT_METOO)
   {
     /* the order is important here.  do the CC: first so that if the
      * the user is the only recipient, it ends up on the TO: field
      */
     env->cc = remove_user(env->cc, (env->to == NULL));
-    env->to = remove_user(env->to, (env->cc == NULL) || option(OPT_REPLY_SELF));
+    env->to = remove_user(env->to, (env->cc == NULL) || OPT_REPLY_SELF);
   }
 
   /* the CC field can get cluttered, especially with lists */
@@ -702,7 +700,7 @@ void mutt_add_to_reference_headers(struct Envelope *env, struct Envelope *curenv
   add_message_id(&env->in_reply_to, curenv);
 
 #ifdef USE_NNTP
-  if (option(OPT_NEWS_SEND) && option(OPT_X_COMMENT_TO) && curenv->from)
+  if (OPT_NEWS_SEND && OPT_X_COMMENT_TO && curenv->from)
     env->x_comment_to = mutt_str_strdup(mutt_get_name(curenv->from));
 #endif
 }
@@ -808,7 +806,7 @@ static int envelope_defaults(struct Envelope *env, struct Context *ctx,
   else if (flags & SENDFORWARD)
   {
     mutt_make_forward_subject(env, ctx, cur);
-    if (option(OPT_FORWARD_REFERENCES))
+    if (OPT_FORWARD_REFERENCES)
       make_reference_headers(tag ? NULL : curenv, env, ctx);
   }
 
@@ -940,10 +938,10 @@ void mutt_set_followup_to(struct Envelope *e)
    * it hasn't already been set
    */
 
-  if (!option(OPT_FOLLOWUP_TO))
+  if (!OPT_FOLLOWUP_TO)
     return;
 #ifdef USE_NNTP
-  if (option(OPT_NEWS_SEND))
+  if (OPT_NEWS_SEND)
   {
     if (!e->followup_to && e->newsgroups && (strrchr(e->newsgroups, ',')))
       e->followup_to = mutt_str_strdup(e->newsgroups);
@@ -1030,7 +1028,7 @@ static struct Address *set_reverse_name(struct Envelope *env)
     /* when $reverse_realname is not set, clear the personal name so that it
      * may be set vi a reply- or send-hook.
      */
-    if (!option(OPT_REVERSE_REALNAME))
+    if (!OPT_REVERSE_REALNAME)
       FREE(&tmp->personal);
   }
   return tmp;
@@ -1048,7 +1046,7 @@ struct Address *mutt_default_from(void)
 
   if (From)
     adr = mutt_addr_copy(From);
-  else if (option(OPT_USE_DOMAIN))
+  else if (OPT_USE_DOMAIN)
   {
     adr = mutt_addr_new();
     adr->mailbox =
@@ -1080,9 +1078,9 @@ static int send_message(struct Header *msg)
     return -1;
 
 #ifdef USE_SMTP
-  old_write_bcc = option(OPT_WRITE_BCC);
+  old_write_bcc = OPT_WRITE_BCC;
   if (SmtpUrl)
-    unset_option(OPT_WRITE_BCC);
+    OPT_WRITE_BCC = false;
 #endif
 #ifdef MIXMASTER
   mutt_write_rfc822_header(tempfp, msg->env, msg->content, 0, !STAILQ_EMPTY(&msg->chain));
@@ -1092,7 +1090,7 @@ static int send_message(struct Header *msg)
 #endif
 #ifdef USE_SMTP
   if (old_write_bcc)
-    set_option(OPT_WRITE_BCC);
+    OPT_WRITE_BCC = true;
 #endif
 
   fputc('\n', tempfp); /* tie off the header. */
@@ -1118,7 +1116,7 @@ static int send_message(struct Header *msg)
 
 #ifdef USE_SMTP
 #ifdef USE_NNTP
-  if (!option(OPT_NEWS_SEND))
+  if (!OPT_NEWS_SEND)
 #endif
     if (SmtpUrl)
       return mutt_smtp_send(msg->env->from, msg->env->to, msg->env->cc, msg->env->bcc,
@@ -1213,7 +1211,7 @@ int mutt_resend_message(FILE *fp, struct Context *ctx, struct Header *cur)
      * so fix that here */
     if (!(msg->security & (APPLICATION_SMIME | APPLICATION_PGP)))
     {
-      if ((WithCrypto & APPLICATION_SMIME) && option(OPT_SMIME_IS_DEFAULT))
+      if ((WithCrypto & APPLICATION_SMIME) && OPT_SMIME_IS_DEFAULT)
         msg->security |= APPLICATION_SMIME;
       else if (WithCrypto & APPLICATION_PGP)
         msg->security |= APPLICATION_PGP;
@@ -1221,7 +1219,7 @@ int mutt_resend_message(FILE *fp, struct Context *ctx, struct Header *cur)
         msg->security |= APPLICATION_SMIME;
     }
 
-    if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+    if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
     {
       msg->security |= OPPENCRYPT;
       crypt_opportunistic_encrypt(msg);
@@ -1303,12 +1301,12 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
 
 #ifdef USE_NNTP
   if (flags & SENDNEWS)
-    set_option(OPT_NEWS_SEND);
+    OPT_NEWS_SEND = true;
   else
-    unset_option(OPT_NEWS_SEND);
+    OPT_NEWS_SEND = false;
 #endif
 
-  if (!flags && !msg && quadoption(OPT_RECALL) != MUTT_NO && mutt_num_postponed(1))
+  if (!flags && !msg && OPT_RECALL != MUTT_NO && mutt_num_postponed(1))
   {
     /* If the user is composing a new message, check to see if there
      * are any postponed messages first.
@@ -1351,12 +1349,12 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
       if (msg->env->newsgroups)
       {
         flags |= SENDNEWS;
-        set_option(OPT_NEWS_SEND);
+        OPT_NEWS_SEND = true;
       }
       else
       {
         flags &= ~SENDNEWS;
-        unset_option(OPT_NEWS_SEND);
+        OPT_NEWS_SEND = false;
       }
 #endif
     }
@@ -1428,7 +1426,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
   }
 
   /* this is handled here so that the user can match ~f in send-hook */
-  if (cur && option(OPT_REVERSE_NAME) && !(flags & (SENDPOSTPONED | SENDRESEND)))
+  if (cur && OPT_REVERSE_NAME && !(flags & (SENDPOSTPONED | SENDRESEND)))
   {
     /* we shouldn't have to worry about freeing `msg->env->from' before
      * setting it here since this code will only execute when doing some
@@ -1447,8 +1445,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
                  msg->env->from->mailbox);
     msg->env->from = set_reverse_name(cur->env);
   }
-  if (cur && option(OPT_REPLY_WITH_XORIG) &&
-      !(flags & (SENDPOSTPONED | SENDRESEND | SENDFORWARD)))
+  if (cur && OPT_REPLY_WITH_XORIG && !(flags & (SENDPOSTPONED | SENDRESEND | SENDFORWARD)))
   {
     /* We shouldn't have to worry about freeing `msg->env->from' before
      * setting it here since this code will only execute when doing some
@@ -1470,7 +1467,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
   }
 
   if (!(flags & (SENDPOSTPONED | SENDRESEND)) &&
-      !((flags & SENDDRAFTFILE) && option(OPT_RESUME_DRAFT_FILES)))
+      !((flags & SENDDRAFTFILE) && OPT_RESUME_DRAFT_FILES))
   {
     if ((flags & (SENDREPLY | SENDFORWARD)) && ctx &&
         envelope_defaults(msg->env, ctx, cur, flags) == -1)
@@ -1478,7 +1475,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
       goto cleanup;
     }
 
-    if (option(OPT_HDRS))
+    if (OPT_HDRS)
       process_user_recips(msg->env);
 
     /* Expand aliases and remove duplicates/crossrefs */
@@ -1492,9 +1489,8 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
       msg->env->newsgroups = mutt_str_strdup(((struct NntpData *) ctx->data)->group);
 #endif
 
-    if (!(flags & (SENDMAILX | SENDBATCH)) &&
-        !(option(OPT_AUTOEDIT) && option(OPT_EDIT_HEADERS)) &&
-        !((flags & SENDREPLY) && option(OPT_FAST_REPLY)))
+    if (!(flags & (SENDMAILX | SENDBATCH)) && !(OPT_AUTOEDIT && OPT_EDIT_HEADERS) &&
+        !((flags & SENDREPLY) && OPT_FAST_REPLY))
     {
       if (edit_envelope(msg->env, flags) == -1)
         goto cleanup;
@@ -1538,7 +1534,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
 
     if (!(flags & SENDKEY))
     {
-      if (option(OPT_TEXT_FLOWED) && msg->content->type == TYPETEXT &&
+      if (OPT_TEXT_FLOWED && msg->content->type == TYPETEXT &&
           (mutt_str_strcasecmp(msg->content->subtype, "plain") == 0))
       {
         mutt_param_set("format", "flowed", &msg->content->parameter);
@@ -1549,18 +1545,18 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
     if (killfrom)
     {
       mutt_addr_free(&msg->env->from);
-      if (option(OPT_USE_FROM) && !(flags & (SENDPOSTPONED | SENDRESEND)))
+      if (OPT_USE_FROM && !(flags & (SENDPOSTPONED | SENDRESEND)))
         msg->env->from = mutt_default_from();
       killfrom = false;
     }
 
-    if (option(OPT_HDRS))
+    if (OPT_HDRS)
       process_user_header(msg->env);
 
     if (flags & SENDBATCH)
       mutt_file_copy_stream(stdin, tempfp);
 
-    if (option(OPT_SIG_ON_TOP) && !(flags & (SENDMAILX | SENDKEY | SENDBATCH)) &&
+    if (OPT_SIG_ON_TOP && !(flags & (SENDMAILX | SENDKEY | SENDBATCH)) &&
         Editor && (mutt_str_strcmp(Editor, "builtin") != 0))
     {
       append_signature(tempfp);
@@ -1573,7 +1569,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
       goto cleanup;
     }
 
-    if (!option(OPT_SIG_ON_TOP) && !(flags & (SENDMAILX | SENDKEY | SENDBATCH)) &&
+    if (!OPT_SIG_ON_TOP && !(flags & (SENDMAILX | SENDKEY | SENDBATCH)) &&
         Editor && (mutt_str_strcmp(Editor, "builtin") != 0))
     {
       append_signature(tempfp);
@@ -1618,7 +1614,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
      *    recipients.
      */
     if (!(flags & SENDKEY) &&
-        ((flags & SENDFORWARD) == 0 || (option(OPT_EDIT_HEADERS) && option(OPT_AUTOEDIT)) ||
+        ((flags & SENDFORWARD) == 0 || (OPT_EDIT_HEADERS && OPT_AUTOEDIT) ||
          query_quadoption(OPT_FORWARD_EDIT, _("Edit forwarded message?")) == MUTT_YES))
     {
       /* If the this isn't a text message, look for a mailcap edit command */
@@ -1629,7 +1625,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
       }
       else if (!Editor || (mutt_str_strcmp("builtin", Editor) == 0))
         mutt_builtin_editor(msg->content->filename, msg, cur);
-      else if (option(OPT_EDIT_HEADERS))
+      else if (OPT_EDIT_HEADERS)
       {
         mutt_env_to_local(msg->env);
         mutt_edit_headers(Editor, msg->content->filename, msg, fcc, sizeof(fcc));
@@ -1652,7 +1648,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
        * performed.  If it has already been performed, the format=flowed
        * parameter will be present.
        */
-      if (option(OPT_TEXT_FLOWED) && msg->content->type == TYPETEXT &&
+      if (OPT_TEXT_FLOWED && msg->content->type == TYPETEXT &&
           (mutt_str_strcasecmp("plain", msg->content->subtype) == 0))
       {
         char *p = mutt_param_get("format", msg->content->parameter);
@@ -1696,26 +1692,26 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
   if (WithCrypto && (msg->security == 0) &&
       !(flags & (SENDBATCH | SENDMAILX | SENDPOSTPONED | SENDRESEND)))
   {
-    if (option(OPT_CRYPT_AUTOSIGN))
+    if (OPT_CRYPT_AUTOSIGN)
       msg->security |= SIGN;
-    if (option(OPT_CRYPT_AUTOENCRYPT))
+    if (OPT_CRYPT_AUTOENCRYPT)
       msg->security |= ENCRYPT;
-    if (option(OPT_CRYPT_REPLYENCRYPT) && cur && (cur->security & ENCRYPT))
+    if (OPT_CRYPT_REPLYENCRYPT && cur && (cur->security & ENCRYPT))
       msg->security |= ENCRYPT;
-    if (option(OPT_CRYPT_REPLYSIGN) && cur && (cur->security & SIGN))
+    if (OPT_CRYPT_REPLYSIGN && cur && (cur->security & SIGN))
       msg->security |= SIGN;
-    if (option(OPT_CRYPT_REPLYSIGNENCRYPTED) && cur && (cur->security & ENCRYPT))
+    if (OPT_CRYPT_REPLYSIGNENCRYPTED && cur && (cur->security & ENCRYPT))
       msg->security |= SIGN;
     if ((WithCrypto & APPLICATION_PGP) &&
-        ((msg->security & (ENCRYPT | SIGN)) || option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)))
+        ((msg->security & (ENCRYPT | SIGN)) || OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
     {
-      if (option(OPT_PGP_AUTOINLINE))
+      if (OPT_PGP_AUTOINLINE)
         msg->security |= INLINE;
-      if (option(OPT_PGP_REPLYINLINE) && cur && (cur->security & INLINE))
+      if (OPT_PGP_REPLYINLINE && cur && (cur->security & INLINE))
         msg->security |= INLINE;
     }
 
-    if (msg->security || option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+    if (msg->security || OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
     {
       /*
        * When replying / forwarding, use the original message's
@@ -1728,12 +1724,12 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
        */
       if (cur)
       {
-        if ((WithCrypto & APPLICATION_PGP) && option(OPT_CRYPT_AUTOPGP) &&
+        if ((WithCrypto & APPLICATION_PGP) && OPT_CRYPT_AUTOPGP &&
             (cur->security & APPLICATION_PGP))
         {
           msg->security |= APPLICATION_PGP;
         }
-        else if ((WithCrypto & APPLICATION_SMIME) && option(OPT_CRYPT_AUTOSMIME) &&
+        else if ((WithCrypto & APPLICATION_SMIME) && OPT_CRYPT_AUTOSMIME &&
                  (cur->security & APPLICATION_SMIME))
         {
           msg->security |= APPLICATION_SMIME;
@@ -1746,16 +1742,15 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
        */
       if (!(msg->security & (APPLICATION_SMIME | APPLICATION_PGP)))
       {
-        if ((WithCrypto & APPLICATION_SMIME) && option(OPT_CRYPT_AUTOSMIME) &&
-            option(OPT_SMIME_IS_DEFAULT))
+        if ((WithCrypto & APPLICATION_SMIME) && OPT_CRYPT_AUTOSMIME && OPT_SMIME_IS_DEFAULT)
         {
           msg->security |= APPLICATION_SMIME;
         }
-        else if ((WithCrypto & APPLICATION_PGP) && option(OPT_CRYPT_AUTOPGP))
+        else if ((WithCrypto & APPLICATION_PGP) && OPT_CRYPT_AUTOPGP)
         {
           msg->security |= APPLICATION_PGP;
         }
-        else if ((WithCrypto & APPLICATION_SMIME) && option(OPT_CRYPT_AUTOSMIME))
+        else if ((WithCrypto & APPLICATION_SMIME) && OPT_CRYPT_AUTOSMIME)
         {
           msg->security |= APPLICATION_SMIME;
         }
@@ -1763,7 +1758,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
     }
 
     /* opportunistic encrypt relies on SMIME or PGP already being selected */
-    if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
+    if (OPT_CRYPT_OPPORTUNISTIC_ENCRYPT)
     {
       /* If something has already enabled encryption, e.g. OPT_CRYPT_AUTOENCRYPT
        * or OPT_CRYPT_REPLYENCRYPT, then don't enable opportunistic encrypt for
@@ -1784,8 +1779,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
   /* specify a default fcc.  if we are in batchmode, only save a copy of
    * the message if the value of $copy is yes or ask-yes */
 
-  if (!fcc[0] && !(flags & (SENDPOSTPONEDFCC)) &&
-      (!(flags & SENDBATCH) || (quadoption(OPT_COPY) & 0x1)))
+  if (!fcc[0] && !(flags & (SENDPOSTPONEDFCC)) && (!(flags & SENDBATCH) || (OPT_COPY & 0x1)))
   {
     /* set the default FCC */
     if (!msg->env->from)
@@ -1829,7 +1823,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
       if (msg->content->next)
         msg->content = mutt_make_multipart(msg->content);
 
-      if (WithCrypto && option(OPT_POSTPONE_ENCRYPT) && (msg->security & ENCRYPT))
+      if (WithCrypto && OPT_POSTPONE_ENCRYPT && (msg->security & ENCRYPT))
       {
         char *encrypt_as = NULL;
 
@@ -1923,7 +1917,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
                             _("No subject, abort sending?"))) != MUTT_NO)
   {
     /* if the abort is automatic, print an error message */
-    if (quadoption(OPT_ABORT_NOSUBJECT) == MUTT_YES)
+    if (OPT_ABORT_NOSUBJECT == MUTT_YES)
       mutt_error(_("No subject specified."));
     goto main_loop;
   }
@@ -1941,13 +1935,13 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
   }
 #endif
 
-  if (quadoption(OPT_ABORT_NOATTACH) != MUTT_NO && !msg->content->next &&
+  if (OPT_ABORT_NOATTACH != MUTT_NO && !msg->content->next &&
       search_attach_keyword(msg->content->filename) &&
       query_quadoption(OPT_ABORT_NOATTACH,
                        _("No attachments, cancel sending?")) != MUTT_NO)
   {
     /* if the abort is automatic, print an error message */
-    if (quadoption(OPT_ABORT_NOATTACH) == MUTT_YES)
+    if (OPT_ABORT_NOATTACH == MUTT_YES)
     {
       mutt_error(_(
           "Message contains text matching \"$attach_keyword\". Not sending."));
@@ -2010,7 +2004,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
       free_clear_content = true;
   }
 
-  if (!option(OPT_NO_CURSES) && !(flags & SENDMAILX))
+  if (!OPT_NO_CURSES && !(flags & SENDMAILX))
     mutt_message(_("Sending message..."));
 
   mutt_prepare_envelope(msg->env, 1);
@@ -2039,7 +2033,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
     struct Body *save_sig = NULL;
     struct Body *save_parts = NULL;
 
-    if (WithCrypto && (msg->security & (ENCRYPT | SIGN)) && option(OPT_FCC_CLEAR))
+    if (WithCrypto && (msg->security & (ENCRYPT | SIGN)) && OPT_FCC_CLEAR)
       msg->content = clear_content;
 
     /* check to see if the user wants copies of all attachments */
@@ -2154,13 +2148,13 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
       goto cleanup;
     }
   }
-  else if (!option(OPT_NO_CURSES) && !(flags & SENDMAILX))
+  else if (!OPT_NO_CURSES && !(flags & SENDMAILX))
   {
     mutt_message(i != 0 ? _("Sending in background.") :
                           (flags & SENDNEWS) ? _("Article posted.") : /* USE_NNTP */
                               _("Mail sent."));
 #ifdef USE_NOTMUCH
-    if (option(OPT_NM_RECORD))
+    if (OPT_NM_RECORD)
       nm_record_message(ctx, finalpath, cur);
 #endif
   }
index 14cc257acc156c104f43050d24b2a19d49719d14..03c9c0739ffff1f3206cc1efe47d4f0596882fd9 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1256,13 +1256,13 @@ static void set_encoding(struct Body *b, struct Content *info)
   {
     char *chsname = mutt_get_body_charset(send_charset, sizeof(send_charset), b);
     if ((info->lobin && (mutt_str_strncasecmp(chsname, "iso-2022", 8) != 0)) ||
-        info->linemax > 990 || (info->from && option(OPT_ENCODE_FROM)))
+        info->linemax > 990 || (info->from && OPT_ENCODE_FROM))
     {
       b->encoding = ENCQUOTEDPRINTABLE;
     }
     else if (info->hibin)
     {
-      b->encoding = option(OPT_ALLOW_8BIT) ? ENC8BIT : ENCQUOTEDPRINTABLE;
+      b->encoding = OPT_ALLOW_8BIT ? ENC8BIT : ENCQUOTEDPRINTABLE;
     }
     else
     {
@@ -1273,7 +1273,7 @@ static void set_encoding(struct Body *b, struct Content *info)
   {
     if (info->lobin || info->hibin)
     {
-      if (option(OPT_ALLOW_8BIT) && !info->lobin)
+      if (OPT_ALLOW_8BIT && !info->lobin)
         b->encoding = ENC8BIT;
       else
         mutt_message_to_7bit(b, NULL);
@@ -1365,8 +1365,7 @@ struct Body *mutt_make_message_attach(struct Context *ctx, struct Header *hdr, i
 
   if (WithCrypto)
   {
-    if ((option(OPT_MIME_FORWARD_DECODE) || option(OPT_FORWARD_DECRYPT)) &&
-        (hdr->security & ENCRYPT))
+    if ((OPT_MIME_FORWARD_DECODE || OPT_FORWARD_DECRYPT) && (hdr->security & ENCRYPT))
     {
       if (!crypt_valid_passphrase(hdr->security))
         return NULL;
@@ -1393,7 +1392,7 @@ struct Body *mutt_make_message_attach(struct Context *ctx, struct Header *hdr, i
   cmflags = 0;
 
   /* If we are attaching a message, ignore OPT_MIME_FORWARD_DECODE */
-  if (!attach_msg && option(OPT_MIME_FORWARD_DECODE))
+  if (!attach_msg && OPT_MIME_FORWARD_DECODE)
   {
     chflags |= CH_MIME | CH_TXTPLAIN;
     cmflags = MUTT_CM_DECODE | MUTT_CM_CHARCONV;
@@ -1402,7 +1401,7 @@ struct Body *mutt_make_message_attach(struct Context *ctx, struct Header *hdr, i
     if ((WithCrypto & APPLICATION_SMIME))
       pgp &= ~SMIMEENCRYPT;
   }
-  else if (WithCrypto && option(OPT_FORWARD_DECRYPT) && (hdr->security & ENCRYPT))
+  else if (WithCrypto && OPT_FORWARD_DECRYPT && (hdr->security & ENCRYPT))
   {
     if ((WithCrypto & APPLICATION_PGP) && mutt_is_multipart_encrypted(hdr->content))
     {
@@ -1484,7 +1483,7 @@ struct Body *mutt_make_file_attach(const char *path)
   att = mutt_new_body();
   att->filename = mutt_str_strdup(path);
 
-  if (MimeTypeQueryCommand && *MimeTypeQueryCommand && option(OPT_MIME_TYPE_QUERY_FIRST))
+  if (MimeTypeQueryCommand && *MimeTypeQueryCommand && OPT_MIME_TYPE_QUERY_FIRST)
     run_mime_type_query(att);
 
   /* Attempt to determine the appropriate content-type based on the filename
@@ -1493,8 +1492,7 @@ struct Body *mutt_make_file_attach(const char *path)
   if (!att->subtype)
     mutt_lookup_mime_type(att, path);
 
-  if (!att->subtype && MimeTypeQueryCommand && *MimeTypeQueryCommand &&
-      !option(OPT_MIME_TYPE_QUERY_FIRST))
+  if (!att->subtype && MimeTypeQueryCommand && *MimeTypeQueryCommand && !OPT_MIME_TYPE_QUERY_FIRST)
   {
     run_mime_type_query(att);
   }
@@ -1940,7 +1938,7 @@ int mutt_write_one_header(FILE *fp, const char *tag, const char *value,
   char *v = mutt_str_strdup(value);
   bool display = (flags & CH_DISPLAY);
 
-  if (!display || option(OPT_WEED))
+  if (!display || OPT_WEED)
     v = unfold_header(v);
 
   /* when not displaying, use sane wrap value */
@@ -2059,7 +2057,7 @@ int mutt_write_rfc822_header(FILE *fp, struct Envelope *env,
   }
   else if (mode > 0)
 #ifdef USE_NNTP
-    if (!option(OPT_NEWS_SEND))
+    if (!OPT_NEWS_SEND)
 #endif
       fputs("To: \n", fp);
 
@@ -2070,13 +2068,13 @@ int mutt_write_rfc822_header(FILE *fp, struct Envelope *env,
   }
   else if (mode > 0)
 #ifdef USE_NNTP
-    if (!option(OPT_NEWS_SEND))
+    if (!OPT_NEWS_SEND)
 #endif
       fputs("Cc: \n", fp);
 
   if (env->bcc)
   {
-    if (mode != 0 || option(OPT_WRITE_BCC))
+    if (mode != 0 || OPT_WRITE_BCC)
     {
       fputs("Bcc: ", fp);
       mutt_write_address_list(env->bcc, fp, 5, 0);
@@ -2084,24 +2082,24 @@ int mutt_write_rfc822_header(FILE *fp, struct Envelope *env,
   }
   else if (mode > 0)
 #ifdef USE_NNTP
-    if (!option(OPT_NEWS_SEND))
+    if (!OPT_NEWS_SEND)
 #endif
       fputs("Bcc: \n", fp);
 
 #ifdef USE_NNTP
   if (env->newsgroups)
     fprintf(fp, "Newsgroups: %s\n", env->newsgroups);
-  else if (mode == 1 && option(OPT_NEWS_SEND))
+  else if (mode == 1 && OPT_NEWS_SEND)
     fputs("Newsgroups: \n", fp);
 
   if (env->followup_to)
     fprintf(fp, "Followup-To: %s\n", env->followup_to);
-  else if (mode == 1 && option(OPT_NEWS_SEND))
+  else if (mode == 1 && OPT_NEWS_SEND)
     fputs("Followup-To: \n", fp);
 
   if (env->x_comment_to)
     fprintf(fp, "X-Comment-To: %s\n", env->x_comment_to);
-  else if (mode == 1 && option(OPT_NEWS_SEND) && option(OPT_X_COMMENT_TO))
+  else if (mode == 1 && OPT_NEWS_SEND && OPT_X_COMMENT_TO)
     fputs("X-Comment-To: \n", fp);
 #endif
 
@@ -2124,7 +2122,7 @@ int mutt_write_rfc822_header(FILE *fp, struct Envelope *env,
 
   if (env->mail_followup_to)
 #ifdef USE_NNTP
-    if (!option(OPT_NEWS_SEND))
+    if (!OPT_NEWS_SEND)
 #endif
     {
       fputs("Mail-Followup-To: ", fp);
@@ -2186,7 +2184,7 @@ int mutt_write_rfc822_header(FILE *fp, struct Envelope *env,
     }
   }
 
-  if (mode == 0 && !privacy && option(OPT_USER_AGENT) && !has_agent)
+  if (mode == 0 && !privacy && OPT_USER_AGENT && !has_agent)
   {
     /* Add a vanity header */
     fprintf(fp, "User-Agent: NeoMutt/%s%s\n", PACKAGE_VERSION, GitVer);
@@ -2232,7 +2230,7 @@ const char *mutt_fqdn(short may_hide_host)
   {
     p = Hostname;
 
-    if (may_hide_host && option(OPT_HIDDEN_HOST))
+    if (may_hide_host && OPT_HIDDEN_HOST)
     {
       p = strchr(Hostname, '.');
       if (p)
@@ -2490,7 +2488,7 @@ int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Addres
   int i;
 
 #ifdef USE_NNTP
-  if (option(OPT_NEWS_SEND))
+  if (OPT_NEWS_SEND)
   {
     char cmd[LONG_STRING];
 
@@ -2544,7 +2542,7 @@ int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Addres
   }
 
 #ifdef USE_NNTP
-  if (!option(OPT_NEWS_SEND))
+  if (!OPT_NEWS_SEND)
   {
 #endif
     /* If Sendmail contained a "--", we save the recipients to append to
@@ -2562,10 +2560,10 @@ int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Addres
       }
     }
 
-    if (eightbit && option(OPT_USE_8BITMIME))
+    if (eightbit && OPT_USE_8BITMIME)
       args = add_option(args, &argslen, &argsmax, "-B8BITMIME");
 
-    if (option(OPT_USE_ENVELOPE_FROM))
+    if (OPT_USE_ENVELOPE_FROM)
     {
       if (EnvelopeFromAddress)
       {
@@ -2608,10 +2606,10 @@ int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Addres
    * and is set up to prompt using ncurses pinentry.  If we
    * mutt_endwin() it leaves other users staring at a blank screen.
    * So instead, just force a hard redraw on the next refresh. */
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
     mutt_need_hard_redraw();
 
-  i = send_msg(path, args, msg, option(OPT_NO_CURSES) ? NULL : &childout);
+  i = send_msg(path, args, msg, OPT_NO_CURSES ? NULL : &childout);
   if (i != (EX_OK & 0xff))
   {
     if (i != S_BKG)
@@ -2690,7 +2688,7 @@ void mutt_prepare_envelope(struct Envelope *env, int final)
 
   if (env->subject)
 #ifdef USE_NNTP
-    if (!option(OPT_NEWS_SEND) || option(OPT_MIME_SUBJECT))
+    if (!OPT_NEWS_SEND || OPT_MIME_SUBJECT)
 #endif
     {
       rfc2047_encode_string32(&env->subject);
@@ -2748,7 +2746,7 @@ static int bounce_message(FILE *fp, struct Header *h, struct Address *to,
     int ch_flags = CH_XMIT | CH_NONEWLINE | CH_NOQFROM;
     char *msgid_str = NULL;
 
-    if (!option(OPT_BOUNCE_DELIVERED))
+    if (!OPT_BOUNCE_DELIVERED)
       ch_flags |= CH_WEED_DELIVERED;
 
     fseeko(fp, h->offset, SEEK_SET);
@@ -2817,7 +2815,7 @@ int mutt_bounce_message(FILE *fp, struct Header *h, struct Address *to)
   rfc822_write_address(resent_from, sizeof(resent_from), from, 0);
 
 #ifdef USE_NNTP
-  unset_option(OPT_NEWS_SEND);
+  OPT_NEWS_SEND = false;
 #endif
 
   /*
index 436943e9bc8d23419146aade2257a131f45206cc..05806aeaf14c5d170f927983147ba241e1e3cc24 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -349,7 +349,7 @@ static int cb_qsort_sbe(const void *a, const void *b)
  */
 static void update_entries_visibility(void)
 {
-  short new_only = option(OPT_SIDEBAR_NEW_MAIL_ONLY);
+  short new_only = OPT_SIDEBAR_NEW_MAIL_ONLY;
   struct SbEntry *sbe = NULL;
   for (int i = 0; i < EntryCount; i++)
   {
@@ -482,7 +482,7 @@ static int select_next_new(void)
     entry++;
     if (entry == EntryCount)
     {
-      if (option(OPT_SIDEBAR_NEXT_NEW_WRAP))
+      if (OPT_SIDEBAR_NEXT_NEW_WRAP)
         entry = 0;
       else
         return false;
@@ -537,7 +537,7 @@ static bool select_prev_new(void)
     entry--;
     if (entry < 0)
     {
-      if (option(OPT_SIDEBAR_NEXT_NEW_WRAP))
+      if (OPT_SIDEBAR_NEXT_NEW_WRAP)
         entry = EntryCount - 1;
       else
         return false;
@@ -644,7 +644,7 @@ static bool prepare_sidebar(int page_size)
 
   /* If OPTSIDEBARNEMAILONLY is set, some entries may be hidden so we
    * need to scan for the framing interval */
-  if (option(OPT_SIDEBAR_NEW_MAIL_ONLY))
+  if (OPT_SIDEBAR_NEW_MAIL_ONLY)
   {
     TopIndex = BotIndex = -1;
     while (BotIndex < HilIndex)
@@ -715,7 +715,7 @@ static int draw_divider(int num_rows, int num_cols)
     altchar = SB_DIV_USER; /* User config */
   }
 
-  if (option(OPT_ASCII_CHARS) && (altchar != SB_DIV_ASCII))
+  if (OPT_ASCII_CHARS && (altchar != SB_DIV_ASCII))
   {
     /* $ascii_chars overrides Unicode divider chars */
     if (altchar == SB_DIV_UTF8)
@@ -741,7 +741,7 @@ static int draw_divider(int num_rows, int num_cols)
 
   SETCOLOR(MT_COLOR_DIVIDER);
 
-  int col = option(OPT_SIDEBAR_ON_RIGHT) ? 0 : (SidebarWidth - delim_len);
+  int col = OPT_SIDEBAR_ON_RIGHT ? 0 : (SidebarWidth - delim_len);
 
   for (int i = 0; i < num_rows; i++)
   {
@@ -778,7 +778,7 @@ static void fill_empty_space(int first_row, int num_rows, int div_width, int num
   /* Fill the remaining rows with blank space */
   NORMAL_COLOR;
 
-  if (!option(OPT_SIDEBAR_ON_RIGHT))
+  if (!OPT_SIDEBAR_ON_RIGHT)
     div_width = 0;
   for (int r = 0; r < num_rows; r++)
   {
@@ -853,7 +853,7 @@ static void draw_sidebar(int num_rows, int num_cols, int div_width)
     }
 
     int col = 0;
-    if (option(OPT_SIDEBAR_ON_RIGHT))
+    if (OPT_SIDEBAR_ON_RIGHT)
       col = div_width;
 
     mutt_window_move(MuttSidebarWindow, row, col);
@@ -887,7 +887,7 @@ static void draw_sidebar(int num_rows, int num_cols, int div_width)
     /* calculate depth of current folder and generate its display name with indented spaces */
     int sidebar_folder_depth = 0;
     char *sidebar_folder_name = NULL;
-    if (option(OPT_SIDEBAR_SHORT_PATH))
+    if (OPT_SIDEBAR_SHORT_PATH)
     {
       /* disregard a trailing separator, so strlen() - 2 */
       sidebar_folder_name = b->path;
@@ -919,7 +919,7 @@ static void draw_sidebar(int num_rows, int num_cols, int div_width)
     {
       sidebar_folder_name = b->desc;
     }
-    else if (maildir_is_prefix && option(OPT_SIDEBAR_FOLDER_INDENT))
+    else if (maildir_is_prefix && OPT_SIDEBAR_FOLDER_INDENT)
     {
       const char *tmp_folder_name = NULL;
       int lastsep = 0;
@@ -935,7 +935,7 @@ static void draw_sidebar(int num_rows, int num_cols, int div_width)
       }
       if (sidebar_folder_depth > 0)
       {
-        if (option(OPT_SIDEBAR_SHORT_PATH))
+        if (OPT_SIDEBAR_SHORT_PATH)
           tmp_folder_name += lastsep; /* basename */
         int sfn_len = mutt_str_strlen(tmp_folder_name) +
                       sidebar_folder_depth * mutt_str_strlen(SidebarIndentString) + 1;
@@ -965,7 +965,7 @@ static void draw_sidebar(int num_rows, int num_cols, int div_width)
  */
 void mutt_sb_draw(void)
 {
-  if (!option(OPT_SIDEBAR_VISIBLE))
+  if (!OPT_SIDEBAR_VISIBLE)
     return;
 
 #ifdef USE_SLANG_CURSES
@@ -1011,7 +1011,7 @@ void mutt_sb_draw(void)
  */
 void mutt_sb_change_mailbox(int op)
 {
-  if (!option(OPT_SIDEBAR_VISIBLE))
+  if (!OPT_SIDEBAR_VISIBLE)
     return;
 
   if (HilIndex < 0) /* It'll get reset on the next draw */
@@ -1084,7 +1084,7 @@ void mutt_sb_set_buffystats(const struct Context *ctx)
  */
 const char *mutt_sb_get_highlight(void)
 {
-  if (!option(OPT_SIDEBAR_VISIBLE))
+  if (!OPT_SIDEBAR_VISIBLE)
     return NULL;
 
   if (!EntryCount || HilIndex < 0)
diff --git a/signal.c b/signal.c
new file mode 100644 (file)
index 0000000..c716c0d
--- /dev/null
+++ b/signal.c
@@ -0,0 +1,264 @@
+/**
+ * @file
+ * Signal handling
+ *
+ * @authors
+ * Copyright (C) 1996-2000,2012 Michael R. Elkins <me@mutt.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mutt/mutt.h"
+#include "globals.h"
+#include "mutt_curses.h"
+#include "options.h"
+
+static sigset_t Sigset;
+static sigset_t SigsetSys;
+static struct sigaction SysOldInt;
+static struct sigaction SysOldQuit;
+static int IsEndwin = 0;
+
+/**
+ * exit_handler - Attempt to catch "ordinary" signals and shut down gracefully
+ */
+static void exit_handler(int sig)
+{
+  curs_set(1);
+  endwin(); /* just to be safe */
+
+/*
+   * if sys_siglist is not defined, HAVE_DECL_SYS_SIGLIST will be set to 0
+   * so we must check it with #if and not #ifdef
+   */
+#if HAVE_DECL_SYS_SIGLIST
+  printf(_("%s...  Exiting.\n"), sys_siglist[sig]);
+#elif (defined(__sun__) && defined(__svr4__))
+  printf(_("Caught %s...  Exiting.\n"), _sys_siglist[sig]);
+#elif (defined(__alpha) && defined(__osf__))
+  printf(_("Caught %s...  Exiting.\n"), __sys_siglist[sig]);
+#else
+  printf(_("Caught signal %d...  Exiting.\n"), sig);
+#endif
+  exit(0);
+}
+
+static void chld_handler(int sig)
+{
+  /* empty */
+}
+
+static void sighandler(int sig)
+{
+  int save_errno = errno;
+
+  switch (sig)
+  {
+    case SIGTSTP: /* user requested a suspend */
+      if (!OPT_SUSPEND)
+        break;
+      IsEndwin = isendwin();
+      curs_set(1);
+      if (!IsEndwin)
+        endwin();
+      kill(0, SIGSTOP);
+
+    case SIGCONT:
+      if (!IsEndwin)
+        refresh();
+      mutt_curs_set(-1);
+#if defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM)
+      /* We don't receive SIGWINCH when suspended; however, no harm is done by
+       * just assuming we received one, and triggering the 'resize' anyway. */
+      SigWinch = 1;
+#endif
+      break;
+
+#if defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM)
+    case SIGWINCH:
+      SigWinch = 1;
+      break;
+#endif
+
+    case SIGINT:
+      SigInt = 1;
+      break;
+  }
+  errno = save_errno;
+}
+
+#ifdef USE_SLANG_CURSES
+static int mutt_intr_hook(void)
+{
+  return -1;
+}
+#endif /* USE_SLANG_CURSES */
+
+void mutt_signal_init(void)
+{
+  struct sigaction act;
+
+  sigemptyset(&act.sa_mask);
+  act.sa_flags = 0;
+  act.sa_handler = SIG_IGN;
+  sigaction(SIGPIPE, &act, NULL);
+
+  act.sa_handler = exit_handler;
+  sigaction(SIGTERM, &act, NULL);
+  sigaction(SIGHUP, &act, NULL);
+  sigaction(SIGQUIT, &act, NULL);
+
+  /* we want to avoid race conditions */
+  sigaddset(&act.sa_mask, SIGTSTP);
+
+  act.sa_handler = sighandler;
+
+  /* we want SIGALRM to abort the current syscall, so we do this before
+   * setting the SA_RESTART flag below.  currently this is only used to
+   * timeout on a connect() call in a reasonable amount of time.
+   */
+  sigaction(SIGALRM, &act, NULL);
+
+/* we also don't want to mess with interrupted system calls */
+#ifdef SA_RESTART
+  act.sa_flags = SA_RESTART;
+#endif
+
+  sigaction(SIGCONT, &act, NULL);
+  sigaction(SIGTSTP, &act, NULL);
+  sigaction(SIGINT, &act, NULL);
+#if defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM)
+  sigaction(SIGWINCH, &act, NULL);
+#endif
+
+  /* POSIX doesn't allow us to ignore SIGCHLD,
+   * so we just install a dummy handler for it
+   */
+  act.sa_handler = chld_handler;
+  /* don't need to block any other signals here */
+  sigemptyset(&act.sa_mask);
+  /* we don't want to mess with stopped children */
+  act.sa_flags |= SA_NOCLDSTOP;
+  sigaction(SIGCHLD, &act, NULL);
+
+#ifdef USE_SLANG_CURSES
+  /* This bit of code is required because of the implementation of
+   * SLcurses_wgetch().  If a signal is received (like SIGWINCH) when we
+   * are in blocking mode, SLsys_getkey() will not return an error unless
+   * a handler function is defined and it returns -1.  This is needed so
+   * that if the user resizes the screen while at a prompt, it will just
+   * abort and go back to the main-menu.
+   */
+  SLang_getkey_intr_hook = mutt_intr_hook;
+#endif
+}
+
+/**
+ * mutt_block_signals - Block signals during critical ops
+ *
+ * signals which are important to block while doing critical ops
+ */
+void mutt_block_signals(void)
+{
+  if (!OPT_SIGNALS_BLOCKED)
+  {
+    sigemptyset(&Sigset);
+    sigaddset(&Sigset, SIGTERM);
+    sigaddset(&Sigset, SIGHUP);
+    sigaddset(&Sigset, SIGTSTP);
+    sigaddset(&Sigset, SIGINT);
+#if defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM)
+    sigaddset(&Sigset, SIGWINCH);
+#endif
+    sigprocmask(SIG_BLOCK, &Sigset, 0);
+    OPT_SIGNALS_BLOCKED = true;
+  }
+}
+
+/**
+ * mutt_unblock_signals - restore the previous signal mask
+ */
+void mutt_unblock_signals(void)
+{
+  if (OPT_SIGNALS_BLOCKED)
+  {
+    sigprocmask(SIG_UNBLOCK, &Sigset, 0);
+    OPT_SIGNALS_BLOCKED = false;
+  }
+}
+
+void mutt_block_signals_system(void)
+{
+  struct sigaction sa;
+
+  if (!OPT_SYS_SIGNALS_BLOCKED)
+  {
+    /* POSIX: ignore SIGINT and SIGQUIT & block SIGCHLD  before exec */
+    sa.sa_handler = SIG_IGN;
+    sa.sa_flags = 0;
+    sigemptyset(&sa.sa_mask);
+    sigaction(SIGINT, &sa, &SysOldInt);
+    sigaction(SIGQUIT, &sa, &SysOldQuit);
+
+    sigemptyset(&SigsetSys);
+    sigaddset(&SigsetSys, SIGCHLD);
+    sigprocmask(SIG_BLOCK, &SigsetSys, 0);
+    OPT_SYS_SIGNALS_BLOCKED = true;
+  }
+}
+
+void mutt_unblock_signals_system(int catch)
+{
+  if (OPT_SYS_SIGNALS_BLOCKED)
+  {
+    sigprocmask(SIG_UNBLOCK, &SigsetSys, NULL);
+    if (catch)
+    {
+      sigaction(SIGQUIT, &SysOldQuit, NULL);
+      sigaction(SIGINT, &SysOldInt, NULL);
+    }
+    else
+    {
+      struct sigaction sa;
+
+      sa.sa_handler = SIG_DFL;
+      sigemptyset(&sa.sa_mask);
+      sa.sa_flags = 0;
+      sigaction(SIGQUIT, &sa, NULL);
+      sigaction(SIGINT, &sa, NULL);
+    }
+
+    OPT_SYS_SIGNALS_BLOCKED = false;
+  }
+}
+
+void mutt_allow_interrupt(int disposition)
+{
+  struct sigaction sa;
+
+  memset(&sa, 0, sizeof(sa));
+  sa.sa_handler = sighandler;
+#ifdef SA_RESTART
+  if (disposition == 0)
+    sa.sa_flags |= SA_RESTART;
+#endif
+  sigaction(SIGINT, &sa, NULL);
+}
diff --git a/smtp.c b/smtp.c
index 723e77fa8e9284e3a54361254af7f6c2eac16013..510d494a0699062270da5dba6dc1f81575ef412c 100644 (file)
--- a/smtp.c
+++ b/smtp.c
@@ -341,7 +341,7 @@ static int smtp_helo(struct Connection *conn)
     if (conn->account.flags & MUTT_ACCT_USER)
       Esmtp = 1;
 #ifdef USE_SSL
-    if (option(OPT_SSL_FORCE_TLS) || quadoption(OPT_SSL_STARTTLS) != MUTT_NO)
+    if (OPT_SSL_FORCE_TLS || OPT_SSL_STARTTLS != MUTT_NO)
       Esmtp = 1;
 #endif
   }
@@ -389,7 +389,7 @@ static int smtp_auth_sasl(struct Connection *conn, const char *mechlist)
     return SMTP_AUTH_UNAVAIL;
   }
 
-  if (!option(OPT_NO_CURSES))
+  if (!OPT_NO_CURSES)
     mutt_message(_("Authenticating (%s)..."), mech);
 
   bufsize = ((len * 2) > LONG_STRING) ? (len * 2) : LONG_STRING;
@@ -593,7 +593,7 @@ static int smtp_open(struct Connection *conn)
 #ifdef USE_SSL
   if (conn->ssf)
     rc = MUTT_NO;
-  else if (option(OPT_SSL_FORCE_TLS))
+  else if (OPT_SSL_FORCE_TLS)
     rc = MUTT_YES;
   else if (mutt_bit_isset(Capabilities, STARTTLS) &&
            (rc = query_quadoption(OPT_SSL_STARTTLS,
diff --git a/sort.c b/sort.c
index 7a271c5646a0bf0ba091daa6550270b07022391a..173358fffad3e0b302d4fc24dd428e1c69e4d49e 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -50,11 +50,11 @@ static int perform_auxsort(int retval, const void *a, const void *b)
 {
   /* If the items compared equal by the main sort
    * and we're not already doing an 'aux' sort...  */
-  if ((retval == 0) && AuxSort && !option(OPT_AUX_SORT))
+  if ((retval == 0) && AuxSort && !OPT_AUX_SORT)
   {
-    set_option(OPT_AUX_SORT);
+    OPT_AUX_SORT = true;
     retval = AuxSort(a, b);
-    unset_option(OPT_AUX_SORT);
+    OPT_AUX_SORT = false;
   }
   /* If the items still match, use their index positions
    * to maintain a stable sort order */
@@ -117,7 +117,7 @@ const char *mutt_get_name(struct Address *a)
 
   if (a)
   {
-    if (option(OPT_REVERSE_ALIAS) && (ali = alias_reverse_lookup(a)) && ali->personal)
+    if (OPT_REVERSE_ALIAS && (ali = alias_reverse_lookup(a)) && ali->personal)
       return ali->personal;
     else if (a->personal)
       return a->personal;
@@ -309,7 +309,7 @@ void mutt_sort_headers(struct Context *ctx, int init)
   struct MuttThread *thread = NULL, *top = NULL;
   sort_t *sortfunc = NULL;
 
-  unset_option(OPT_NEED_RESORT);
+  OPT_NEED_RESORT = false;
 
   if (!ctx)
     return;
@@ -328,16 +328,16 @@ void mutt_sort_headers(struct Context *ctx, int init)
   if (!ctx->quiet)
     mutt_message(_("Sorting mailbox..."));
 
-  if (option(OPT_NEED_RESCORE) && option(OPT_SCORE))
+  if (OPT_NEED_RESCORE && OPT_SCORE)
   {
     for (int i = 0; i < ctx->msgcount; i++)
       mutt_score_message(ctx, ctx->hdrs[i], 1);
   }
-  unset_option(OPT_NEED_RESCORE);
+  OPT_NEED_RESCORE = false;
 
-  if (option(OPT_RESORT_INIT))
+  if (OPT_RESORT_INIT)
   {
-    unset_option(OPT_RESORT_INIT);
+    OPT_RESORT_INIT = false;
     init = 1;
   }
 
@@ -349,14 +349,14 @@ void mutt_sort_headers(struct Context *ctx, int init)
     AuxSort = NULL;
     /* if $sort_aux changed after the mailbox is sorted, then all the
        subthreads need to be resorted */
-    if (option(OPT_SORT_SUBTHREADS))
+    if (OPT_SORT_SUBTHREADS)
     {
       int i = Sort;
       Sort = SortAux;
       if (ctx->tree)
         ctx->tree = mutt_sort_subthreads(ctx->tree, 1);
       Sort = i;
-      unset_option(OPT_SORT_SUBTHREADS);
+      OPT_SORT_SUBTHREADS = false;
     }
     mutt_sort_threads(ctx, init);
   }
index 6721cce26dcf7f6d401166fe9a2802de0f77aed9..b99c411dd7849ee59bcc24b2fa637b2384e2ad97 100644 (file)
--- a/status.c
+++ b/status.c
@@ -258,15 +258,13 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c
 
       if (Context)
       {
-        i = option(OPT_ATTACH_MSG) ?
-                3 :
-                ((Context->readonly || Context->dontwrite) ?
-                     2 :
-                     (Context->changed ||
-                      /* deleted doesn't necessarily mean changed in IMAP */
-                      (Context->magic != MUTT_IMAP && Context->deleted)) ?
-                     1 :
-                     0);
+        i = OPT_ATTACH_MSG ? 3 : ((Context->readonly || Context->dontwrite) ?
+                                      2 :
+                                      (Context->changed ||
+                                       /* deleted doesn't necessarily mean changed in IMAP */
+                                       (Context->magic != MUTT_IMAP && Context->deleted)) ?
+                                      1 :
+                                      0);
       }
 
       if (!StatusChars || !StatusChars->len)
index 3e33060a1ee83019d2414aaf95fb44a4029f9811..87ea72d6ef94b48634c42c9bb023ea0c2d6bad46 100644 (file)
--- a/thread.c
+++ b/thread.c
@@ -64,7 +64,7 @@ static int need_display_subject(struct Context *ctx, struct Header *hdr)
   struct MuttThread *tmp = NULL, *tree = hdr->thread;
 
   /* if the user disabled subject hiding, display it */
-  if (!option(OPT_HIDE_THREAD_SUBJECT))
+  if (!OPT_HIDE_THREAD_SUBJECT)
     return 1;
 
   /* if our subject is different from our parent's, display it */
@@ -147,8 +147,8 @@ static void linearize_tree(struct Context *ctx)
 static void calculate_visibility(struct Context *ctx, int *max_depth)
 {
   struct MuttThread *tmp = NULL, *tree = ctx->tree;
-  int hide_top_missing = option(OPT_HIDE_TOP_MISSING) && !option(OPT_HIDE_MISSING);
-  int hide_top_limited = option(OPT_HIDE_TOP_LIMITED) && !option(OPT_HIDE_LIMITED);
+  int hide_top_missing = OPT_HIDE_TOP_MISSING && !OPT_HIDE_MISSING;
+  int hide_top_limited = OPT_HIDE_TOP_LIMITED && !OPT_HIDE_LIMITED;
   int depth = 0;
 
   /* we walk each level backwards to make it easier to compute next_subtree_visible */
@@ -185,13 +185,13 @@ static void calculate_visibility(struct Context *ctx, int *max_depth)
       else
       {
         tree->visible = false;
-        tree->deep = !option(OPT_HIDE_LIMITED);
+        tree->deep = !OPT_HIDE_LIMITED;
       }
     }
     else
     {
       tree->visible = false;
-      tree->deep = !option(OPT_HIDE_MISSING);
+      tree->deep = !OPT_HIDE_MISSING;
     }
     tree->next_subtree_visible =
         tree->next && (tree->next->next_subtree_visible || tree->next->subtree_visible);
@@ -262,7 +262,7 @@ void mutt_draw_tree(struct Context *ctx)
   char *pfx = NULL, *mypfx = NULL, *arrow = NULL, *myarrow = NULL, *new_tree = NULL;
   char corner = (Sort & SORT_REVERSE) ? MUTT_TREE_ULCORNER : MUTT_TREE_LLCORNER;
   char vtee = (Sort & SORT_REVERSE) ? MUTT_TREE_BTEE : MUTT_TREE_TTEE;
-  int depth = 0, start_depth = 0, max_depth = 0, width = option(OPT_NARROW_TREE) ? 1 : 2;
+  int depth = 0, start_depth = 0, max_depth = 0, width = OPT_NARROW_TREE ? 1 : 2;
   struct MuttThread *nextdisp = NULL, *pseudo = NULL, *parent = NULL, *tree = ctx->tree;
 
   /* Do the visibility calculations and free the old thread chars.
@@ -278,9 +278,9 @@ void mutt_draw_tree(struct Context *ctx)
       myarrow = arrow + (depth - start_depth - (start_depth ? 0 : 1)) * width;
       if (depth && start_depth == depth)
         myarrow[0] = nextdisp ? MUTT_TREE_LTEE : corner;
-      else if (parent->message && !option(OPT_HIDE_LIMITED))
+      else if (parent->message && !OPT_HIDE_LIMITED)
         myarrow[0] = MUTT_TREE_HIDDEN;
-      else if (!parent->message && !option(OPT_HIDE_MISSING))
+      else if (!parent->message && !OPT_HIDE_MISSING)
         myarrow[0] = MUTT_TREE_MISSING;
       else
         myarrow[0] = vtee;
@@ -390,14 +390,13 @@ static void make_subject_list(struct ListHead *subjects, struct MuttThread *cur,
 
     if (dateptr)
     {
-      thisdate = option(OPT_THREAD_RECEIVED) ? cur->message->received :
-                                               cur->message->date_sent;
+      thisdate = OPT_THREAD_RECEIVED ? cur->message->received : cur->message->date_sent;
       if (!*dateptr || thisdate < *dateptr)
         *dateptr = thisdate;
     }
 
     env = cur->message->env;
-    if (env->real_subj && ((env->real_subj != env->subject) || (!option(OPT_SORT_RE))))
+    if (env->real_subj && ((env->real_subj != env->subject) || (!OPT_SORT_RE)))
     {
       struct ListNode *np;
       STAILQ_FOREACH(np, subjects, entries)
@@ -447,9 +446,8 @@ static struct MuttThread *find_subject(struct Context *ctx, struct MuttThread *c
           !tmp->fake_thread &&             /* don't match pseudo threads */
           tmp->message->subject_changed && /* only match interesting replies */
           !is_descendant(tmp, cur) &&      /* don't match in the same thread */
-          (date >= (option(OPT_THREAD_RECEIVED) ? tmp->message->received :
-                                                  tmp->message->date_sent)) &&
-          (!last || (option(OPT_THREAD_RECEIVED) ?
+          (date >= (OPT_THREAD_RECEIVED ? tmp->message->received : tmp->message->date_sent)) &&
+          (!last || (OPT_THREAD_RECEIVED ?
                          (last->message->received < tmp->message->received) :
                          (last->message->date_sent < tmp->message->date_sent))) &&
           tmp->message->env->real_subj &&
@@ -829,7 +827,7 @@ void mutt_sort_threads(struct Context *ctx, int init)
 
     if (!cur->thread)
     {
-      if ((!init || option(OPT_DUPLICATE_THREADS)) && cur->env->message_id)
+      if ((!init || OPT_DUPLICATE_THREADS) && cur->env->message_id)
         thread = mutt_hash_find(ctx->thread_hash, cur->env->message_id);
       else
         thread = NULL;
@@ -873,7 +871,7 @@ void mutt_sort_threads(struct Context *ctx, int init)
       }
       else
       {
-        new = (option(OPT_DUPLICATE_THREADS) ? thread : NULL);
+        new = (OPT_DUPLICATE_THREADS ? thread : NULL);
 
         thread = mutt_mem_calloc(1, sizeof(struct MuttThread));
         thread->message = cur;
@@ -1000,7 +998,7 @@ void mutt_sort_threads(struct Context *ctx, int init)
 
   check_subjects(ctx, init);
 
-  if (!option(OPT_STRICT_THREADS))
+  if (!OPT_STRICT_THREADS)
     pseudo_threads(ctx);
 
   if (ctx->tree)