#include <stdio.h>
#include <stdlib.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "alias.h"
#include <wchar.h>
#include <wctype.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "alias.h"
#include <time.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <sys/stat.h>
#include <utime.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "buffy.h"
#include <sys/stat.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <sys/stat.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <sys/stat.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "compress.h"
#include "context.h"
#include "curs_lib.h"
#include "set.h"
#include "types.h"
-size_t mutt_addr_write(char *buf, size_t buflen, struct Address *addr, bool display);
-
/**
* address_destroy - Destroy an Address object
* @param cs Config items
/* An empty address "" will be stored as NULL */
if (var && value && (value[0] != '\0'))
{
- // addr = mutt_addr_parse_list(NULL, value);
+ addr = mutt_addr_parse_list(NULL, value);
}
int rc = CSR_SUCCESS;
#include <sys/stat.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "ssl.h"
#include <sys/stat.h>
#include <time.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "mutt.h"
#include "account.h"
#include "conn_globals.h"
#include <stdbool.h>
#include <string.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "copy.h"
#include <unistd.h>
#include <wchar.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "curs_lib.h"
#include <stdio.h>
#include <string.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <time.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "context.h"
#include <stddef.h>
#include <stdbool.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "context.h"
#include <string.h>
#include <time.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "hdrline.h"
#include "curs_lib.h"
#include "format_flags.h"
#include "globals.h"
-#include "mbtable.h"
#include "mutt_curses.h"
#include "mutt_parse.h"
#include "mutt_thread.h"
#include <time.h>
#include "imap_private.h"
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <unistd.h>
#include "imap_private.h"
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <unistd.h>
#include "imap_private.h"
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "bcache.h"
#include "hcache/hcache.h"
#include "keymap.h"
#include "mailbox.h"
-#include "mbtable.h"
#include "menu.h"
#include "mutt_curses.h"
#include "mutt_history.h"
* @retval 0 Success
* @retval -1 Error
*/
-static int check_charset(struct Option *opt, const char *val)
+static int check_charset(struct ConfigDef *opt, const char *val)
{
char *q = NULL, *s = mutt_str_strdup(val);
int rc = 0;
* @param src String to escape
* @retval num Number of bytes written to the buffer
*/
-static size_t escape_string(char *buf, size_t buflen, const char *src)
+static size_t escape_string2(char *buf, size_t buflen, const char *src)
{
char *p = buf;
* free_opt - Free an Option
* @param p Option to free
*/
-static void free_opt(struct Option *p)
+static void free_opt(struct ConfigDef *p)
{
switch (DTYPE(p->type))
{
*
* This function escapes and quotes the string value.
*/
-static void pretty_var(char *buf, size_t buflen, const char *option, const char *val)
+static void pretty_var2(char *buf, size_t buflen, const char *option, const char *val)
{
char *p = NULL;
*p++ = '=';
if (p - buf < buflen)
*p++ = '"';
- p += escape_string(p, buflen - (p - buf) + 1, val); /* \0 terminate it */
+ p += escape_string2(p, buflen - (p - buf) + 1, val); /* \0 terminate it */
if (p - buf < buflen)
*p++ = '"';
*p = '\0';
* restore_default - Restore the default of an Option
* @param p Option to reset
*/
-static void restore_default(struct Option *p)
+static void restore_default(struct ConfigDef *p)
{
switch (DTYPE(p->type))
{
* set_default - Set the default/initial value of a config item
* @param p Option to set
*/
-static void set_default(struct Option *p)
+static void set_default(struct ConfigDef *p)
{
switch (DTYPE(p->type))
{
val = myvar_get(myvar);
if (val)
{
- pretty_var(err->data, err->dsize, myvar, val);
+ pretty_var2(err->data, err->dsize, myvar, val);
break;
}
else
val = *((char **) MuttVars[idx].var);
/* user requested the value of this variable */
- pretty_var(err->data, err->dsize, MuttVars[idx].name, NONULL(val));
+ pretty_var2(err->data, err->dsize, MuttVars[idx].name, NONULL(val));
break;
}
else
/* user requested the value of this variable */
struct Regex *ptr = *(struct Regex **) MuttVars[idx].var;
const char *value = ptr ? ptr->pattern : NULL;
- pretty_var(err->data, err->dsize, MuttVars[idx].name, NONULL(value));
+ pretty_var2(err->data, err->dsize, MuttVars[idx].name, NONULL(value));
break;
}
{
if (query || (*s->dptr != '='))
{
- pretty_var(err->data, err->dsize, MuttVars[idx].name,
- NONULL((*(char **) MuttVars[idx].var)));
+ pretty_var2(err->data, err->dsize, MuttVars[idx].name,
+ NONULL((*(char **) MuttVars[idx].var)));
break;
}
*
* @note The caller must not free the Option.
*/
-bool mutt_option_get(const char *s, struct Option *opt)
+bool mutt_option_get(const char *s, struct ConfigDef *opt)
{
mutt_debug(2, " * mutt_option_get(%s)\n", s);
int idx = mutt_option_index(s);
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_option_set(const struct Option *val, struct Buffer *err)
+int mutt_option_set(const struct ConfigDef *val, struct Buffer *err)
{
mutt_debug(2, " * mutt_option_set()\n");
int idx = mutt_option_index(val->name);
* @retval 1 Success
* @retval 0 Error
*/
-int mutt_option_to_string(const struct Option *opt, char *val, size_t len)
+int mutt_option_to_string(const struct ConfigDef *opt, char *val, size_t len)
{
mutt_debug(2, " * mutt_option_to_string(%s)\n", NONULL((char *) opt->var));
int idx = mutt_option_index((const char *) opt->name);
else
return 0;
- escape_string(val, len - 1, tmp);
+ escape_string2(val, len - 1, tmp);
return 1;
}
myvarval = myvar_get(var);
if (myvarval)
{
- pretty_var(pt, buflen - (pt - buf), var, myvarval);
+ pretty_var2(pt, buflen - (pt - buf), var, myvarval);
return 1;
}
return 0; /* no such variable. */
#include <stddef.h>
#include <stdbool.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "conn/conn.h"
#include "mutt.h"
#include "addrbook.h"
MUTT_SET_RESET, /**< default is to reset all vars to default */
};
-/* forced redraw/resort types + other flags */
-#define R_NONE 0
-#define R_INDEX (1 << 0) /**< redraw the index menu (MENU_MAIN) */
-#define R_PAGER (1 << 1) /**< redraw the pager menu */
-#define R_PAGER_FLOW (1 << 2) /**< reflow line_info and redraw the pager menu */
-#define R_RESORT (1 << 3) /**< resort the mailbox */
-#define R_RESORT_SUB (1 << 4) /**< resort subthreads */
-#define R_RESORT_INIT (1 << 5) /**< resort from scratch */
-#define R_TREE (1 << 6) /**< redraw the thread tree */
-#define R_REFLOW (1 << 7) /**< reflow window layout and full redraw */
-#define R_SIDEBAR (1 << 8) /**< redraw the sidebar */
-#define R_MENU (1 << 9) /**< redraw all menus */
-#define R_BOTH (R_INDEX | R_PAGER)
-#define R_RESORT_BOTH (R_RESORT | R_RESORT_SUB)
-
-/* general flags, to be OR'd with the R_ flags above (so keep shifting..) */
-#define F_SENSITIVE (1 << 10)
-
-#define IS_SENSITIVE(x) (((x).flags & F_SENSITIVE) == F_SENSITIVE)
-
#define UL (unsigned long)
#define IP (intptr_t)
#endif /* _MAKEDOC */
/* This option is deprecated */
bool IgnoreLinearWhiteSpace = false;
-struct Option MuttVars[] = {
+struct ConfigDef MuttVars[] = {
/*++*/
{ "abort_noattach", DT_QUAD, R_NONE, &AbortNoattach, MUTT_NO },
{ NULL, 0, 0, 0, 0 },
};
-const struct Mapping SortMethods[] = {
- { "date", SORT_DATE },
- { "date-received", SORT_RECEIVED },
- { "date-sent", SORT_DATE },
- { "from", SORT_FROM },
- { "label", SORT_LABEL },
- { "mailbox-order", SORT_ORDER },
- { "score", SORT_SCORE },
- { "size", SORT_SIZE },
- { "spam", SORT_SPAM },
- { "subject", SORT_SUBJECT },
- { "threads", SORT_THREADS },
- { "to", SORT_TO },
- { NULL, 0 },
-};
-
-/* same as SortMethods, but with "threads" replaced by "date" */
-
-const struct Mapping SortAuxMethods[] = {
- { "date", SORT_DATE },
- { "date-received", SORT_RECEIVED },
- { "date-sent", SORT_DATE },
- { "from", SORT_FROM },
- { "label", SORT_LABEL },
- { "mailbox-order", SORT_ORDER },
- { "score", SORT_SCORE },
- { "size", SORT_SIZE },
- { "spam", SORT_SPAM },
- { "subject", SORT_SUBJECT },
- { "threads", SORT_DATE }, /* note: sort_aux == threads
- * isn't possible.
- */
- { "to", SORT_TO },
- { NULL, 0 },
-};
-
-const struct Mapping SortBrowserMethods[] = {
- { "alpha", SORT_SUBJECT },
- { "count", SORT_COUNT },
- { "date", SORT_DATE },
- { "desc", SORT_DESC },
- { "new", SORT_UNREAD },
- { "unread", SORT_UNREAD },
- { "size", SORT_SIZE },
- { "unsorted", SORT_ORDER },
- { NULL, 0 },
-};
-
-const struct Mapping SortAliasMethods[] = {
- { "address", SORT_ADDRESS },
- { "alias", SORT_ALIAS },
- { "unsorted", SORT_ORDER },
- { NULL, 0 },
-};
-
-const struct Mapping SortKeyMethods[] = {
- { "address", SORT_ADDRESS },
- { "date", SORT_DATE },
- { "keyid", SORT_KEYID },
- { "trust", SORT_TRUST },
- { NULL, 0 },
-};
-
-const struct Mapping SortSidebarMethods[] = {
- { "alpha", SORT_PATH },
- { "count", SORT_COUNT },
- { "desc", SORT_DESC },
- { "flagged", SORT_FLAGGED },
- { "mailbox-order", SORT_ORDER },
- { "name", SORT_PATH },
- { "new", SORT_UNREAD }, /* kept for compatibility */
- { "path", SORT_PATH },
- { "unread", SORT_UNREAD },
- { "unsorted", SORT_ORDER },
- { NULL, 0 },
-};
-
/* functions used to parse commands in a rc file */
static int parse_alias (struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
static int parse_alternates (struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
#include <sys/stat.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
+++ /dev/null
-/**
- * @file
- * Structure for managing a table of multibyte characters
- *
- * @authors
- * Copyright (C) 2017 Richard Russon <rich@flatcap.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/>.
- */
-
-#ifndef _MUTT_MBTABLE_H
-#define _MUTT_MBTABLE_H
-
-/**
- * struct MbTable - multibyte character table
- *
- * Allows for direct access to the individual multibyte characters in a
- * string. This is used for the FlagChars, FromChars, StatusChars and ToChars
- * option types.
- */
-struct MbTable
-{
- int len; /**< number of characters */
- char **chars; /**< the array of multibyte character strings */
- char *segmented_str; /**< each chars entry points inside this string */
- char *orig_str;
-};
-
-#endif /* _MUTT_MBTABLE_H */
MUTT_SAVE_OVERWRITE
};
-/**
- * enum QuadOptionResponse - Possible values of a QuadOption
- */
-enum QuadOptionResponse
-{
- MUTT_ABORT = -1,
- MUTT_NO,
- MUTT_YES,
- MUTT_ASKNO,
- MUTT_ASKYES
-};
-
/* flags for parse_spam_list */
#define MUTT_SPAM 1
#define MUTT_NOSPAM 2
#include <sys/stat.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "mutt_attach.h"
#include <stdbool.h>
#include <stdio.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "mutt_lua.h"
#include "mailbox.h"
-#include "mbtable.h"
#include "mutt_commands.h"
#include "mutt_options.h"
#include "muttlib.h"
int rc = -1;
const char *param = lua_tostring(l, -2);
mutt_debug(2, " * lua_mutt_set(%s)\n", param);
- struct Option opt;
+ struct ConfigDef opt;
char err_str[LONG_STRING];
struct Buffer err = { 0 };
err.data = err_str;
{
const char *param = lua_tostring(l, -1);
mutt_debug(2, " * lua_mutt_get(%s)\n", param);
- struct Option opt;
+ struct ConfigDef opt;
if (mutt_option_get(param, &opt))
{
#include <stdint.h>
struct Buffer;
+struct ConfigDef;
-#define DT_MASK 0x0f
-#define DT_BOOL 1 /**< boolean option */
-#define DT_NUMBER 2 /**< a number (short) */
-#define DT_STRING 3 /**< a string */
-#define DT_PATH 4 /**< a pathname */
-#define DT_QUAD 5 /**< quad-option (yes/no/ask-yes/ask-no) */
-#define DT_SORT 6 /**< sorting methods */
-#define DT_REGEX 7 /**< regular expressions */
-#define DT_MAGIC 8 /**< mailbox type */
-#define DT_SYNONYM 9 /**< synonym for another variable */
-#define DT_ADDRESS 10 /**< e-mail address */
-#define DT_MBTABLE 11 /**< multibyte char table */
-#define DT_LONG 12 /* a number (long) */
-#define DT_HCACHE 13 /**< header cache backend */
-#define DT_COMMAND 14 /**< A command*/
-
-#define DTYPE(x) ((x) &DT_MASK)
-
-/* subtypes */
-#define DT_SUBTYPE_MASK 0xff0
-#define DT_SORT_ALIAS 0x10
-#define DT_SORT_BROWSER 0x20
-#define DT_SORT_KEYS 0x40
-#define DT_SORT_AUX 0x80
-#define DT_SORT_SIDEBAR 0x100
-
-/* ... DT_REGEX */
-#define DT_REGEX_MATCH_CASE 0x010 /**< Case-sensitive matching */
-#define DT_REGEX_ALLOW_NOT 0x020 /**< Regex can begin with '!' */
-
-/**
- * struct Option - Definition of a user-variable
- */
-struct Option
-{
- const char *name; /**< User-visible name */
- unsigned int type; /**< Variable type, e.g. #DT_STRING */
- short flags; /**< Notification flags, e.g. #R_PAGER */
- void *var; /**< Pointer to the global variable */
- intptr_t initial; /**< Initial value */
-};
-
-int mutt_option_to_string(const struct Option *opt, char *val, size_t len);
-
-bool mutt_option_get(const char *s, struct Option *opt);
-int mutt_option_set(const struct Option *val, struct Buffer *err);
+int mutt_option_to_string(const struct ConfigDef *opt, char *val, size_t len);
+bool mutt_option_get(const char *s, struct ConfigDef *opt);
+int mutt_option_set(const struct ConfigDef *val, struct Buffer *err);
#endif /* _MUTT_OPTIONS_H */
#include <string.h>
#include <time.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "mutt_thread.h"
#include <sys/stat.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
int (*tags_commit) (struct Context *ctx, struct Header *hdr, char *buf);
};
-/**
- * enum MailboxFormat - Supported mailbox formats
- */
-enum MailboxFormat
-{
- MUTT_MBOX = 1,
- MUTT_MMDF,
- MUTT_MH,
- MUTT_MAILDIR,
- MUTT_NNTP,
- MUTT_IMAP,
- MUTT_NOTMUCH,
- MUTT_POP,
- MUTT_COMPRESSED,
-};
-
#define MMDF_SEP "\001\001\001\001\n"
void mbox_reset_atime(struct Context *ctx, struct stat *st);
#include <string.h>
#include <time.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "alias.h"
#include <time.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "pgp.h"
#include <sys/stat.h>
#include <time.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "smime.h"
#include <time.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "mutt_notmuch.h"
#include <unistd.h>
#include <wchar.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "pager.h"
#include <sys/stat.h>
#include <time.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <unistd.h>
#include "pop_private.h"
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <string.h>
#include "pop_private.h"
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <time.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <sys/stat.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "recvattach.h"
#include <stdio.h>
#include <string.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "alias.h"
#include <stdbool.h>
#include <stdlib.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "score.h"
#include <time.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "send.h"
* mutt_fetch_recips - Generate recpients for a reply email
* @param out Envelope to populate
* @param in Envelope of source email
- * @param flags Flags, e.g. SENDLISTREPLY
+ * @param flags Flags, e.g. SEND_LIST_REPLY
* @retval 0 Success
* @retval -1 Failure
*/
#include <time.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "mutt.h"
#include "sendlib.h"
#include <stdlib.h>
#include <string.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "sidebar.h"
#include "buffy.h"
#include "context.h"
#include <sys/stat.h>
#include <unistd.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "email/email.h"
#include "conn/conn.h"
#include "mutt.h"
#include <stdbool.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "where.h"
struct Address;
/* These Config Variables are only used in sort.c */
extern bool ReverseAlias;
-#define SORT_DATE 1 /**< the date the mail was sent. */
-#define SORT_SIZE 2
-#define SORT_SUBJECT 3
-#define SORT_ALPHA 3 /**< makedoc.c requires this */
-#define SORT_FROM 4
-#define SORT_ORDER 5 /**< the order the messages appear in the mailbox. */
-#define SORT_THREADS 6
-#define SORT_RECEIVED 7 /**< when the message were delivered locally */
-#define SORT_TO 8
-#define SORT_SCORE 9
-#define SORT_ALIAS 10
-#define SORT_ADDRESS 11
-#define SORT_KEYID 12
-#define SORT_TRUST 13
-#define SORT_SPAM 14
-#define SORT_COUNT 15
-#define SORT_UNREAD 16
-#define SORT_FLAGGED 17
-#define SORT_PATH 18
-#define SORT_LABEL 19
-#define SORT_DESC 20
-
-/* Sort and sort_aux are shorts, and are a composite of a
- * constant sort operation number and a set of compounded
- * bitflags.
- *
- * Everything below SORT_MASK is a constant. There's room for
- * SORT_MASK constant SORT_ values.
- *
- * Everything above is a bitflag. It's OK to move SORT_MASK
- * down by powers of 2 if we need more, so long as we don't
- * collide with the constants above. (Or we can just expand
- * sort and sort_aux to uint32_t.)
- */
-#define SORT_MASK ((1 << 8) - 1)
-#define SORT_REVERSE (1 << 8)
-#define SORT_LAST (1 << 9)
-
#define SORTCODE(x) (Sort & SORT_REVERSE) ? -(x) : x
typedef int sort_t(const void *a, const void *b);
#include "context.h"
#include "format_flags.h"
#include "globals.h"
-#include "mbtable.h"
#include "menu.h"
#include "mutt_window.h"
#include "muttlib.h"