projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make rx_t be chaine-able so that we can get rid of list2_t (stage 1).
[apps/madmutt.git]
/
thread.c
diff --git
a/thread.c
b/thread.c
index
6d2b649
..
09bd915
100644
(file)
--- a/
thread.c
+++ b/
thread.c
@@
-7,21
+7,12
@@
* please see the file GPL in the top level source directory.
*/
* please see the file GPL in the top level source directory.
*/
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <lib-lib/mem.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
#include "mutt.h"
#include "sort.h"
#include "thread.h"
#include "mutt.h"
#include "sort.h"
#include "thread.h"
-
-#include <string.h>
-#include <ctype.h>
-
#define VISIBLE(hdr, ctx) (hdr->virtual >= 0 || (hdr->collapsed && (!ctx->pattern || hdr->limited)))
/* determine whether a is a descendant of b */
#define VISIBLE(hdr, ctx) (hdr->virtual >= 0 || (hdr->collapsed && (!ctx->pattern || hdr->limited)))
/* determine whether a is a descendant of b */
@@
-244,11
+235,11
@@
void mutt_draw_tree (CONTEXT * ctx)
new_tree = p_new(char, (2 + depth * width));
if (start_depth > 1) {
memcpy(new_tree, pfx, (start_depth - 1) * width);
new_tree = p_new(char, (2 + depth * width));
if (start_depth > 1) {
memcpy(new_tree, pfx, (start_depth - 1) * width);
-
strfcpy
(new_tree + (start_depth - 1) * width,
-
arrow, (1 + depth - start_depth) * width + 2
);
+
m_strcpy
(new_tree + (start_depth - 1) * width,
+
(1 + depth - start_depth) * width + 2, arrow
);
}
else
}
else
-
strfcpy (new_tree, arrow, 2 + depth * width
);
+
m_strcpy(new_tree, 2 + depth * width, arrow
);
tree->message->tree = new_tree;
}
}
tree->message->tree = new_tree;
}
}
@@
-316,12
+307,12
@@
void mutt_draw_tree (CONTEXT * ctx)
* has no message, we have to make a list of all the subjects of its
* most immediate existing descendants. we also note the earliest
* date on any of the parents and put it in *dateptr. */
* has no message, we have to make a list of all the subjects of its
* most immediate existing descendants. we also note the earliest
* date on any of the parents and put it in *dateptr. */
-static
LIST
*make_subject_list (THREAD * cur, time_t * dateptr)
+static
string_list_t
*make_subject_list (THREAD * cur, time_t * dateptr)
{
THREAD *start = cur;
ENVELOPE *env;
time_t thisdate;
{
THREAD *start = cur;
ENVELOPE *env;
time_t thisdate;
-
LIST
*curlist, *oldlist, *newlist, *subjects = NULL;
+
string_list_t
*curlist, *oldlist, *newlist, *subjects = NULL;
int rc = 0;
for (;;) {
int rc = 0;
for (;;) {
@@
-345,7
+336,7
@@
static LIST *make_subject_list (THREAD * cur, time_t * dateptr)
break;
}
if (!curlist || rc > 0) {
break;
}
if (!curlist || rc > 0) {
- newlist = p_new(
LIST
, 1);
+ newlist = p_new(
string_list_t
, 1);
newlist->data = env->real_subj;
if (oldlist) {
newlist->next = oldlist->next;
newlist->data = env->real_subj;
if (oldlist) {
newlist->next = oldlist->next;
@@
-378,7
+369,7
@@
static THREAD *find_subject (CONTEXT * ctx, THREAD * cur)
struct hash_elem *ptr;
THREAD *tmp, *last = NULL;
int hash;
struct hash_elem *ptr;
THREAD *tmp, *last = NULL;
int hash;
-
LIST
*subjects = NULL, *oldlist;
+
string_list_t
*subjects = NULL, *oldlist;
time_t date = 0;
subjects = make_subject_list (cur, &date);
time_t date = 0;
subjects = make_subject_list (cur, &date);
@@
-685,7
+676,7
@@
void mutt_sort_threads (CONTEXT * ctx, int init)
HEADER *cur;
int i, oldsort, using_refs = 0;
THREAD *thread, *new, *tmp, top;
HEADER *cur;
int i, oldsort, using_refs = 0;
THREAD *thread, *new, *tmp, top;
-
LIST
*ref = NULL;
+
string_list_t
*ref = NULL;
/* set Sort to the secondary method to support the set sort_aux=reverse-*
* settings. The sorting functions just look at the value of
/* set Sort to the secondary method to support the set sort_aux=reverse-*
* settings. The sorting functions just look at the value of
@@
-1236,7
+1227,7
@@
HASH *mutt_make_subj_hash (CONTEXT * ctx)
static void clean_references (THREAD * brk, THREAD * cur)
{
THREAD *p;
static void clean_references (THREAD * brk, THREAD * cur)
{
THREAD *p;
-
LIST
*ref = NULL;
+
string_list_t
*ref = NULL;
int done = 0;
for (; cur; cur = cur->next, done = 0) {
int done = 0;
for (; cur; cur = cur->next, done = 0) {
@@
-1261,7
+1252,7
@@
static void clean_references (THREAD * brk, THREAD * cur)
HEADER *h = cur->message;
/* clearing the References: header from obsolete Message-ID(s) */
HEADER *h = cur->message;
/* clearing the References: header from obsolete Message-ID(s) */
-
mutt_free_list
(&ref->next);
+
string_list_wipe
(&ref->next);
h->env->refs_changed = h->changed = 1;
}
h->env->refs_changed = h->changed = 1;
}
@@
-1270,8
+1261,8
@@
static void clean_references (THREAD * brk, THREAD * cur)
void mutt_break_thread (HEADER * hdr)
{
void mutt_break_thread (HEADER * hdr)
{
-
mutt_free_list
(&hdr->env->in_reply_to);
-
mutt_free_list
(&hdr->env->references);
+
string_list_wipe
(&hdr->env->in_reply_to);
+
string_list_wipe
(&hdr->env->references);
hdr->env->irt_changed = hdr->env->refs_changed = hdr->changed = 1;
clean_references (hdr->thread, hdr->thread->child);
}
hdr->env->irt_changed = hdr->env->refs_changed = hdr->changed = 1;
clean_references (hdr->thread, hdr->thread->child);
}
@@
-1283,7
+1274,7
@@
static int link_threads (HEADER * parent, HEADER * child, CONTEXT * ctx)
mutt_break_thread (child);
mutt_break_thread (child);
- child->env->in_reply_to =
mutt_new_list
();
+ child->env->in_reply_to =
string_item_new
();
child->env->in_reply_to->data = m_strdup(parent->env->message_id);
mutt_set_flag (ctx, child, M_TAG, 0);
child->env->in_reply_to->data = m_strdup(parent->env->message_id);
mutt_set_flag (ctx, child, M_TAG, 0);