Use notmuch_bool_t instead of int for entire_thread, raw, and decrypt
boolean fields in notmuch_show_params_t. No functional changes.
Signed-off-by: Jani Nikula <jani@nikula.org>
} notmuch_show_format_t;
typedef struct notmuch_show_params {
} notmuch_show_format_t;
typedef struct notmuch_show_params {
- int entire_thread;
- int raw;
+ notmuch_bool_t entire_thread;
+ notmuch_bool_t raw;
int part;
#ifdef GMIME_ATLEAST_26
GMimeCryptoContext* cryptoctx;
#else
GMimeCipherContext* cryptoctx;
#endif
int part;
#ifdef GMIME_ATLEAST_26
GMimeCryptoContext* cryptoctx;
#else
GMimeCipherContext* cryptoctx;
#endif
+ notmuch_bool_t decrypt;
} notmuch_show_params_t;
/* There's no point in continuing when we've detected that we've done
} notmuch_show_params_t;
/* There's no point in continuing when we've detected that we've done
notmuch_show_params_t params = { .part = -1 };
int format = FORMAT_DEFAULT;
int reply_all = TRUE;
notmuch_show_params_t params = { .part = -1 };
int format = FORMAT_DEFAULT;
int reply_all = TRUE;
- notmuch_bool_t decrypt = FALSE;
notmuch_opt_desc_t options[] = {
{ NOTMUCH_OPT_KEYWORD, &format, "format", 'f',
notmuch_opt_desc_t options[] = {
{ NOTMUCH_OPT_KEYWORD, &format, "format", 'f',
(notmuch_keyword_t []){ { "all", TRUE },
{ "sender", FALSE },
{ 0, 0 } } },
(notmuch_keyword_t []){ { "all", TRUE },
{ "sender", FALSE },
{ 0, 0 } } },
- { NOTMUCH_OPT_BOOLEAN, &decrypt, "decrypt", 'd', 0 },
+ { NOTMUCH_OPT_BOOLEAN, ¶ms.decrypt, "decrypt", 'd', 0 },
else
reply_format_func = notmuch_reply_format_default;
else
reply_format_func = notmuch_reply_format_default;
#ifdef GMIME_ATLEAST_26
/* TODO: GMimePasswordRequestFunc */
params.cryptoctx = g_mime_gpg_context_new (NULL, "gpg");
#ifdef GMIME_ATLEAST_26
/* TODO: GMimePasswordRequestFunc */
params.cryptoctx = g_mime_gpg_context_new (NULL, "gpg");
#endif
if (params.cryptoctx) {
g_mime_gpg_context_set_always_trust ((GMimeGpgContext*) params.cryptoctx, FALSE);
#endif
if (params.cryptoctx) {
g_mime_gpg_context_set_always_trust ((GMimeGpgContext*) params.cryptoctx, FALSE);
+ params.decrypt = FALSE;
fprintf (stderr, "Failed to construct gpg context.\n");
}
#ifndef GMIME_ATLEAST_26
fprintf (stderr, "Failed to construct gpg context.\n");
}
#ifndef GMIME_ATLEAST_26
int format_specified = 0;
int i;
int format_specified = 0;
int i;
- params.entire_thread = 0;
- params.raw = 0;
+ params.entire_thread = FALSE;
+ params.raw = FALSE;
params.part = -1;
params.cryptoctx = NULL;
params.part = -1;
params.cryptoctx = NULL;
+ params.decrypt = FALSE;
argc--; argv++; /* skip subcommand argument */
argc--; argv++; /* skip subcommand argument */
format = &format_text;
} else if (strcmp (opt, "json") == 0) {
format = &format_json;
format = &format_text;
} else if (strcmp (opt, "json") == 0) {
format = &format_json;
- params.entire_thread = 1;
+ params.entire_thread = TRUE;
} else if (strcmp (opt, "mbox") == 0) {
format = &format_mbox;
mbox = 1;
} else if (strcmp (opt, "raw") == 0) {
format = &format_raw;
} else if (strcmp (opt, "mbox") == 0) {
format = &format_mbox;
mbox = 1;
} else if (strcmp (opt, "raw") == 0) {
format = &format_raw;
} else {
fprintf (stderr, "Invalid value for --format: %s\n", opt);
return 1;
} else {
fprintf (stderr, "Invalid value for --format: %s\n", opt);
return 1;
} else if (STRNCMP_LITERAL (argv[i], "--part=") == 0) {
params.part = atoi(argv[i] + sizeof ("--part=") - 1);
} else if (STRNCMP_LITERAL (argv[i], "--entire-thread") == 0) {
} else if (STRNCMP_LITERAL (argv[i], "--part=") == 0) {
params.part = atoi(argv[i] + sizeof ("--part=") - 1);
} else if (STRNCMP_LITERAL (argv[i], "--entire-thread") == 0) {
- params.entire_thread = 1;
+ params.entire_thread = TRUE;
} else if ((STRNCMP_LITERAL (argv[i], "--verify") == 0) ||
(STRNCMP_LITERAL (argv[i], "--decrypt") == 0)) {
if (params.cryptoctx == NULL) {
} else if ((STRNCMP_LITERAL (argv[i], "--verify") == 0) ||
(STRNCMP_LITERAL (argv[i], "--decrypt") == 0)) {
if (params.cryptoctx == NULL) {
#endif
}
if (STRNCMP_LITERAL (argv[i], "--decrypt") == 0)
#endif
}
if (STRNCMP_LITERAL (argv[i], "--decrypt") == 0)
} else {
fprintf (stderr, "Unrecognized option: %s\n", argv[i]);
return 1;
} else {
fprintf (stderr, "Unrecognized option: %s\n", argv[i]);
return 1;