more consts, less warnings.
13 files changed:
if (str_cmp ("builtin", Editor) != 0 &&
(op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
if (str_cmp ("builtin", Editor) != 0 &&
(op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
- char *tag = NULL, *err = NULL;
+ const char *tag = NULL, *err = NULL;
mutt_env_to_local (msg->env);
mutt_edit_headers (NONULL (Editor), msg->content->filename, msg,
mutt_env_to_local (msg->env);
mutt_edit_headers (NONULL (Editor), msg->content->filename, msg,
libimap_a_SOURCES = auth.c auth_login.c browse.c command.c imap.c imap.h mx_imap.h \
message.c utf7.c util.c mx_imap.c $(AUTHENTICATORS) $(GSSSOURCES)
libimap_a_SOURCES = auth.c auth_login.c browse.c command.c imap.c imap.h mx_imap.h \
message.c utf7.c util.c mx_imap.c $(AUTHENTICATORS) $(GSSSOURCES)
#endif
{imap_auth_login, "login"},
#endif
{imap_auth_login, "login"},
};
/* imap_authenticate: Attempt to authenticate using either user-specified
};
/* imap_authenticate: Attempt to authenticate using either user-specified
#include "auth.h"
/* imap_auth_login: Plain LOGIN support */
#include "auth.h"
/* imap_auth_login: Plain LOGIN support */
-imap_auth_res_t imap_auth_login (IMAP_DATA * idata, const char *method)
+imap_auth_res_t imap_auth_login(IMAP_DATA *idata, const char *method)
- char q_user[SHORT_STRING], q_pass[SHORT_STRING];
- char buf[STRING];
- int rc;
+ char q_user[SHORT_STRING], q_pass[SHORT_STRING];
+ char buf[STRING];
+ int rc;
- if (mutt_bit_isset (idata->capabilities, LOGINDISABLED)) {
- mutt_message _("LOGIN disabled on this server.");
+ if (mutt_bit_isset (idata->capabilities, LOGINDISABLED)) {
+ mutt_message _("LOGIN disabled on this server.");
- return IMAP_AUTH_UNAVAIL;
- }
+ return IMAP_AUTH_UNAVAIL;
+ }
- if (mutt_account_getlogin (&idata->conn->account))
- return IMAP_AUTH_FAILURE;
- if (mutt_account_getpass (&idata->conn->account))
- return IMAP_AUTH_FAILURE;
+ if (mutt_account_getlogin (&idata->conn->account))
+ return IMAP_AUTH_FAILURE;
+ if (mutt_account_getpass (&idata->conn->account))
+ return IMAP_AUTH_FAILURE;
- mutt_message _("Logging in...");
+ mutt_message _("Logging in...");
- imap_quote_string (q_user, sizeof (q_user), idata->conn->account.login);
- imap_quote_string (q_pass, sizeof (q_pass), idata->conn->account.pass);
+ imap_quote_string(q_user, sizeof(q_user), idata->conn->account.login);
+ imap_quote_string(q_pass, sizeof(q_pass), idata->conn->account.pass);
- snprintf (buf, sizeof (buf), "LOGIN %s %s", q_user, q_pass);
- rc = imap_exec (idata, buf, IMAP_CMD_FAIL_OK | IMAP_CMD_PASS);
+ snprintf(buf, sizeof(buf), "LOGIN %s %s", q_user, q_pass);
+ rc = imap_exec(idata, buf, IMAP_CMD_FAIL_OK | IMAP_CMD_PASS);
- if (!rc)
- return IMAP_AUTH_SUCCESS;
+ if (!rc)
+ return IMAP_AUTH_SUCCESS;
- mutt_error _("Login failed.");
+ mutt_error _("Login failed.");
- mutt_sleep (2);
- return IMAP_AUTH_FAILURE;
+ mutt_sleep (2);
+ return IMAP_AUTH_FAILURE;
static void cmd_parse_myrights (IMAP_DATA * idata, char *s);
static void cmd_parse_search (IMAP_DATA* idata, char* s);
static void cmd_parse_myrights (IMAP_DATA * idata, char *s);
static void cmd_parse_search (IMAP_DATA* idata, char* s);
-static char *Capabilities[] = {
+static const char *Capabilities[] = {
"IMAP4",
"IMAP4rev1",
"STATUS",
"IMAP4",
"IMAP4rev1",
"STATUS",
static int msg_parse_fetch (IMAP_HEADER * h, char *s);
static char *msg_parse_flags (IMAP_HEADER * h, char *s);
static int msg_parse_fetch (IMAP_HEADER * h, char *s);
static char *msg_parse_flags (IMAP_HEADER * h, char *s);
static int msg_fetch_header_fetch (CONTEXT * ctx, IMAP_HEADER * h, char *buf,
FILE * fp);
static size_t imap_hcache_keylen (const char *fn);
static int msg_fetch_header_fetch (CONTEXT * ctx, IMAP_HEADER * h, char *buf,
FILE * fp);
static size_t imap_hcache_keylen (const char *fn);
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";
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";
void *hc = NULL;
unsigned long *uid_validity = NULL;
char uid_buf[64];
void *hc = NULL;
unsigned long *uid_validity = NULL;
char uid_buf[64];
idata->reopen &= ~IMAP_NEWMAIL_PENDING;
idata->newMailCount = 0;
idata->reopen &= ~IMAP_NEWMAIL_PENDING;
idata->newMailCount = 0;
if ((hc = mutt_hcache_open (HeaderCache, ctx->path))) {
snprintf (buf, sizeof (buf),
if ((hc = mutt_hcache_open (HeaderCache, ctx->path))) {
snprintf (buf, sizeof (buf),
/* content built as a side-effect of mutt_read_rfc822_header */
ctx->hdrs[msgno]->content->length = h.content_length;
/* content built as a side-effect of mutt_read_rfc822_header */
ctx->hdrs[msgno]->content->length = h.content_length;
sprintf (uid_buf, "/%u", h.data->uid);
mutt_hcache_store (hc, uid_buf, ctx->hdrs[msgno], idata->uid_validity,
&imap_hcache_keylen);
sprintf (uid_buf, "/%u", h.data->uid);
mutt_hcache_store (hc, uid_buf, ctx->hdrs[msgno], idata->uid_validity,
&imap_hcache_keylen);
if ((mfhrc < -1) || ((rc != IMAP_CMD_CONTINUE) && (rc != IMAP_CMD_OK))) {
imap_free_header_data ((void *)&h.data);
fclose (fp);
if ((mfhrc < -1) || ((rc != IMAP_CMD_CONTINUE) && (rc != IMAP_CMD_OK))) {
imap_free_header_data ((void *)&h.data);
fclose (fp);
mutt_hcache_close (hc);
#endif /* USE_HCACHE */
return -1;
mutt_hcache_close (hc);
#endif /* USE_HCACHE */
return -1;
mutt_hcache_close (hc);
#endif /* USE_HCACHE */
mutt_hcache_close (hc);
#endif /* USE_HCACHE */
static size_t imap_hcache_keylen (const char *fn)
{
return str_len (fn);
static size_t imap_hcache_keylen (const char *fn)
{
return str_len (fn);
# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
libsane_a_SOURCES = mem.c exit.c str.c list.c rx.h debug.h \
mem.h exit.h str.h list.h rx.c debug.c intl.h
libsane_a_SOURCES = mem.c exit.c str.c list.c rx.h debug.h \
mem.h exit.h str.h list.h rx.c debug.c intl.h
libnntp_a_SOURCES = nntp.h mx_nntp.h \
nntp.c mx_nntp.c newsrc.c
libnntp_a_SOURCES = nntp.h mx_nntp.h \
nntp.c mx_nntp.c newsrc.c
* -2 - invalid command or execution error,
* -3 - error in funct(*line, *data).
*/
* -2 - invalid command or execution error,
* -3 - error in funct(*line, *data).
*/
-static int mutt_nntp_fetch (NNTP_DATA * nntp_data, char *query, char *msg,
+static int mutt_nntp_fetch (NNTP_DATA * nntp_data, const char *query, char *msg,
progress_t* bar, int (*funct) (char *, void *),
void *data, int tagged)
{
progress_t* bar, int (*funct) (char *, void *),
void *data, int tagged)
{
-static void nntp_get_desc (NNTP_DATA * data, char *mask, char *msg, progress_t* bar)
+static void nntp_get_desc (NNTP_DATA * data, const char *mask, char *msg, progress_t* bar)
noinst_HEADERS = pop.h mx_pop.h
libpop_a_SOURCES = pop.c pop_auth.c pop_lib.c pop.h mx_pop.h mx_pop.c
noinst_HEADERS = pop.h mx_pop.h
libpop_a_SOURCES = pop.c pop_auth.c pop_lib.c pop.h mx_pop.h mx_pop.c
int pop_parse_path (const char *, ACCOUNT *);
int pop_connect (POP_DATA *);
pop_query_status pop_open_connection (POP_DATA *);
int pop_parse_path (const char *, ACCOUNT *);
int pop_connect (POP_DATA *);
pop_query_status pop_open_connection (POP_DATA *);
-pop_query_status pop_query_d (POP_DATA *, char *, size_t, char *);
-pop_query_status pop_fetch_data (POP_DATA *, char *, progress_t*, int (*funct) (char *, void *),
- void *);
+pop_query_status pop_query_d (POP_DATA *, char *, size_t, const char *);
+pop_query_status pop_fetch_data (POP_DATA *, const char *, progress_t*,
+ int (*funct) (char *, void *), void *);
pop_query_status pop_reconnect (CONTEXT *);
void pop_logout (CONTEXT *);
void pop_error (POP_DATA *, char *);
pop_query_status pop_reconnect (CONTEXT *);
void pop_logout (CONTEXT *);
void pop_error (POP_DATA *, char *);
* -1 - conection lost,
* -2 - invalid command or execution error.
*/
* -1 - conection lost,
* -2 - invalid command or execution error.
*/
-pop_query_status pop_query_d (POP_DATA * pop_data, char *buf, size_t buflen, char *msg)
+pop_query_status pop_query_d (POP_DATA * pop_data, char *buf, size_t buflen, const char *msg)
{
int dbg = M_SOCK_LOG_CMD;
char *c;
{
int dbg = M_SOCK_LOG_CMD;
char *c;
* -2 - invalid command or execution error,
* -3 - error in funct(*line, *data)
*/
* -2 - invalid command or execution error,
* -3 - error in funct(*line, *data)
*/
-pop_query_status pop_fetch_data (POP_DATA * pop_data, char *query, progress_t* bar,
+pop_query_status pop_fetch_data (POP_DATA * pop_data, const char *query, progress_t* bar,
int (*funct) (char *, void *), void *data)
{
char buf[LONG_STRING];
int (*funct) (char *, void *), void *data)
{
char buf[LONG_STRING];
for (i = 0; i < ctx->msgcount; i++)
ctx->hdrs[i]->refno = -1;
for (i = 0; i < ctx->msgcount; i++)
ctx->hdrs[i]->refno = -1;
- ret = pop_fetch_data (pop_data, "UIDL\r\n", &bar, check_uidl, ctx);
+ ret = pop_fetch_data(pop_data, "UIDL\r\n", &bar, check_uidl, ctx);
if (ret == PQ_ERR) {
mutt_error ("%s", pop_data->err_msg);
mutt_sleep (2);
if (ret == PQ_ERR) {
mutt_error ("%s", pop_data->err_msg);
mutt_sleep (2);