char **files = NULL;
fname[0] = 0;
- if (mutt_enter_fname_full(prompt, fname, sizeof(fname), 0, 1, &files,
+ if (mutt_enter_fname_full(prompt, fname, sizeof(fname), false, true, &files,
&numfiles, MUTT_SEL_MULTI) == -1 ||
*fname == '\0')
{
int pid = fork();
if (pid == 0)
{
- mutt_sig_unblock_system(0);
+ mutt_sig_unblock_system(false);
const int devnull = open("/dev/null", O_RDWR);
if (devnull < 0 || dup2(pout[0], STDIN_FILENO) < 0 ||
dup2(pin[1], STDOUT_FILENO) < 0 || dup2(devnull, STDERR_FILENO) < 0)
execle(EXECSHELL, "sh", "-c", Tunnel, NULL, mutt_envlist_getlist());
_exit(127);
}
- mutt_sig_unblock_system(1);
+ mutt_sig_unblock_system(true);
if (pid == -1)
{
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, int buffy,
- int multiple, char ***files, int *numfiles, int flags)
+int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, bool buffy,
+ bool multiple, char ***files, int *numfiles, int flags)
{
struct Event ch;
int mutt_do_pager(const char *banner, const char *tempfile, int do_color, struct Pager *info);
void mutt_edit_file(const char *editor, const char *file);
void mutt_endwin(void);
-int mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, int buffy, int multiple, char ***files, int *numfiles, int flags);
+int mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, bool buffy, bool multiple, char ***files, int *numfiles, int flags);
void mutt_flushinp(void);
void mutt_flush_macro_to_endcond(void);
void mutt_flush_unget_to_endcond(void);
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);
-#define mutt_enter_fname(A, B, C, D) mutt_enter_fname_full(A, B, C, D, 0, NULL, NULL, 0)
-#define mutt_enter_vfolder(A, B, C, D) mutt_enter_fname_full(A, B, C, D, 0, NULL, NULL, MUTT_SEL_VFOLDER)
+#define mutt_enter_fname(A, B, C, D) mutt_enter_fname_full(A, B, C, D, false, NULL, NULL, 0)
+#define mutt_enter_vfolder(A, B, C, D) mutt_enter_fname_full(A, B, C, D, false, NULL, NULL, MUTT_SEL_VFOLDER)
#define mutt_get_field(A, B, C, D) mutt_get_field_full(A, B, C, D, 0, NULL, NULL)
#define mutt_get_password(A, B, C) mutt_get_field_unbuffered(A, B, C, MUTT_PASS)
thepid = fork();
if (thepid == 0)
{
- mutt_sig_unblock_system(0);
+ mutt_sig_unblock_system(false);
if (in)
{
}
else if (thepid == -1)
{
- mutt_sig_unblock_system(1);
+ mutt_sig_unblock_system(true);
if (in)
{
int rc;
waitpid(pid, &rc, 0);
- mutt_sig_unblock_system(1);
+ mutt_sig_unblock_system(true);
rc = WIFEXITED(rc) ? WEXITSTATUS(rc) : -1;
return rc;
* mutt_sig_unblock_system - Restore previously blocked signals
* @param catch If true, restore previous SIGINT, SIGQUIT behaviour
*/
-void mutt_sig_unblock_system(int catch)
+void mutt_sig_unblock_system(bool catch)
{
if (!SysSignalsBlocked)
return;
void mutt_sig_exit_handler(int sig);
void mutt_sig_init(sig_handler_t sig_fn, sig_handler_t exit_fn);
void mutt_sig_unblock(void);
-void mutt_sig_unblock_system(int catch);
+void mutt_sig_unblock_system(bool catch);
#endif /* _MUTT_SIGNAL_H */
}
}
-struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, int init)
+struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, bool init)
{
struct MuttThread **array = NULL, *sort_key = NULL, *top = NULL, *tmp = NULL;
struct Header *oldsort_key = NULL;
}
}
-static void check_subjects(struct Context *ctx, int init)
+static void check_subjects(struct Context *ctx, bool init)
{
struct Header *cur = NULL;
struct MuttThread *tmp = NULL;
}
}
-void mutt_sort_threads(struct Context *ctx, int init)
+void mutt_sort_threads(struct Context *ctx, bool init)
{
struct Header *cur = NULL;
int i, oldsort, using_refs = 0;
Sort = SortAux;
if (!ctx->thread_hash)
- init = 1;
+ init = true;
if (init)
{
void mutt_draw_tree(struct Context *ctx);
void mutt_clear_threads(struct Context *ctx);
-struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, int init);
-void mutt_sort_threads(struct Context *ctx, int init);
+struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, bool init);
+void mutt_sort_threads(struct Context *ctx, bool init);
int mutt_parent_message(struct Context *ctx, struct Header *hdr, int find_root);
void mutt_set_virtual(struct Context *ctx);
struct Hash *mutt_make_id_hash(struct Context *ctx);
* @retval 0 Success
* @retval -1 Error
*/
-static int pgp_gpgme_extract_keys(gpgme_data_t keydata, FILE **fp, int dryrun)
+static int pgp_gpgme_extract_keys(gpgme_data_t keydata, FILE **fp, bool dryrun)
{
/* there's no side-effect free way to view key data in GPGME,
* so we import the key into a temporary keyring */
return;
}
- if (pgp_gpgme_extract_keys(keydata, &out, 0))
+ if (pgp_gpgme_extract_keys(keydata, &out, false))
{
mutt_error(_("Error extracting key data!\n"));
}
/* Invoke PGP if needed */
if (pgp_keyblock)
{
- pgp_gpgme_extract_keys(armored_data, &pgpout, 1);
+ pgp_gpgme_extract_keys(armored_data, &pgpout, true);
}
else if (!clearsign || (s->flags & MUTT_VERIFY))
{
* @param h Header of the email
* @retval true If sender is verified
*/
-static int verify_sender(struct Header *h)
+static bool verify_sender(struct Header *h)
{
struct Address *sender = NULL;
- unsigned int rc = 1;
+ bool rc = true;
if (h->env->from)
{
if (!at_sign)
{
if (strncmp(uid->email + 1, sender->mailbox, sender_length) == 0)
- rc = 0;
+ rc = false;
}
else
{
domainname_match =
(strncasecmp(tmp_email, tmp_sender, domainname_length) == 0);
if (mailbox_match && domainname_match)
- rc = 0;
+ rc = false;
}
}
}
* @retval -1 Error
* @retval -2 Error
*/
-static int smime_handle_cert_email(char *certificate, char *mailbox, int copy,
+static int smime_handle_cert_email(char *certificate, char *mailbox, bool copy,
char ***buffer, int *num)
{
char email[STRING];
if (certfile)
{
mutt_file_unlink(tempfname);
- if (smime_handle_cert_email(certfile, mbox, 0, NULL, NULL))
+ if (smime_handle_cert_email(certfile, mbox, false, NULL, NULL))
{
if (isendwin())
mutt_any_key_to_continue(NULL);
else
st = S_ERR; /* error */
- mutt_sig_unblock_system(1);
+ mutt_sig_unblock_system(true);
return st;
}
int i = Sort;
Sort = SortAux;
if (ctx->tree)
- ctx->tree = mutt_sort_subthreads(ctx->tree, 1);
+ ctx->tree = mutt_sort_subthreads(ctx->tree, true);
Sort = i;
OptSortSubthreads = false;
}
act.sa_flags = 0;
/* reset signals for the child; not really needed, but... */
- mutt_sig_unblock_system(0);
+ mutt_sig_unblock_system(false);
act.sa_handler = SIG_DFL;
act.sa_flags = 0;
sigemptyset(&act.sa_mask);
sigaction(SIGTSTP, &oldtstp, NULL);
/* reset SIGINT, SIGQUIT and SIGCHLD */
- mutt_sig_unblock_system(1);
+ mutt_sig_unblock_system(true);
rc = (thepid != -1) ? (WIFEXITED(rc) ? WEXITSTATUS(rc) : -1) : -1;