Back to index

courier  0.68.2
Functions
reftest.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "rfc822.h"
#include "imaprefs.h"

Go to the source code of this file.

Functions

static void test1 ()
static void prtree (struct imap_refmsg *m)
static void prpc (struct imap_refmsgtable *mt)
static void test2 ()
static void test3 ()
static void test4 ()
static void test5 ()
static void prsubj (struct imap_refmsgtable *p)
static void test6 ()
static void test7 ()
static void test8 ()
static void test9 ()
static void test10 ()
int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 349 of file reftest.c.

{

#if HAVE_SETLOCALE
       setlocale(LC_ALL, "C");
#endif

       test1();
       test2();
       test3();
       test4();
       test5();
       test6();
       test7();
       test8();
       test9();
       test10();
       return (0);
}

Here is the call graph for this function:

static void prpc ( struct imap_refmsgtable mt) [static]

Definition at line 69 of file reftest.c.

{
       struct imap_refmsg *root=rfc822_threadgetroot(mt), *m;

       if (!root)
              return;

       for (m=root->firstchild; m; m=m->nextsib)
              prtree(m);

       printf("\n\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void prsubj ( struct imap_refmsgtable p) [static]

Definition at line 171 of file reftest.c.

{
       struct imap_subjlookup *s;
       int i;

       for (i=0; i<sizeof(p->subjtable)/sizeof(p->subjtable[0]); i++)
              for (s=p->subjtable[i]; s; s=s->nextsubj)
                     printf("subject(%s)=<%s>\n", s->subj,
                            s->msg->msgid ? s->msg->msgid:"");
       printf("\n\n");
}

Here is the caller graph for this function:

static void prtree ( struct imap_refmsg m) [static]

Definition at line 48 of file reftest.c.

{
       printf("<%s>", m->msgid ? m->msgid:"");

       if (m->isdummy)
       {
              printf(" (dummy)");
       }

       printf(".parent=");
       if (m->parent)
              printf("<%s>", m->parent->msgid ? m->parent->msgid:"");
       else
              printf("ROOT");

       printf("\n");

       for (m=m->firstchild; m; m=m->nextsib)
              prtree(m);
}

Here is the caller graph for this function:

static void test1 ( ) [static]

Definition at line 28 of file reftest.c.

{
struct imap_refmsgtable *mt=rfc822_threadalloc();
char   buf[20];

        strcpy(buf, "a@b");
        rfc822_threadallocmsg(mt, buf);
        strcpy(buf, "c@d");
        rfc822_threadallocmsg(mt, buf);

       printf("%s\n", (rfc822_threadsearchmsg(mt, "a@b")
                     ? "found":"not found"));
       printf("%s\n", (rfc822_threadsearchmsg(mt, "c@d")
                     ? "found":"not found"));
       printf("%s\n", (rfc822_threadsearchmsg(mt, "e@f")
                     ? "found":"not found"));

       rfc822_threadfree(mt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void test10 ( ) [static]

Definition at line 320 of file reftest.c.

{
       struct imap_refmsgtable *mt=rfc822_threadalloc();

       rfc822_threadmsg(mt, "<message1>", NULL,
                      "subject 1",
                      "Thu, 20 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<message4>", "<message1>",
                      "subject 2",
                      "Thu, 21 Jun 2000 14:41:58 -0700", 0, 6);

       rfc822_threadmsg(mt, "<message1>", NULL,
                      "subject 2",
                      "Thu, 21 Jun 2000 14:41:58 -0700", 0, 5);

       rfc822_threadmsg(mt, "<message4>", "<message1>",
                      "subject 2",
                      "Thu, 21 Jun 2000 14:41:58 -0700", 0, 6);

       rfc822_threadprune(mt);
       rfc822_threadsortsubj(rfc822_threadgetroot(mt));
       rfc822_threadgathersubj(mt, rfc822_threadgetroot(mt));
       rfc822_threadmergesubj(mt, rfc822_threadgetroot(mt));
       rfc822_threadsortbydate(mt);
       prpc(mt);
       rfc822_threadfree(mt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void test2 ( ) [static]

Definition at line 82 of file reftest.c.

{
       struct imap_refmsgtable *mt=rfc822_threadalloc();

       rfc822_threadmsg(mt, "<1>", NULL,
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<2>",
                      "<1>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<4>",
                      "<1> <2> <3>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       prpc(mt);
       rfc822_threadfree(mt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void test3 ( ) [static]

Definition at line 104 of file reftest.c.

{
       struct imap_refmsgtable *mt=rfc822_threadalloc();

       rfc822_threadmsg(mt, "<4>",
                      "<2> <1> <3>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<3>",
                      "<1> <2>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<2>",
                      "<1>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<1>", NULL,
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       prpc(mt);
       rfc822_threadfree(mt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void test4 ( ) [static]

Definition at line 131 of file reftest.c.

{
       struct imap_refmsgtable *mt=rfc822_threadalloc();

       rfc822_threadmsg(mt, "<1>", NULL,
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<2>", "<1>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<4>", "<1> <2> <3>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       prpc(mt);
       rfc822_threadprune(mt);
       prpc(mt);
       rfc822_threadfree(mt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void test5 ( ) [static]

Definition at line 153 of file reftest.c.

{
       struct imap_refmsgtable *mt=rfc822_threadalloc();

       rfc822_threadmsg(mt, "<4>", "<1> <2> <3>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<3>", NULL,
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       prpc(mt);
       rfc822_threadprune(mt);
       prpc(mt);
       rfc822_threadfree(mt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void test6 ( ) [static]

Definition at line 183 of file reftest.c.

{
       struct imap_refmsgtable *mt=rfc822_threadalloc();

       rfc822_threadmsg(mt, "<message1>", NULL,
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<message10>", NULL,
                      "subject 2",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 2);

       rfc822_threadmsg(mt, "<message3>", "<message2>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 3);

       rfc822_threadmsg(mt, "<message11>", NULL,
                      "Re: subject 4",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 4);

       rfc822_threadmsg(mt, "<message12>", NULL,
                      "subject 4",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 5);

       rfc822_threadmsg(mt, "<message13>", NULL,
                      "subject 5",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 6);

       rfc822_threadmsg(mt, "<message14>", NULL,
                      "re: subject 5",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 7);

       rfc822_threadprune(mt);
       rfc822_threadsortsubj(rfc822_threadgetroot(mt));
       rfc822_threadgathersubj(mt, rfc822_threadgetroot(mt));
       prpc(mt);
       prsubj(mt);
       rfc822_threadfree(mt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void test7 ( ) [static]

Definition at line 223 of file reftest.c.

{
       struct imap_refmsgtable *mt=rfc822_threadalloc();

       rfc822_threadmsg(mt, "<message1>", "<message1-dummy>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);

       rfc822_threadmsg(mt, "<message2>", "<message2-dummy>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:58 -0700", 0, 1);
       rfc822_threadprune(mt);
       rfc822_threadsortsubj(rfc822_threadgetroot(mt));
       rfc822_threadgathersubj(mt, rfc822_threadgetroot(mt));
       prpc(mt);
       prsubj(mt);
       rfc822_threadmergesubj(mt, rfc822_threadgetroot(mt));
       prpc(mt);
       rfc822_threadfree(mt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void test8 ( ) [static]

Definition at line 244 of file reftest.c.

{
       struct imap_refmsgtable *mt=rfc822_threadalloc();

       rfc822_threadmsg(mt, "<message4>", NULL,
                      "subject 2",
                      "Thu, 29 Jun 2000 14:41:51 -0700", 0, 1);

       rfc822_threadmsg(mt, "<message2>", NULL,
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:52 -0700", 0, 1);

       rfc822_threadmsg(mt, "<message1>", "<message1-dummy>",
                      "subject 1",
                      "Thu, 29 Jun 2000 14:41:53 -0700", 0, 1);

       rfc822_threadmsg(mt, "<message3>", NULL,
                      "Re: subject 2",
                      "Thu, 29 Jun 2000 14:41:54 -0700", 0, 1);

       rfc822_threadmsg(mt, "<message10>", NULL,
                      "subject 10",
                      "Thu, 29 Jun 2000 14:41:55 -0700", 0, 1);

       rfc822_threadmsg(mt, "<message11>", NULL,
                      "subject 10",
                      "Thu, 29 Jun 2000 14:41:56 -0700", 0, 1);

       rfc822_threadprune(mt);
       rfc822_threadsortsubj(rfc822_threadgetroot(mt));
       rfc822_threadgathersubj(mt, rfc822_threadgetroot(mt));
       prpc(mt);
       prsubj(mt);
       rfc822_threadmergesubj(mt, rfc822_threadgetroot(mt));
       prpc(mt);
       rfc822_threadfree(mt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void test9 ( ) [static]

Definition at line 282 of file reftest.c.

{
       struct imap_refmsgtable *mt=rfc822_threadalloc();

       rfc822_threadmsg(mt, "<message1>", NULL,
                      "subject 1",
                      "Thu, 20 Jun 2000 14:41:55 -0700", 0, 1);

       rfc822_threadmsg(mt, "<message2>", NULL,
                      "subject 1",
                      "Thu, 19 Jun 2000 14:41:51 -0700", 0, 2);

       rfc822_threadmsg(mt, "<message3>", NULL,
                      "subject 1",
                      "Thu, 21 Jun 2000 14:41:56 -0700", 0, 3);

       rfc822_threadmsg(mt, "<message4>", "<message2>",
                      "subject 2",
                      "Thu, 21 Jun 2000 14:41:54 -0700", 0, 6);

       rfc822_threadmsg(mt, "<message5>", "<message2>",
                      "subject 2",
                      "Thu, 21 Jun 2000 14:41:53 -0700", 0, 5);

       rfc822_threadmsg(mt, "<message6>", "<message2>",
                      "subject 2",
                      "Thu, 20 Jun 2000 14:41:52 -0700", 0, 4);


       rfc822_threadprune(mt);
       rfc822_threadsortsubj(rfc822_threadgetroot(mt));
       rfc822_threadgathersubj(mt, rfc822_threadgetroot(mt));
       rfc822_threadmergesubj(mt, rfc822_threadgetroot(mt));
       rfc822_threadsortbydate(mt);
       prpc(mt);
       rfc822_threadfree(mt);
}

Here is the call graph for this function:

Here is the caller graph for this function: