* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
int result = (*pa)->content->length - (*pb)->content->length;
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
int result = (*pa)->content->length - (*pb)->content->length;
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
int result = (*pa)->date_sent - (*pb)->date_sent;
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
int result = (*pa)->date_sent - (*pb)->date_sent;
if (!(*pb)->env->real_subj)
rc = compare_date_sent (pa, pb);
else
if (!(*pb)->env->real_subj)
rc = compare_date_sent (pa, pb);
else
* On the next call that pointer may get smashed so we copy the return value
* to our own memory space. */
* On the next call that pointer may get smashed so we copy the return value
* to our own memory space. */
- strncpy(fa,mutt_get_name ((*ppa)->env->to),sizeof(fa));
- fa[sizeof(fa)-1] = '\0';
+ strncpy (fa, mutt_get_name ((*ppa)->env->to), sizeof (fa));
+ fa[sizeof (fa) - 1] = '\0';
- strncpy(fb,mutt_get_name ((*ppb)->env->to),sizeof(fb));
- fb[sizeof(fb)-1] = '\0';
+ strncpy (fb, mutt_get_name ((*ppb)->env->to), sizeof (fb));
+ fb[sizeof (fb) - 1] = '\0';
* On the next call that pointer may get smashed so we copy the return value
* to our own memory space. */
* On the next call that pointer may get smashed so we copy the return value
* to our own memory space. */
- strncpy(fa,mutt_get_name ((*ppa)->env->from),sizeof(fa));
- fa[sizeof(fa)-1] = '\0';
+ strncpy (fa, mutt_get_name ((*ppa)->env->from), sizeof (fa));
+ fa[sizeof (fa) - 1] = '\0';
- strncpy(fb,mutt_get_name ((*ppb)->env->from),sizeof(fb));
- fb[sizeof(fb)-1] = '\0';
+ strncpy (fb, mutt_get_name ((*ppb)->env->from), sizeof (fb));
+ fb[sizeof (fb) - 1] = '\0';
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
int result = (*pa)->received - (*pb)->received;
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
int result = (*pa)->received - (*pb)->received;
- /* no need to auxsort because you will never have equality here */
- return (SORTCODE ((*ha)->index - (*hb)->index));
+ /* no need to auxsort because you will never have equality here */
+ return (SORTCODE ((*ha)->index - (*hb)->index));
}
int compare_spam (const void *a, const void *b)
{
HEADER **ppa = (HEADER **) a;
HEADER **ppb = (HEADER **) b;
}
int compare_spam (const void *a, const void *b)
{
HEADER **ppa = (HEADER **) a;
HEADER **ppb = (HEADER **) b;
/* Firstly, require spam attributes for both msgs */
/* to compare. Determine which msgs have one. */
/* Firstly, require spam attributes for both msgs */
/* to compare. Determine which msgs have one. */
- result = (strtoul((*ppa)->env->spam->data, &aptr, 10) -
- strtoul((*ppb)->env->spam->data, &bptr, 10));
+ result = (strtoul ((*ppa)->env->spam->data, &aptr, 10) -
+ strtoul ((*ppb)->env->spam->data, &bptr, 10));
/* If either aptr or bptr is equal to data, there is no numeric */
/* value for that spam attribute. In this case, compare lexically. */
if ((aptr == (*ppa)->env->spam->data) || (bptr == (*ppb)->env->spam->data))
/* If either aptr or bptr is equal to data, there is no numeric */
/* value for that spam attribute. In this case, compare lexically. */
if ((aptr == (*ppa)->env->spam->data) || (bptr == (*ppb)->env->spam->data))
/* Otherwise, we have numeric value for both attrs. If these values */
/* are equal, then we first fall back upon string comparison, then */
/* upon auxiliary sort. */
/* Otherwise, we have numeric value for both attrs. If these values */
/* are equal, then we first fall back upon string comparison, then */
/* upon auxiliary sort. */
- switch (method & SORT_MASK)
- {
- case SORT_RECEIVED:
- return (compare_date_received);
- case SORT_ORDER:
- return (compare_order);
- case SORT_DATE:
- return (compare_date_sent);
- case SORT_SUBJECT:
- return (compare_subject);
- case SORT_FROM:
- return (compare_from);
- case SORT_SIZE:
- return (compare_size);
- case SORT_TO:
- return (compare_to);
- case SORT_SCORE:
- return (compare_score);
- case SORT_SPAM:
- return (compare_spam);
- default:
- return (NULL);
+ switch (method & SORT_MASK) {
+ case SORT_RECEIVED:
+ return (compare_date_received);
+ case SORT_ORDER:
+ return (compare_order);
+ case SORT_DATE:
+ return (compare_date_sent);
+ case SORT_SUBJECT:
+ return (compare_subject);
+ case SORT_FROM:
+ return (compare_from);
+ case SORT_SIZE:
+ return (compare_size);
+ case SORT_TO:
+ return (compare_to);
+ case SORT_SCORE:
+ return (compare_score);
+ case SORT_SPAM:
+ return (compare_spam);
+ default:
+ return (NULL);
/* this function gets called by mutt_sync_mailbox(), which may have just
* deleted all the messages. the virtual message numbers are not updated
* in that routine, so we must make sure to zero the vcount member.
*/
ctx->vcount = 0;
mutt_clear_threads (ctx);
/* this function gets called by mutt_sync_mailbox(), which may have just
* deleted all the messages. the virtual message numbers are not updated
* in that routine, so we must make sure to zero the vcount member.
*/
ctx->vcount = 0;
mutt_clear_threads (ctx);
for (i = 0; i < ctx->msgcount; i++)
mutt_score_message (ctx, ctx->hdrs[i], 1);
}
unset_option (OPTNEEDRESCORE);
for (i = 0; i < ctx->msgcount; i++)
mutt_score_message (ctx, ctx->hdrs[i], 1);
}
unset_option (OPTNEEDRESCORE);
AuxSort = NULL;
/* if $sort_aux changed after the mailbox is sorted, then all the
subthreads need to be resorted */
AuxSort = NULL;
/* if $sort_aux changed after the mailbox is sorted, then all the
subthreads need to be resorted */
Sort = i;
unset_option (OPTSORTSUBTHREADS);
}
mutt_sort_threads (ctx, init);
}
else if ((sortfunc = mutt_get_sort_func (Sort)) == NULL ||
Sort = i;
unset_option (OPTSORTSUBTHREADS);
}
mutt_sort_threads (ctx, init);
}
else if ((sortfunc = mutt_get_sort_func (Sort)) == NULL ||
qsort ((void *) ctx->hdrs, ctx->msgcount, sizeof (HEADER *), sortfunc);
/* adjust the virtual message numbers */
ctx->vcount = 0;
qsort ((void *) ctx->hdrs, ctx->msgcount, sizeof (HEADER *), sortfunc);
/* adjust the virtual message numbers */
ctx->vcount = 0;