/**
* check_certificate_by_digest - Validate a certificate by its digest
* @param peercert Certificate
- * @retval 1 Certificate is valid
- * @retval 0 Error
+ * @retval true Certificate is valid
+ * @retval false Error
*/
-static int check_certificate_by_digest(X509 *peercert)
+static bool check_certificate_by_digest(X509 *peercert)
{
return check_certificate_expiration(peercert, false) && check_certificate_file(peercert);
}
* @retval true User selected 'skip'
* @retval false Otherwise
*/
-static int interactive_check_cert(X509 *cert, int idx, size_t len, SSL *ssl, bool allow_always)
+static bool interactive_check_cert(X509 *cert, int idx, size_t len, SSL *ssl, bool allow_always)
{
static const int part[] = {
NID_commonName, /* CN */
* @retval true Certificate is valid
* @retval false Error, or Certificate is invalid
*
- * called for each certificate in the chain sent by the peer, starting from the
- * root; returning 1 means that the given certificate is trusted, returning 0
- * immediately aborts the SSL connection
+ * Called for each certificate in the chain sent by the peer, starting from the
+ * root; returning true means that the given certificate is trusted, returning
+ * false immediately aborts the SSL connection
*/
static int ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
{
int pos;
X509 *cert = NULL;
SSL *ssl = NULL;
- int skip_mode;
+ bool skip_mode;
ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
if (!ssl)
{
mutt_debug(1, "failed to retrieve SSL structure from X509_STORE_CTX\n");
- return 0;
+ return false;
}
host = SSL_get_ex_data(ssl, HostExDataIndex);
if (!host)
{
mutt_debug(1, "failed to retrieve hostname from SSL structure\n");
- return 0;
+ return false;
}
/* This is true when a previous entry in the certificate chain did
compare_certificates(cert, last_cert, last_cert_md, last_cert_mdlen))
{
mutt_debug(2, "ignoring duplicate skipped certificate.\n");
- return 1;
+ return true;
}
}
{
mutt_debug(2, "using cached certificate\n");
SSL_set_ex_data(ssl, SkipModeExDataIndex, NULL);
- return 1;
+ return true;
}
/* check hostname only for the leaf certificate */
{
mutt_debug(2, "digest check passed\n");
SSL_set_ex_data(ssl, SkipModeExDataIndex, NULL);
- return 1;
+ return true;
}
/* log verification error */
return interactive_check_cert(cert, pos, len, ssl, true);
}
- return 1;
+ return true;
}
/**
STAILQ_INSERT_TAIL(&AllMailboxes, mn, entries);
#ifdef USE_SIDEBAR
- mutt_sb_notify_mailbox(b, 1);
+ mutt_sb_notify_mailbox(b, true);
#endif
}
return 0;
(mutt_str_strcasecmp(buf, np->b->desc) == 0))
{
#ifdef USE_SIDEBAR
- mutt_sb_notify_mailbox(np->b, 0);
+ mutt_sb_notify_mailbox(np->b, false);
#endif
STAILQ_REMOVE(&AllMailboxes, np, MailboxNode, entries);
mailbox_free(&np->b);
/**
* mutt_aside_thread - Find the next/previous (sub)thread
* @param hdr Search from this message
- * @param dir Direction to search: 'true' forwards, 'false' backwards
+ * @param forwards Direction to search: 'true' forwards, 'false' backwards
* @param subthreads Search subthreads: 'true' subthread, 'false' not
* @retval num Index into the virtual email table
*/
-int mutt_aside_thread(struct Header *hdr, short dir, short subthreads)
+int mutt_aside_thread(struct Header *hdr, bool forwards, bool subthreads)
{
struct MuttThread *cur = NULL;
struct Header *tmp = NULL;
}
else
{
- if ((dir != 0) ^ ((Sort & SORT_REVERSE) != 0))
+ if (forwards ^ ((Sort & SORT_REVERSE) != 0))
{
while (!cur->next && cur->parent)
cur = cur->parent;
}
}
- if ((dir != 0) ^ ((Sort & SORT_REVERSE) != 0))
+ if (forwards ^ ((Sort & SORT_REVERSE) != 0))
{
do
{
#define MUTT_THREAD_NEXT_UNREAD (1 << 4)
#define MUTT_THREAD_FLAGGED (1 << 5)
-int mutt_aside_thread(struct Header *hdr, short dir, short subthreads);
-#define mutt_next_thread(x) mutt_aside_thread(x, 1, 0)
-#define mutt_previous_thread(x) mutt_aside_thread(x, 0, 0)
-#define mutt_next_subthread(x) mutt_aside_thread(x, 1, 1)
-#define mutt_previous_subthread(x) mutt_aside_thread(x, 0, 1)
+int mutt_aside_thread(struct Header *hdr, bool forwards, bool subthreads);
+#define mutt_next_thread(x) mutt_aside_thread(x, true, false)
+#define mutt_previous_thread(x) mutt_aside_thread(x, false, false)
+#define mutt_next_subthread(x) mutt_aside_thread(x, true, true)
+#define mutt_previous_subthread(x) mutt_aside_thread(x, false, true)
int mutt_traverse_thread(struct Context *ctx, struct Header *cur, int flag);
#define mutt_collapse_thread(x, y) mutt_traverse_thread(x, y, MUTT_THREAD_COLLAPSE)
* one in the list
* @retval ptr Head of the remaining Address List
*/
-static struct Address *remove_user(struct Address *a, int leave_only)
+static struct Address *remove_user(struct Address *a, bool leave_only)
{
struct Address *top = NULL, *last = NULL;
}
/* remove ourselves from the mail-followup-to header */
- e->mail_followup_to = remove_user(e->mail_followup_to, 0);
+ e->mail_followup_to = remove_user(e->mail_followup_to, false);
/* If we are not subscribed to any of the lists in question,
* re-add ourselves to the mail-followup-to header. The
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- mutt_sb_notify_mailbox(np->b, 1);
+ mutt_sb_notify_mailbox(np->b, true);
}
}
*
* Before a deletion, check that our pointers won't be invalidated.
*/
-void mutt_sb_notify_mailbox(struct Mailbox *b, int created)
+void mutt_sb_notify_mailbox(struct Mailbox *b, bool created)
{
if (!b)
return;
void mutt_sb_change_mailbox(int op);
void mutt_sb_draw(void);
const char *mutt_sb_get_highlight(void);
-void mutt_sb_notify_mailbox(struct Mailbox *b, int created);
+void mutt_sb_notify_mailbox(struct Mailbox *b, bool created);
void mutt_sb_set_mailbox_stats(const struct Context *ctx);
void mutt_sb_set_open_mailbox(void);
void mutt_sb_toggle_virtual(void);