Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/lib-storage/mail-search.h @ 444:85ab93a7693b HEAD
ImapArgList changed from linked list to array. easier to handle that way.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 17 Oct 2002 01:50:21 +0300 |
parents | e057845d94ca |
children | f2aa58c2afd0 |
rev | line source |
---|---|
0 | 1 #ifndef __MAIL_SEARCH_H |
2 #define __MAIL_SEARCH_H | |
3 | |
4 #include "imap-parser.h" | |
5 #include "mail-storage.h" | |
6 | |
7 typedef enum { | |
8 SEARCH_OR, | |
9 SEARCH_SUB, | |
10 | |
11 /* message sets */ | |
12 SEARCH_ALL, | |
13 SEARCH_SET, | |
14 SEARCH_UID, | |
15 | |
16 /* flags */ | |
17 SEARCH_ANSWERED, | |
18 SEARCH_DELETED, | |
19 SEARCH_DRAFT, | |
20 SEARCH_FLAGGED, | |
21 SEARCH_SEEN, | |
22 SEARCH_RECENT, | |
23 SEARCH_KEYWORD, | |
24 | |
25 /* dates */ | |
26 SEARCH_BEFORE, | |
27 SEARCH_ON, | |
28 SEARCH_SINCE, | |
29 SEARCH_SENTBEFORE, | |
30 SEARCH_SENTON, | |
31 SEARCH_SENTSINCE, | |
32 | |
33 /* sizes */ | |
34 SEARCH_SMALLER, | |
35 SEARCH_LARGER, | |
36 | |
37 /* headers */ | |
38 SEARCH_FROM, | |
39 SEARCH_TO, | |
40 SEARCH_CC, | |
41 SEARCH_BCC, | |
42 SEARCH_SUBJECT, | |
43 SEARCH_HEADER, | |
44 | |
45 /* body */ | |
46 SEARCH_BODY, | |
408
e057845d94ca
Dropped sent_time and alignment from MailIndexRecord. SEARCH can now use
Timo Sirainen <tss@iki.fi>
parents:
10
diff
changeset
|
47 SEARCH_TEXT, |
e057845d94ca
Dropped sent_time and alignment from MailIndexRecord. SEARCH can now use
Timo Sirainen <tss@iki.fi>
parents:
10
diff
changeset
|
48 |
e057845d94ca
Dropped sent_time and alignment from MailIndexRecord. SEARCH can now use
Timo Sirainen <tss@iki.fi>
parents:
10
diff
changeset
|
49 /* our shortcuts for headers */ |
e057845d94ca
Dropped sent_time and alignment from MailIndexRecord. SEARCH can now use
Timo Sirainen <tss@iki.fi>
parents:
10
diff
changeset
|
50 SEARCH_IN_REPLY_TO, |
e057845d94ca
Dropped sent_time and alignment from MailIndexRecord. SEARCH can now use
Timo Sirainen <tss@iki.fi>
parents:
10
diff
changeset
|
51 SEARCH_MESSAGE_ID |
0 | 52 } MailSearchArgType; |
53 | |
54 struct _MailSearchArg { | |
55 MailSearchArg *next; | |
56 | |
57 MailSearchArgType type; | |
58 union { | |
59 MailSearchArg *subargs; | |
60 const char *str; | |
61 } value; | |
62 | |
63 const char *hdr_value; /* for SEARCH_HEADER */ | |
64 unsigned int not:1; | |
65 | |
66 int result; | |
67 }; | |
68 | |
10
82b7de533f98
s/user_data/context/ and some s/Data/Context/
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
69 typedef void (*MailSearchForeachFunc)(MailSearchArg *arg, void *context); |
0 | 70 |
71 /* Builds search arguments based on IMAP arguments. */ | |
444
85ab93a7693b
ImapArgList changed from linked list to array. easier to handle that way.
Timo Sirainen <tss@iki.fi>
parents:
408
diff
changeset
|
72 MailSearchArg *mail_search_args_build(Pool pool, ImapArg *args, |
0 | 73 const char **error); |
74 | |
75 /* Reset the results in search arguments */ | |
76 void mail_search_args_reset(MailSearchArg *args); | |
77 | |
78 /* goes through arguments in list that don't have a result yet. | |
79 Returns 1 = search matched, -1 = search unmatched, 0 = don't know yet */ | |
80 int mail_search_args_foreach(MailSearchArg *args, MailSearchForeachFunc func, | |
10
82b7de533f98
s/user_data/context/ and some s/Data/Context/
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
81 void *context); |
0 | 82 |
83 /* Fills have_headers, have_body and have_text based on if such search | |
84 argument exists that needs to be checked. */ | |
85 void mail_search_args_analyze(MailSearchArg *args, int *have_headers, | |
86 int *have_body, int *have_text); | |
87 | |
88 #endif |