#define RSORT(x) (SortAlias & SORT_REVERSE) ? -x : x
-static struct mapping_t AliasHelp[] = {
+static const struct mapping_t AliasHelp[] = {
{ N_("Exit"), OP_EXIT },
{ N_("Del"), OP_DELETE },
{ N_("Undel"), OP_UNDELETE },
#include <errno.h>
#include <locale.h>
-static struct mapping_t FolderHelp[] = {
+static const struct mapping_t FolderHelp[] = {
{ N_("Exit"), OP_EXIT },
{ N_("Chdir"), OP_CHANGE_DIRECTORY },
{ N_("Mask"), OP_ENTER_MASK },
* a preferred MIME name is given.
*/
-static struct
+static const const struct
{
- char *key;
- char *pref;
+ const char *key;
+ const char *pref;
}
PreferredMIMENames[] =
{
static COLOR_LIST *ColorList = NULL;
static int UserColors = 0;
-static struct mapping_t Colors[] =
+static const struct mapping_t Colors[] =
{
{ "black", COLOR_BLACK },
{ "blue", COLOR_BLUE },
#endif /* HAVE_COLOR */
-static struct mapping_t Fields[] =
+static const struct mapping_t Fields[] =
{
{ "hdrdefault", MT_COLOR_HDEFAULT },
{ "quoted", MT_COLOR_QUOTED },
#ifdef USE_SLANG_CURSES
static char *get_color_name (char *dest, size_t destlen, int val)
{
- static char * missing[3] = {"brown", "lightgray", "default"};
+ static const char * const missing[3] = {"brown", "lightgray", "default"};
int i;
switch (val)
#define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */
#define W (COLS - HDR_XOFFSET)
-static char *Prompts[] =
+static const char * const Prompts[] =
{
"From: ",
"To: ",
"Fcc: "
};
-static struct mapping_t ComposeHelp[] = {
+static const struct mapping_t ComposeHelp[] = {
{ N_("Send"), OP_COMPOSE_SEND_MESSAGE },
{ N_("Abort"), OP_EXIT },
{ "To", OP_COMPOSE_EDIT_TO },
* General helper functions.
*/
-/* return true when S pints to a didgit or letter. */
+/* return true when s points to a digit or letter. */
static int
digit_or_letter (const unsigned char *s)
{
static void
print_dn_parts (FILE *fp, struct dn_array_s *dn)
{
- const char *stdpart[] = {
+ static const char * const stdpart[] = {
"CN", "OU", "O", "STREET", "L", "ST", "C", NULL
};
int any=0, any2=0, i;
return (ch == ctrl ('G') ? err : ret);
}
-int _mutt_get_field (/* const */ char *field, char *buf, size_t buflen, int complete, int multiple, char ***files, int *numfiles)
+int _mutt_get_field (const char *field, char *buf, size_t buflen, int complete, int multiple, char ***files, int *numfiles)
{
int ret;
int x, y;
do
{
CLEARLINE (LINES-1);
- addstr (field);
+ addstr ((char *)field); /* cast to get around bad prototypes */
mutt_refresh ();
getyx (stdscr, y, x);
ret = _mutt_enter_string (buf, buflen, y, x, complete, multiple, files, numfiles, es);
menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
}
-static struct mapping_t IndexHelp[] = {
+static const struct mapping_t IndexHelp[] = {
{ N_("Quit"), OP_QUIT },
{ N_("Del"), OP_DELETE },
{ N_("Undel"), OP_UNDELETE },
{
time_t g;
- static int AccumDaysPerMonth[12] = {
+ static const int AccumDaysPerMonth[12] = {
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
};
void mutt_normalize_time (struct tm *tm)
{
- static char DaysPerMonth[12] = {
+ static const char DaysPerMonth[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
int nLeap;
*/
static inline int is_shell_char(wchar_t ch)
{
- static wchar_t shell_chars[] = L"<>&()$?*;{}| "; /* ! not included because it can be part of a pathname in Mutt */
+ static const wchar_t shell_chars[] = L"<>&()$?*;{}| "; /* ! not included because it can be part of a pathname in Mutt */
return wcschr(shell_chars, ch) != NULL;
}
# include "doc/makedoc-defs.h"
#endif
-struct binding_t OpGeneric[] = { /* map: generic */
+const struct binding_t OpGeneric[] = { /* map: generic */
/*
** <para>
** The <emphasis>generic</emphasis> menu is not a real menu, but specifies common functions
{ NULL, 0, NULL }
};
-struct binding_t OpMain[] = { /* map: index */
+const struct binding_t OpMain[] = { /* map: index */
{ "create-alias", OP_CREATE_ALIAS, "a" },
{ "bounce-message", OP_BOUNCE_MESSAGE, "b" },
{ "break-thread", OP_MAIN_BREAK_THREAD, "#" },
{ NULL, 0, NULL }
};
-struct binding_t OpPager[] = { /* map: pager */
+const struct binding_t OpPager[] = { /* map: pager */
{ "break-thread", OP_MAIN_BREAK_THREAD, "#" },
{ "create-alias", OP_CREATE_ALIAS, "a" },
{ "bounce-message", OP_BOUNCE_MESSAGE, "b" },
{ NULL, 0, NULL }
};
-struct binding_t OpAttach[] = { /* map: attachment */
+const struct binding_t OpAttach[] = { /* map: attachment */
{ "bounce-message", OP_BOUNCE_MESSAGE, "b" },
{ "display-toggle-weed", OP_DISPLAY_HEADERS, "h" },
{ "edit-type", OP_EDIT_TYPE, "\005" },
{ NULL, 0, NULL }
};
-struct binding_t OpCompose[] = { /* map: compose */
+const struct binding_t OpCompose[] = { /* map: compose */
{ "attach-file", OP_COMPOSE_ATTACH_FILE, "a" },
{ "attach-message", OP_COMPOSE_ATTACH_MESSAGE, "A" },
{ "edit-bcc", OP_COMPOSE_EDIT_BCC, "b" },
{ NULL, 0, NULL }
};
-struct binding_t OpPost[] = { /* map: postpone */
+const struct binding_t OpPost[] = { /* map: postpone */
{ "delete-entry", OP_DELETE, "d" },
{ "undelete-entry", OP_UNDELETE, "u" },
{ NULL, 0, NULL }
};
-struct binding_t OpAlias[] = { /* map: alias */
+const struct binding_t OpAlias[] = { /* map: alias */
{ "delete-entry", OP_DELETE, "d" },
{ "undelete-entry", OP_UNDELETE, "u" },
{ NULL, 0, NULL }
/* The file browser */
-struct binding_t OpBrowser[] = { /* map: browser */
+const struct binding_t OpBrowser[] = { /* map: browser */
{ "change-dir", OP_CHANGE_DIRECTORY, "c" },
{ "display-filename", OP_BROWSER_TELL, "@" },
{ "enter-mask", OP_ENTER_MASK, "m" },
};
/* External Query Menu */
-struct binding_t OpQuery[] = { /* map: query */
+const struct binding_t OpQuery[] = { /* map: query */
{ "create-alias", OP_CREATE_ALIAS, "a" },
{ "mail", OP_MAIL, "m" },
{ "query", OP_QUERY, "Q" },
{ NULL, 0, NULL }
};
-struct binding_t OpEditor[] = { /* map: editor */
+const struct binding_t OpEditor[] = { /* map: editor */
{ "bol", OP_EDITOR_BOL, "\001" },
{ "backward-char", OP_EDITOR_BACKWARD_CHAR, "\002" },
{ "backward-word", OP_EDITOR_BACKWARD_WORD, "\033b"},
-struct binding_t OpPgp[] = { /* map: pgp */
+const struct binding_t OpPgp[] = { /* map: pgp */
{ "verify-key", OP_VERIFY_KEY, "c" },
{ "view-name", OP_VIEW_ID, "%" },
{ NULL, 0, NULL }
/* When using the GPGME based backend we have some useful functions
for the SMIME menu. */
-struct binding_t OpSmime[] = { /* map: smime */
+const struct binding_t OpSmime[] = { /* map: smime */
#ifdef CRYPT_BACKEND_GPGME
{ "verify-key", OP_VERIFY_KEY, "c" },
{ "view-name", OP_VIEW_ID, "%" },
#ifdef MIXMASTER
-struct binding_t OpMix[] = { /* map: mixmaster */
+const struct binding_t OpMix[] = { /* map: mixmaster */
{ "accept", OP_MIX_USE, M_ENTER_S },
{ "append", OP_MIX_APPEND, "a" },
{ "insert", OP_MIX_INSERT, "i" },
#ifdef MAIN_C
-const char *Weekdays[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
-const char *Months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "ERR" };
+const char * const Weekdays[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
+const char * const Months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "ERR" };
-const char *BodyTypes[] = { "x-unknown", "audio", "application", "image", "message", "model", "multipart", "text", "video" };
-const char *BodyEncodings[] = { "x-unknown", "7bit", "8bit", "quoted-printable", "base64", "binary", "x-uuencoded" };
+const char * const BodyTypes[] = { "x-unknown", "audio", "application", "image", "message", "model", "multipart", "text", "video" };
+const char * const BodyEncodings[] = { "x-unknown", "7bit", "8bit", "quoted-printable", "base64", "binary", "x-uuencoded" };
#else
-extern const char *Weekdays[];
-extern const char *Months[];
+extern const char * const Weekdays[];
+extern const char * const Months[];
#endif
#ifdef MAIN_C
typedef int (*handler_t) (BODY *, STATE *);
-int Index_hex[128] = {
+const int Index_hex[128] = {
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1
};
-int Index_64[128] = {
+const int Index_64[128] = {
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
RICH_INDENT, RICH_INDENT_RIGHT, RICH_EXCERPT, RICH_CENTER, RICH_FLUSHLEFT,
RICH_FLUSHRIGHT, RICH_COLOR, RICH_LAST_TAG };
-static struct {
+static const struct {
const wchar_t *tag_name;
int index;
} EnrichedTags[] = {
#include <ctype.h>
#include <string.h>
-static struct binding_t *help_lookupFunction (int op, int menu)
+static const struct binding_t *help_lookupFunction (int op, int menu)
{
int i;
- struct binding_t *map;
+ const struct binding_t *map;
if (menu != MENU_PAGER)
{
}
char *
-mutt_compile_help (char *buf, size_t buflen, int menu, struct mapping_t *items)
+mutt_compile_help (char *buf, size_t buflen, int menu, const struct mapping_t *items)
{
int i;
size_t len;
static void dump_menu (FILE *f, int menu)
{
struct keymap_t *map;
- struct binding_t *b;
+ const struct binding_t *b;
char buf[SHORT_STRING];
/* browse through the keymap table */
}
static void dump_unbound (FILE *f,
- struct binding_t *funcs,
+ const struct binding_t *funcs,
struct keymap_t *map,
struct keymap_t *aux)
{
{
char t[_POSIX_PATH_MAX];
char buf[SHORT_STRING];
- char *desc;
+ const char *desc;
FILE *f;
- struct binding_t *funcs;
+ const struct binding_t *funcs;
mutt_mktemp (t, sizeof (t));
#include "imap_private.h"
#include "auth.h"
-static imap_auth_t imap_authenticators[] = {
+static const imap_auth_t imap_authenticators[] = {
#ifdef USE_SASL
{ imap_auth_sasl, NULL },
#else
* authentication method if specified, or any. */
int imap_authenticate (IMAP_DATA* idata)
{
- imap_auth_t* authenticator;
+ const imap_auth_t* authenticator;
char* methods;
char* method;
char* delim;
static void cmd_parse_search (IMAP_DATA* idata, const char* s);
static void cmd_parse_status (IMAP_DATA* idata, char* s);
-static char *Capabilities[] = {
+static const char * const Capabilities[] = {
"IMAP4",
"IMAP4rev1",
"STATUS",
int rc, mfhrc, oldmsgcount;
int fetchlast = 0;
int maxuid = 0;
- const char *want_headers = "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL";
+ static const char * const want_headers = "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL";
progress_t progress;
int retval = -1;
#include "charset.h"
#include "imap_private.h"
-static int Index_64[128] = {
+static const int Index_64[128] = {
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, 63,-1,-1,-1,
41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
};
-static char B64Chars[64] = {
+static const char B64Chars[64] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
* surround string with quotes, escape " and \ with \ */
void imap_quote_string (char *dest, size_t dlen, const char *src)
{
- char quote[] = "\"\\", *pt;
+ static const char quote[] = "\"\\";
+ char *pt;
const char *s;
pt = dest;
{
int query, unset, inv, reset, r = 0;
int idx = -1;
- char *p, scratch[_POSIX_PATH_MAX];
+ const char *p;
+ char scratch[_POSIX_PATH_MAX];
char* myvar;
while (MoreArgs (s))
{
if (query)
{
- char *vals[] = { "no", "yes", "ask-no", "ask-yes" };
+ 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) ]);
|| !mutt_strncmp (buffer, "reset", 5)
|| !mutt_strncmp (buffer, "toggle", 6))
{ /* complete variables */
- char *prefixes[] = { "no", "inv", "?", "&", 0 };
+ static const char * const prefixes[] = { "no", "inv", "?", "&", 0 };
pt++;
/* loop through all the possible prefixes (no, inv, ...) */
}
else if (!mutt_strncmp (buffer, "exec", 4))
{
- struct binding_t *menu = km_get_table (CurrentMenu);
+ const struct binding_t *menu = km_get_table (CurrentMenu);
if (!menu && CurrentMenu != MENU_PAGER)
menu = OpGeneric;
static int var_to_string (int idx, char* val, size_t len)
{
char tmp[LONG_STRING];
- char *vals[] = { "no", "yes", "ask-no", "ask-yes" };
+ static const char * const vals[] = { "no", "yes", "ask-no", "ask-yes" };
tmp[0] = '\0';
else if (DTYPE (MuttVars[idx].type) == DT_SORT)
{
const struct mapping_t *map;
- char *p;
+ const char *p;
switch (MuttVars[idx].type & DT_SUBTYPE_MASK)
{
return 0;
}
-char *mutt_getnamebyvalue (int val, const struct mapping_t *map)
+const char *mutt_getnamebyvalue (int val, const struct mapping_t *map)
{
int i;
int mutt_get_hook_type (const char *name)
{
- struct command_t *c;
+ const struct command_t *c;
for (c = Commands ; c->name ; c++)
if (c->func == mutt_parse_hook && ascii_strcasecmp (c->name, name) == 0)
unsigned long data;
};
-struct command_t Commands[] = {
+const struct command_t Commands[] = {
{ "alternates", parse_alternates, 0 },
{ "unalternates", parse_unalternates, 0 },
#ifdef USE_SOCKET
#include "functions.h"
-struct mapping_t Menus[] = {
+const struct mapping_t Menus[] = {
{ "alias", MENU_ALIAS },
{ "attach", MENU_ATTACH },
{ "browser", MENU_FOLDER },
km_bind (s, menu, op, NULL, NULL);
}
-static int get_op (struct binding_t *bindings, const char *start, size_t len)
+static int get_op (const struct binding_t *bindings, const char *start, size_t len)
{
int i;
return OP_NULL;
}
-static char *get_func (struct binding_t *bindings, int op)
+static char *get_func (const struct binding_t *bindings, int op)
{
int i;
* skip the '<' and the '>' when comparing */
for (i = 0; Menus[i].name; i++)
{
- struct binding_t *binding = km_get_table (Menus[i].value);
+ const struct binding_t *binding = km_get_table (Menus[i].value);
if (binding)
{
op = get_op (binding, pp + 1, l - 2);
if (tmp.op)
{
char *func = NULL;
- struct binding_t *bindings;
+ const struct binding_t *bindings;
/* is this a valid op for this menu? */
if ((bindings = km_get_table (menu)) &&
/* not reached */
}
-static void create_bindings (struct binding_t *map, int menu)
+static void create_bindings (const struct binding_t *map, int menu)
{
int i;
km_bindkey (map[i].seq, menu, map[i].op);
}
-char *km_keyname (int c)
+static const char *km_keyname (int c)
{
static char buf[10];
- char *p;
+ const char *p;
if ((p = mutt_getnamebyvalue (c, KeyNames)))
return p;
}
static int
-try_bind (char *key, int menu, char *func, struct binding_t *bindings)
+try_bind (char *key, int menu, char *func, const struct binding_t *bindings)
{
int i;
return (-1);
}
-struct binding_t *km_get_table (int menu)
+const struct binding_t *km_get_table (int menu)
{
switch (menu)
{
/* bind menu-name '<key_sequence>' function-name */
int mutt_parse_bind (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
{
- struct binding_t *bindings = NULL;
+ const struct binding_t *bindings = NULL;
char *key;
int menu[sizeof(Menus)/sizeof(struct mapping_t)-1], r = 0, nummenus, i;
{
int ops[128];
int nops = 0;
- struct binding_t *bindings = NULL;
+ const struct binding_t *bindings = NULL;
char *function;
if (!MoreArgs (s))
keycode_t *keys; /* key sequence */
};
-char *km_keyname (int);
int km_expand_key (char *, size_t, struct keymap_t *);
struct keymap_t *km_find_func (int, int);
void km_init (void);
/* dokey() records the last real key pressed */
extern int LastKey;
-extern struct mapping_t Menus[];
+extern const struct mapping_t Menus[];
struct binding_t
{
char *seq; /* default key binding */
};
-struct binding_t *km_get_table (int menu);
+const struct binding_t *km_get_table (int menu);
-extern struct binding_t OpGeneric[];
-extern struct binding_t OpPost[];
-extern struct binding_t OpMain[];
-extern struct binding_t OpAttach[];
-extern struct binding_t OpPager[];
-extern struct binding_t OpCompose[];
-extern struct binding_t OpBrowser[];
-extern struct binding_t OpEditor[];
-extern struct binding_t OpQuery[];
-extern struct binding_t OpAlias[];
+extern const struct binding_t OpGeneric[];
+extern const struct binding_t OpPost[];
+extern const struct binding_t OpMain[];
+extern const struct binding_t OpAttach[];
+extern const struct binding_t OpPager[];
+extern const struct binding_t OpCompose[];
+extern const struct binding_t OpBrowser[];
+extern const struct binding_t OpEditor[];
+extern const struct binding_t OpQuery[];
+extern const struct binding_t OpAlias[];
-extern struct binding_t OpPgp[];
+extern const struct binding_t OpPgp[];
-extern struct binding_t OpSmime[];
+extern const struct binding_t OpSmime[];
#ifdef MIXMASTER
-extern struct binding_t OpMix[];
+extern const struct binding_t OpMix[];
#endif
#include "keymap_defs.h"
#include "lib.h"
-static struct sysexits
+static const struct sysexits
{
int v;
const char *str;
return (fopen (path, mode));
}
-static char safe_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+@{}._-:%/";
+static const char safe_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+@{}._-:%/";
void mutt_sanitize_filename (char *f, short slash)
{
/* these characters must be escaped in regular expressions */
-static char rx_special_chars[] = "^.[$()|*+?{\\";
+static const char rx_special_chars[] = "^.[$()|*+?{\\";
int mutt_rx_sanitize_string (char *dest, size_t destlen, const char *src)
{
struct mapping_t
{
- char *name;
+ const char *name;
int value;
};
-char *mutt_getnamebyvalue (int, const struct mapping_t *);
-char *mutt_compile_help (char *, size_t, int, struct mapping_t *);
+const char *mutt_getnamebyvalue (int, const struct mapping_t *);
+char *mutt_compile_help (char *, size_t, int, const struct mapping_t *);
int mutt_getvaluebyname (const char *, const struct mapping_t *);
/* MIME encoding/decoding global vars */
#ifndef _SENDLIB_C
-extern int Index_hex[];
-extern int Index_64[];
-extern char B64Chars[];
+extern const int Index_hex[];
+extern const int Index_64[];
+extern const char B64Chars[];
#endif
#define hexval(c) Index_hex[(unsigned int)(c)]
static int interactive_check_cert (X509 *cert, int idx, int len)
{
- char *part[] =
+ static const char * const part[] =
{"/CN=", "/Email=", "/O=", "/OU=", "/L=", "/ST=", "/C="};
char helpstr[LONG_STRING];
char buf[STRING];
return cur;
}
-static struct mapping_t PagerHelp[] = {
+static const struct mapping_t PagerHelp[] = {
{ N_("Exit"), OP_EXIT },
{ N_("PrevPg"), OP_PREV_PAGE },
{ N_("NextPg"), OP_NEXT_PAGE },
{ NULL, 0 }
};
-static struct mapping_t PagerHelpExtra[] = {
+static const struct mapping_t PagerHelpExtra[] = {
{ N_("View Attachm."), OP_VIEW_ATTACHMENTS },
{ N_("Del"), OP_DELETE },
{ N_("Reply"), OP_REPLY },
return buf;
}
-static struct tz_t
+static const struct tz_t
{
char tzname[5];
unsigned char zhours;
static int eat_range (pattern_t *pat, BUFFER *, BUFFER *);
static int patmatch (const pattern_t *pat, const char *buf);
-static struct pattern_flags
+static const struct pattern_flags
{
int tag; /* character used to represent this op */
int op; /* operation to perform */
return regexec (pat->p.rx, buf, 0, NULL, 0);
}
-static struct pattern_flags *lookup_tag (char tag)
+static const struct pattern_flags *lookup_tag (char tag)
{
int i;
int alladdr = 0;
int or = 0;
int implicit = 1; /* used to detect logical AND operator */
- struct pattern_flags *entry;
+ const struct pattern_flags *entry;
char *p;
char *buf;
BUFFER ps;
static struct pgp_cache *id_defaults = NULL;
-static char trust_flags[] = "?- +";
+static const char trust_flags[] = "?- +";
static char *pgp_key_abilities (int flags)
{
#include <string.h>
#include <ctype.h>
-static struct
+static const struct
{
short id;
const char *name;
return POP_A_FAILURE;
}
-static pop_auth_t pop_authenticators[] = {
+static const pop_auth_t pop_authenticators[] = {
#ifdef USE_SASL
{ pop_auth_sasl, NULL },
#endif
int pop_authenticate (POP_DATA* pop_data)
{
ACCOUNT *acct = &pop_data->conn->account;
- pop_auth_t* authenticator;
+ const pop_auth_t* authenticator;
char* methods;
char* comma;
char* method;
#include <string.h>
#include <sys/stat.h>
-static struct mapping_t PostponeHelp[] = {
+static const struct mapping_t PostponeHelp[] = {
{ N_("Exit"), OP_EXIT },
{ N_("Del"), OP_DELETE },
{ N_("Undel"), OP_UNDELETE },
int mutt_enter_string (char *buf, size_t buflen, int y, int x, int flags);
int _mutt_enter_string (char *, size_t, int, int, int, int, char ***, int *, ENTER_STATE *);
#define mutt_get_field(A,B,C,D) _mutt_get_field(A,B,C,D,0,NULL,NULL)
-int _mutt_get_field (char *, char *, size_t, int, int, char ***, int *);
+int _mutt_get_field (const char *, char *, size_t, int, int, char ***, int *);
int mutt_get_hook_type (const char *);
int mutt_get_field_unbuffered (char *, char *, size_t, int);
#define mutt_get_password(A,B,C) mutt_get_field_unbuffered(A,B,C,M_PASS)
QUERY *data;
} ENTRY;
-static struct mapping_t QueryHelp[] = {
+static const struct mapping_t QueryHelp[] = {
{ N_("Exit"), OP_EXIT },
{ N_("Mail"), OP_MAIL },
{ N_("New Query"), OP_QUERY },
break; \
}
-static struct mapping_t AttachHelp[] = {
+static const struct mapping_t AttachHelp[] = {
{ N_("Exit"), OP_EXIT },
{ N_("Save"), OP_SAVE },
{ N_("Pipe"), OP_PIPE },
return 0;
}
-static struct mapping_t RemailerHelp[] =
+static const struct mapping_t RemailerHelp[] =
{
{ N_("Append"), OP_MIX_APPEND },
{ N_("Insert"), OP_MIX_INSERT },
static size_t q_encoder (char *s, ICONV_CONST char *d, size_t dlen,
const char *tocode)
{
- char hex[] = "0123456789ABCDEF";
+ static const char hex[] = "0123456789ABCDEF";
char *s0 = s;
memcpy (s, "=?", 2), s += 2;
int RFC822Error = 0;
/* these must defined in the same order as the numerated errors given in rfc822.h */
-const char *RFC822Errors[] = {
+const char * const RFC822Errors[] = {
"out of memory",
"mismatched parenthesis",
"mismatched quotes",
int rfc822_remove_from_adrlist (ADDRESS **a, const char *mailbox);
extern int RFC822Error;
-extern const char *RFC822Errors[];
+extern const char * const RFC822Errors[];
#define rfc822_error(x) RFC822Errors[x]
#define rfc822_new_address() safe_calloc(1,sizeof(ADDRESS))
const char MimeSpecials[] = "@.,;:<>[]\\\"()?/= \t";
-char B64Chars[64] = {
+const char B64Chars[64] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
#include <ctype.h>
-static struct mapping_t UrlMap[] =
+static const struct mapping_t UrlMap[] =
{
{ "file", U_FILE },
{ "imap", U_IMAP },