* @param pfxp Prefix for the Address, e.g. "To:"
* @retval ptr Address in the Envelope
*/
-struct Address *mutt_get_address(struct Envelope *env, char **pfxp)
+struct Address *mutt_get_address(struct Envelope *env, const char **pfxp)
{
struct Address *addr = NULL;
- char *pfx = NULL;
+ const char *pfx = NULL;
if (mutt_addr_is_user(env->from))
{
struct Address *mutt_alias_lookup(const char *s);
void mutt_expand_aliases_env(struct Envelope *env);
struct Address *mutt_expand_aliases(struct Address *a);
-struct Address *mutt_get_address(struct Envelope *env, char **pfxp);
+struct Address *mutt_get_address(struct Envelope *env, const char **pfxp);
bool mutt_addr_is_user(struct Address *addr);
int mutt_alias_complete(char *buf, size_t buflen);
* The following code is shared between printing and piping.
*/
static int pipe_message(struct Header *h, char *cmd, bool decode, bool print,
- bool split, char *sep)
+ bool split, const char *sep)
{
int rc = 0;
pid_t thepid;
*/
void mutt_display_address(struct Envelope *env)
{
- char *pfx = NULL;
+ const char *pfx = NULL;
char buf[SHORT_STRING];
struct Address *addr = mutt_get_address(env, &pfx);
if ((mutt_str_strcmp("builtin", Editor) != 0) &&
(op == OP_COMPOSE_EDIT_HEADERS || (op == OP_COMPOSE_EDIT_MESSAGE && EditHeaders)))
{
- char *tag = NULL, *err = NULL;
+ const char *tag = NULL;
+ char *err = NULL;
mutt_env_to_local(msg->env);
mutt_edit_headers(NONULL(Editor), msg->content->filename, msg, fcc, fcclen);
if (mutt_env_to_intl(msg->env, &tag, &err))
*
* This puts events into the `UngetKeyEvents` buffer
*/
-void mutt_unget_string(char *s)
+void mutt_unget_string(const char *s)
{
- char *p = s + mutt_str_strlen(s) - 1;
+ const char *p = s + mutt_str_strlen(s) - 1;
while (p >= s)
{
* @retval >=0 0-based user selection
* @retval -1 Selection aborted
*/
-int mutt_multi_choice(char *prompt, char *letters)
+int mutt_multi_choice(const char *prompt, const char *letters)
{
struct Event ch;
int choice;
struct Event mutt_getch(void);
int mutt_get_field_full(const char *field, char *buf, size_t buflen, int complete, bool multiple, char ***files, int *numfiles);
int mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags);
-int mutt_multi_choice(char *prompt, char *letters);
+int mutt_multi_choice(const char *prompt, const char *letters);
void mutt_need_hard_redraw(void);
void mutt_paddstr(int n, const char *s);
void mutt_perror_debug(const char *s);
void mutt_simple_format(char *buf, size_t buflen, int min_width, int max_width, int justify, char pad_char, const char *s, size_t n, int arboreal);
int mutt_strwidth(const char *s);
void mutt_unget_event(int ch, int op);
-void mutt_unget_string(char *s);
+void mutt_unget_string(const char *s);
size_t mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width);
int mutt_yesorno(const char *msg, int def);
case 'v':
if (be_barf_file(path, buf, buflen) == 0)
{
- char *tag = NULL, *err = NULL;
+ const char *tag = NULL;
+ char *err = NULL;
be_free_memory(buf, buflen);
buf = NULL;
bufmax = 0;
*
* Run mutt_addrlist_to_intl() on each of the Address fields in the Envelope.
*/
-int mutt_env_to_intl(struct Envelope *env, char **tag, char **err)
+int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err)
{
int e = 0;
H_TO_INTL(return_path);
void mutt_env_free(struct Envelope **p);
void mutt_env_merge(struct Envelope *base, struct Envelope **extra);
struct Envelope *mutt_env_new(void);
-int mutt_env_to_intl(struct Envelope *env, char **tag, char **err);
+int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err);
void mutt_env_to_local(struct Envelope *e);
#endif /* _EMAIL_ENVELOPE_H */
*/
void mutt_parse_part(FILE *fp, struct Body *b)
{
- char *bound = NULL;
+ const char *bound = NULL;
switch (b->type)
{
encoder_t encoder = NULL;
char *tocode1 = NULL;
const char *tocode = NULL;
- char *icode = "utf-8";
+ const char *icode = "utf-8";
/* Try to convert to UTF-8. */
char *u = mutt_str_substr_dup(d, d + dlen);
* If the index is invalid, then a space character will be returned.
* If the character selected is '\n' (Ctrl-M), then "" will be returned.
*/
-static char *get_nth_wchar(struct MbTable *table, int index)
+static const char *get_nth_wchar(struct MbTable *table, int index)
{
if (!table || !table->chars || (index < 0) || (index >= table->len))
return " ";
if (!FromChars || !FromChars->chars || (FromChars->len == 0))
return long_prefixes[disp];
- char *pchar = get_nth_wchar(FromChars, disp);
+ const char *pchar = get_nth_wchar(FromChars, disp);
if (mutt_str_strlen(pchar) == 0)
return "";
{
struct HdrFormatInfo *hfi = (struct HdrFormatInfo *) data;
char fmt[SHORT_STRING], tmp[LONG_STRING], *p, *tags = NULL;
- char *wch = NULL;
+ const char *wch = NULL;
int i;
int optional = (flags & MUTT_FORMAT_OPTIONAL);
int threads = ((Sort & SORT_MASK) == SORT_THREADS);
case 'z':
if (src[0] == 's') /* status: deleted/new/old/replied */
{
- char *ch = NULL;
+ const char *ch = NULL;
if (hdr->deleted)
ch = get_nth_wchar(FlagChars, FlagCharDeleted);
else if (hdr->attach_del)
}
else if (src[0] == 'c') /* crypto */
{
- char *ch = NULL;
+ const char *ch = NULL;
if ((WithCrypto != 0) && (hdr->security & GOODSIGN))
ch = "S";
else if ((WithCrypto != 0) && (hdr->security & ENCRYPT))
}
else if (src[0] == 't') /* tagged, flagged, recipient */
{
- char *ch = NULL;
+ const char *ch = NULL;
if (hdr->tagged)
ch = get_nth_wchar(FlagChars, FlagCharTagged);
else if (hdr->flagged)
case 'Z':
{
/* New/Old for threads; replied; New/Old for messages */
- char *first = NULL;
+ const char *first = NULL;
if (threads && thread_is_new(ctx, hdr))
first = get_nth_wchar(FlagChars, FlagCharNewThread);
else if (threads && thread_is_old(ctx, hdr))
}
/* Marked for deletion; deleted attachments; crypto */
- char *second = NULL;
+ const char *second = NULL;
if (hdr->deleted)
second = get_nth_wchar(FlagChars, FlagCharDeleted);
else if (hdr->attach_del)
second = " ";
/* Tagged, flagged and recipient flag */
- char *third = NULL;
+ const char *third = NULL;
if (hdr->tagged)
third = get_nth_wchar(FlagChars, FlagCharTagged);
else if (hdr->flagged)
* @param name Attached/Inline, 'A', 'I'
* @retval 0 Always
*/
-static int print_attach_list(struct ListHead *h, char op, char *name)
+static int print_attach_list(struct ListHead *h, const char op, const char *name)
{
struct ListNode *np = NULL;
STAILQ_FOREACH(np, h, entries)
* Insert a key sequence into the specified map.
* The map is sorted by ASCII value (lowest to highest)
*/
-static int km_bind_err(char *s, int menu, int op, char *macro, char *desc, struct Buffer *err)
+static int km_bind_err(const char *s, int menu, int op, char *macro, char *desc, struct Buffer *err)
{
int retval = 0;
struct Keymap *last = NULL, *next = NULL;
* @retval 0 Success
* @retval -2 Error
*/
-static int km_bindkey_err(char *s, int menu, int op, struct Buffer *err)
+static int km_bindkey_err(const char *s, int menu, int op, struct Buffer *err)
{
return km_bind_err(s, menu, op, NULL, NULL, err);
}
* @retval 0 Success
* @retval -2 Error
*/
-static int km_bindkey(char *s, int menu, int op)
+static int km_bindkey(const char *s, int menu, int op)
{
return km_bindkey_err(s, menu, op, NULL);
}
*
* @note This returns a static string.
*/
-static char *get_func(const struct Binding *bindings, int op)
+static const char *get_func(const struct Binding *bindings, int op)
{
for (int i = 0; bindings[i].name; i++)
{
/* do we have an op already? */
if (tmp.op)
{
- char *func = NULL;
+ const char *func = NULL;
const struct Binding *bindings = NULL;
/* is this a valid op for this menu? */
*/
struct Binding
{
- char *name; /**< name of the function */
- int op; /**< function id number */
- char *seq; /**< default key binding */
+ const char *name; /**< name of the function */
+ int op; /**< function id number */
+ const char *seq; /**< default key binding */
};
const struct Binding *km_get_table(int menu);
*/
static void test_parse_set(void)
{
- char *vars[] = {
+ const char *vars[] = {
"from", // ADDRESS
"beep", // BOOL
"ispell", // COMMAND
"my_var", // MY_VAR
};
- char *commands[] = {
+ const char *commands[] = {
"set",
"toggle",
"reset",
"unset",
};
- char *tests[] = {
+ const char *tests[] = {
"%s %s", "%s %s=42", "%s %s?", "%s ?%s", "%s ?%s=42",
"%s ?%s?", "%s no%s", "%s no%s=42", "%s no%s?", "%s inv%s",
"%s inv%s=42", "%s inv%s?", "%s &%s", "%s &%s=42", "%s &%s?",
*/
struct AttachMatch
{
- char *major;
+ const char *major;
int major_int;
- char *minor;
+ const char *minor;
regex_t minor_regex;
};
* @param seed String to put in the Buffer
* @retval ptr New Buffer
*/
-struct Buffer *mutt_buffer_from(char *seed)
+struct Buffer *mutt_buffer_from(const char *seed)
{
struct Buffer *b = NULL;
size_t mutt_buffer_addstr(struct Buffer *buf, const char *s);
struct Buffer *mutt_buffer_alloc(size_t size);
void mutt_buffer_free(struct Buffer **p);
-struct Buffer *mutt_buffer_from(char *seed);
+struct Buffer *mutt_buffer_from(const char *seed);
struct Buffer *mutt_buffer_init(struct Buffer *b);
bool mutt_buffer_is_empty(const struct Buffer *buf);
struct Buffer *mutt_buffer_new(void);
char *buf = NULL, *ob = NULL;
size_t ibl, obl;
const char **inrepls = NULL;
- char *outrepl = NULL;
+ const char *outrepl = NULL;
if (mutt_ch_is_utf8(to))
outrepl = "\357\277\275";
*/
struct Command
{
- char *name; /**< Name of the command */
+ const char *name; /**< Name of the command */
command_t func; /**< Function to parse the command */
unsigned long data; /**< Data or flags to pass to the command */
};
char tmp[PATH_MAX];
char *t = NULL;
- char *tail = "";
+ const char *tail = "";
bool recurse = false;
*
* print the current time to avoid spoofing of the signature output
*/
-void crypt_current_time(struct State *s, char *app_name)
+void crypt_current_time(struct State *s, const char *app_name)
{
time_t t;
char p[STRING], tmp[STRING];
struct State;
void crypt_convert_to_7bit(struct Body *a);
-void crypt_current_time(struct State *s, char *app_name);
+void crypt_current_time(struct State *s, const char *app_name);
const char *crypt_get_fingerprint_or_id(char *p, const char **pphint, const char **ppl, const char **pps);
bool crypt_is_numerical_keyid(const char *s);
int crypt_write_signed(struct Body *a, struct State *s, const char *tempfile);
static int gpgme_send_menu(struct Header *msg, int is_smime)
{
struct CryptKeyInfo *p = NULL;
- char *prompt = NULL, *letters = NULL, *choices = NULL;
+ const char *prompt = NULL;
+ const char *letters = NULL;
+ const char *choices = NULL;
int choice;
if (is_smime)
int pgp_class_send_menu(struct Header *msg)
{
struct PgpKeyInfo *p = NULL;
- char *prompt = NULL, *letters = NULL, *choices = NULL;
+ const char *prompt = NULL;
+ const char *letters = NULL;
+ const char *choices = NULL;
char promptbuf[LONG_STRING];
int choice;
if (OptPgpCheckTrust && (!pgp_id_is_valid(KeyTable[menu->current]) ||
!pgp_id_is_strong(KeyTable[menu->current])))
{
- char *str = "";
+ const char *str = "";
char buf2[LONG_STRING];
if (KeyTable[menu->current]->flags & KEYFLAG_CANTUSE)
char buf[LONG_STRING];
char title[256];
struct Menu *menu = NULL;
- char *s = "";
+ const char *s = "";
bool done = false;
for (table_index = 0, key = keys; key; key = key->next)
int smime_class_send_menu(struct Header *msg)
{
struct SmimeKey *key = NULL;
- char *prompt = NULL, *letters = NULL, *choices = NULL;
+ const char *prompt = NULL;
+ const char *letters = NULL;
+ const char *choices = NULL;
int choice;
if (!(WithCrypto & APPLICATION_SMIME))
* @param acct Account
* @param src Path to add to the URL
*/
-static void cache_expand(char *dst, size_t dstlen, struct Account *acct, char *src)
+static void cache_expand(char *dst, size_t dstlen, struct Account *acct, const char *src)
{
char *c = NULL;
char file[PATH_MAX];
struct Url url;
mutt_account_tourl(acct, &url);
- url.path = src;
+ url.path = mutt_str_strdup(src);
url_tostring(&url, file, sizeof(file), U_PATH);
}
else
return -1;
}
-char *OverviewFmt = "Subject:\0"
- "From:\0"
- "Date:\0"
- "Message-ID:\0"
- "References:\0"
- "Content-Length:\0"
- "Lines:\0"
- "\0";
+const char *OverviewFmt = "Subject:\0"
+ "From:\0"
+ "Date:\0"
+ "Message-ID:\0"
+ "References:\0"
+ "Content-Length:\0"
+ "Lines:\0"
+ "\0";
/**
* nntp_attempt_features - Detect supported commands
return nntp_connect_error(nserv);
}
if (mutt_str_strncmp("215", buf, 3) != 0)
- nserv->overview_fmt = OverviewFmt;
+ nserv->overview_fmt = mutt_str_strdup(OverviewFmt);
else
{
int cont = 0;
* @retval -1 Connection lost
* @retval -2 Error
*/
-static int get_description(struct NntpData *nntp_data, char *wildmat, char *msg)
+static int get_description(struct NntpData *nntp_data, const char *wildmat, const char *msg)
{
char buf[STRING];
- char *cmd = NULL;
+ const char *cmd = NULL;
/* get newsgroup description, if possible */
struct NntpServer *nserv = nntp_data->nserv;
*
* @note This is a static string and must not be freed.
*/
-static char *query_type_to_string(enum NmQueryType query_type)
+static const char *query_type_to_string(enum NmQueryType query_type)
{
if (query_type == NM_QUERY_TYPE_THREADS)
return "threads";
* This function calls func(*line, *data) for each received line,
* func(NULL, *data) if rewind(*data) needs, exits when fail or done.
*/
-int pop_fetch_data(struct PopData *pop_data, char *query, struct Progress *progressbar,
+int pop_fetch_data(struct PopData *pop_data, const char *query, struct Progress *progressbar,
int (*func)(char *, void *), void *data)
{
char buf[LONG_STRING];
int pop_connect(struct PopData *pop_data);
int pop_open_connection(struct PopData *pop_data);
int pop_query_d(struct PopData *pop_data, char *buf, size_t buflen, char *msg);
-int pop_fetch_data(struct PopData *pop_data, char *query, struct Progress *progressbar,
+int pop_fetch_data(struct PopData *pop_data, const char *query, struct Progress *progressbar,
int (*func)(char *, void *), void *data);
int pop_reconnect(struct Context *ctx);
void pop_logout(struct Context *ctx);
* @retval 0 Success
* @retval -1 Failure
*/
-static int edit_address(struct Address **a, /* const */ char *field)
+static int edit_address(struct Address **a, const char *field)
{
char buf[HUGE_STRING];
char *err = NULL;
/* save current value of "pgp_sign_as" and "smime_default_key" */
char *pgp_signas = NULL;
char *smime_signas = NULL;
- char *tag = NULL, *err = NULL;
+ const char *tag = NULL;
+ char *err = NULL;
char *ctype = NULL;
char *finalpath = NULL;
bool TsSupported; /**< Terminal Setting is supported */
/* de facto standard escapes for tsl/fsl */
-static char *tsl = "\033]0;";
-static char *fsl = "\007";
+static const char *tsl = "\033]0;";
+static const char *fsl = "\007";
/**
* mutt_ts_capability - Check terminal capabilities
*/
bool mutt_ts_capability(void)
{
- char *known[] = {
+ const char *known[] = {
"color-xterm", "cygwin", "eterm", "kterm", "nxterm",
"putty", "rxvt", "screen", "xterm", NULL,
};
/* Check term types that are known to support the standard escape without
* necessarily asserting it in terminfo. */
const char *term = mutt_str_getenv("TERM");
- for (char **termp = known; termp; termp++)
+ for (const char **termp = known; termp; termp++)
{
if (term && *termp && (mutt_str_strncasecmp(term, *termp, strlen(*termp)) != 0))
return true;
{ /* integration */
char buf[256] = { 0 };
- char *per = "bobby bob";
- char *mbx = "bob@bobsdomain";
+ char per[64] = "bobby bob";
+ char mbx[64] = "bob@bobsdomain";
struct Address addr = {
.personal = per,
}
{ /* integration */
- char *per = "bobby bob";
- char *mbx = "bob@bobsdomain";
+ char per[64] = "bobby bob";
+ char mbx[64] = "bob@bobsdomain";
struct Address addr = {
.personal = per,
log_line(__func__);
const char *valid[] = { "hello@example.com", "world@example.com", NULL };
- char *name = "Damson";
+ const char *name = "Damson";
char *addr = NULL;
int rc;
log_line(__func__);
struct Address *a = address_create("hello@example.com");
- char *name = "Ilama";
+ const char *name = "Ilama";
char *addr = NULL;
bool result = false;
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Kumquat";
+ const char *name = "Kumquat";
if (!TEST_CHECK(cs_str_string_set(cs, name, "kumquat@example.com", err) != INT_MIN))
return false;
{
log_line(__func__);
- char *name = "Lemon";
+ const char *name = "Lemon";
mutt_buffer_reset(err);
struct Address *a = address_create("world@example.com");
bool result = false;
- char *name = "Nectarine";
+ const char *name = "Nectarine";
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "hello@example.com", err);
if (TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
"",
NULL,
};
- char *name = "Damson";
+ const char *name = "Damson";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Fig";
+ const char *name = "Fig";
bool value = true;
TEST_MSG("Setting %s to %d\n", name, value);
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Guava";
+ const char *name = "Guava";
VarGuava = true;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Hawthorn";
+ const char *name = "Hawthorn";
VarHawthorn = true;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Jackfruit";
+ const char *name = "Jackfruit";
VarJackfruit = false;
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "yes", err);
struct ToggleTest tests[] = { { false, true }, { true, false } };
- char *name = "Nectarine";
+ const char *name = "Nectarine";
int rc;
struct HashElem *he = cs_get_elem(cs, name);
log_line(__func__);
const char *valid[] = { "hello", "world", "world", "", NULL };
- char *name = "Damson";
+ const char *name = "Damson";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
log_line(__func__);
const char *valid[] = { "hello", "world", "world", "", NULL };
- char *name = "Jackfruit";
+ const char *name = "Jackfruit";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Mango";
+ const char *name = "Mango";
int rc = cs_str_string_set(cs, name, "mango", err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
{
log_line(__func__);
- char *name = "Nectarine";
+ const char *name = "Nectarine";
mutt_buffer_reset(err);
TEST_MSG("Initial: %s = '%s'\n", name, VarNectarine);
{
log_line(__func__);
- char *name = "Papaya";
+ const char *name = "Papaya";
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "hello", err);
if (TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
int longs[] = { -123, 0, -42, 456 };
const char *invalid[] = { "-9223372036854775809", "9223372036854775808", "junk", "", NULL };
- char *name = "Damson";
+ const char *name = "Damson";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Guava";
+ const char *name = "Guava";
long value = 12345;
TEST_MSG("Setting %s to %d\n", name, value);
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Ilama";
+ const char *name = "Ilama";
VarIlama = 3456;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Jackfruit";
+ const char *name = "Jackfruit";
VarJackfruit = 345;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Lemon";
+ const char *name = "Lemon";
VarLemon = 123;
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "456", err);
const char *valid[] = { "mbox", "mmdf", "mh", "maildir" };
const char *invalid[] = { "mbox2", "mm", "", NULL };
- char *name = "Damson";
+ const char *name = "Damson";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Fig";
+ const char *name = "Fig";
short value = MUTT_MAILDIR;
VarFig = MUTT_MBOX;
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Guava";
+ const char *name = "Guava";
VarGuava = MUTT_MAILDIR;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Hawthorn";
+ const char *name = "Hawthorn";
VarHawthorn = MUTT_MAILDIR;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Jackfruit";
+ const char *name = "Jackfruit";
VarJackfruit = MUTT_MBOX;
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "maildir", err);
log_line(__func__);
const char *valid[] = { "hello", "world", "world", "", NULL };
- char *name = "Damson";
+ const char *name = "Damson";
char *mb = NULL;
int rc;
log_line(__func__);
struct MbTable *t = mbtable_parse("hello");
- char *name = "Ilama";
+ const char *name = "Ilama";
char *mb = NULL;
bool result = false;
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Kumquat";
+ const char *name = "Kumquat";
int rc = cs_str_string_set(cs, name, "kumquat", err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
{
log_line(__func__);
- char *name = "Lemon";
+ const char *name = "Lemon";
mutt_buffer_reset(err);
struct MbTable *t = mbtable_parse("world");
bool result = false;
- char *name = "Nectarine";
+ const char *name = "Nectarine";
char *mb = NULL;
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "hello", err);
const char *valid[] = { "-123", "0", "-42", "456" };
int numbers[] = { -123, 0, -42, 456 };
const char *invalid[] = { "-32769", "32768", "junk", "", NULL };
- char *name = "Damson";
+ const char *name = "Damson";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Guava";
+ const char *name = "Guava";
short value = 12345;
TEST_MSG("Setting %s to %d\n", name, value);
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Ilama";
+ const char *name = "Ilama";
VarIlama = 3456;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Jackfruit";
+ const char *name = "Jackfruit";
VarJackfruit = 345;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Lemon";
+ const char *name = "Lemon";
VarLemon = 123;
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "456", err);
log_line(__func__);
const char *valid[] = { "hello", "world", "world", "", NULL };
- char *name = "Damson";
+ const char *name = "Damson";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
log_line(__func__);
const char *valid[] = { "hello", "world", "world", "", NULL };
- char *name = "Jackfruit";
+ const char *name = "Jackfruit";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Mango";
+ const char *name = "Mango";
int rc = cs_str_string_set(cs, name, "mango", err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
{
log_line(__func__);
- char *name = "Nectarine";
+ const char *name = "Nectarine";
mutt_buffer_reset(err);
TEST_MSG("Initial: %s = '%s'\n", name, VarNectarine);
{
log_line(__func__);
- char *name = "Papaya";
+ const char *name = "Papaya";
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "hello", err);
if (TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
"",
NULL,
};
- char *name = "Damson";
+ const char *name = "Damson";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Fig";
+ const char *name = "Fig";
char value = MUTT_YES;
TEST_MSG("Setting %s to %d\n", name, value);
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Guava";
+ const char *name = "Guava";
VarGuava = MUTT_YES;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Hawthorn";
+ const char *name = "Hawthorn";
VarHawthorn = MUTT_YES;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Jackfruit";
+ const char *name = "Jackfruit";
VarJackfruit = MUTT_NO;
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "yes", err);
{ MUTT_ASKYES, MUTT_ASKNO },
};
- char *name = "Nectarine";
+ const char *name = "Nectarine";
int rc;
struct HashElem *he = cs_get_elem(cs, name);
log_line(__func__);
const char *valid[] = { "hello.*", "world.*", "world.*", "", NULL };
- char *name = "Damson";
+ const char *name = "Damson";
char *regex = NULL;
int rc;
log_line(__func__);
struct Regex *r = regex_create("hello.*", 0, err);
- char *name = "Ilama";
+ const char *name = "Ilama";
char *regex = NULL;
bool result = false;
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Lemon";
+ const char *name = "Lemon";
int rc = cs_str_string_set(cs, name, "lemon.*", err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
{
log_line(__func__);
- char *name = "Mango";
+ const char *name = "Mango";
mutt_buffer_reset(err);
struct Regex *r = regex_create("world.*", 0, err);
bool result = false;
- char *name = "Papaya";
+ const char *name = "Papaya";
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "hello.*", err);
if (TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
};
// clang-format on
-char *name_list[] = {
+const char *name_list[] = {
"Damson", "Elderberry", "Fig", "Guava", "Hawthorn", "Ilama",
};
}
}
- char *name = "Kumquat";
+ const char *name = "Kumquat";
short value = SORT_THREADS;
VarKumquat = -1;
mutt_buffer_reset(err);
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Lemon";
+ const char *name = "Lemon";
VarLemon = SORT_THREADS;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Mango";
+ const char *name = "Mango";
VarMango = SORT_SUBJECT;
mutt_buffer_reset(err);
{
log_line(__func__);
- char *name = "Olive";
+ const char *name = "Olive";
VarOlive = SORT_SUBJECT;
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "threads", err);
log_line(__func__);
const char *name = "Raspberry";
- char *value = "alpha";
+ const char *value = "alpha";
mutt_buffer_reset(err);
TEST_MSG("Expect error for next test\n");
log_line(__func__);
const char *valid[] = { "hello", "world", "world", "", NULL };
- char *name = "Damson";
+ const char *name = "Damson";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
log_line(__func__);
const char *valid[] = { "hello", "world", "world", "", NULL };
- char *name = "Jackfruit";
+ const char *name = "Jackfruit";
int rc;
for (unsigned int i = 0; i < mutt_array_size(valid); i++)
static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
{
log_line(__func__);
- char *name = "Mango";
+ const char *name = "Mango";
int rc = cs_str_string_set(cs, name, "mango", err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
{
log_line(__func__);
- char *name = "Nectarine";
+ const char *name = "Nectarine";
mutt_buffer_reset(err);
TEST_MSG("Initial: %s = '%s'\n", name, VarNectarine);
{
log_line(__func__);
- char *name = "Papaya";
+ const char *name = "Papaya";
mutt_buffer_reset(err);
int rc = cs_str_string_set(cs, name, "hello", err);
if (TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
{
log_line(__func__);
- char *name = "Fig";
- char *value = "tree";
+ const char *name = "Fig";
+ const char *value = "tree";
mutt_buffer_reset(err);
int rc = cs_str_native_set(cs, name, (intptr_t) value, err);
{
log_line(__func__);
- char *name = "Jackfruit";
+ const char *name = "Jackfruit";
mutt_buffer_reset(err);
TEST_MSG("Initial: %s = '%s'\n", name, NONULL(VarIlama));