Back to index

courier  0.68.2
Classes | Functions
thread.h File Reference
#include "searchinfo.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  temp_sort_stack

Functions

int thread_orderedsubj (struct threadinfo *, struct threadinfo *)
void dothreadorderedsubj (struct searchinfo *, struct searchinfo *, const char *, int)
void dothreadreferences (struct searchinfo *, struct searchinfo *, const char *, int)
void free_temp_sort_stack (struct temp_sort_stack *)
void dosortmsgs (struct searchinfo *, struct searchinfo *, const char *, int)

Class Documentation

struct temp_sort_stack

Definition at line 24 of file thread.h.

Collaboration diagram for temp_sort_stack:
Class Members
struct temp_sort_stack * next
search_type type

Function Documentation

void dosortmsgs ( struct searchinfo ,
struct searchinfo ,
const char *  ,
int   
)

Definition at line 384 of file thread.c.

{
struct sortmsgs sm;
struct searchinfo *p;

       memset(&sm, 0, sizeof(sm));
       for (p=sihead; p; p=p->a)
              switch (p->type)     {
              case search_orderedsubj:
              case search_arrival:
              case search_cc:
              case search_date:
              case search_from:
              case search_size:
              case search_to:
                     ++sm.nfields;
                     break;
              default:
                     break;
              }
       search_internal(si, sihead, charset, isuid, sort_callback, &sm);
       if (sm.nmsgs > 0)
       {
       size_t i;
       struct sortmsginfo *o;

              /* Convert it to an array */

              sm.array= (struct sortmsginfo **)
                     malloc(sm.nmsgs * sizeof(struct sortmsginfo *));
              if (!sm.array)       write_error_exit(0);
              for (o=sm.list, i=0; o; o=o->next, i++)
                     sm.array[i]=o;

              /* Sort the array */

              qsort(sm.array, sm.nmsgs, sizeof(*sm.array), cmpsort);

              /* Print the array */

              for (i=0; i<sm.nmsgs; i++)
              {
                     writes(" ");
                     writen(sm.array[i]->n);
              }
       }
       free_sortmsgs(&sm);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dothreadorderedsubj ( struct searchinfo ,
struct searchinfo ,
const char *  ,
int   
)

Definition at line 158 of file thread.c.

{
struct os_struct     os;

       os_init(&os);
       search_internal(si, sihead, charset, isuid, thread_os_callback, &os);

       if (os.nmsgs > 0)    /* Found some messages */
       {
       size_t i;
       struct os_threadinfo *o;

              /* Convert it to an array */

              os.msgs= (struct os_threadinfo **)
                     malloc(os.nmsgs * sizeof(struct os_threadinfo *));
              if (!os.msgs) write_error_exit(0);
              for (o=os.list, i=0; o; o=o->next, i++)
                     os.msgs[i]=o;

              /* Sort the array */

              qsort(os.msgs, os.nmsgs, sizeof(*os.msgs), cmpsubjs);

              /* Print the array */

              printos(os.msgs, os.nmsgs);
       }
       os_free(&os);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dothreadreferences ( struct searchinfo ,
struct searchinfo ,
const char *  ,
int   
)

Definition at line 210 of file thread.c.

{
       struct imap_refmsgtable *reftable;
       struct imap_refmsg *root;

       if (!(reftable=rfc822_threadalloc()))
       {
              write_error_exit(0);
              return;
       }

       search_internal(si, sihead, charset, 0,
                     thread_ref_callback, reftable);

       root=rfc822_thread(reftable);
       printthread(root, isuid);
       rfc822_threadfree(reftable);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 314 of file thread.c.

{
       while (t)
       {
       struct temp_sort_stack *u=t->next;

              free(t);
              t=u;
       }
}

Here is the caller graph for this function:

int thread_orderedsubj ( struct threadinfo *  ,
struct threadinfo *   
)