Mercurial > dovecot > core-2.2
annotate src/lib-storage/mail-search.h @ 568:f2aa58c2afd0 HEAD
SEARCH CHARSET support. Currently we do it through iconv() and only ASCII
characters are compared case-insensitively.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 03 Nov 2002 10:39:43 +0200 |
parents | 85ab93a7693b |
children | fd8888f6f037 |
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 | |
568
f2aa58c2afd0
SEARCH CHARSET support. Currently we do it through iconv() and only ASCII
Timo Sirainen <tss@iki.fi>
parents:
444
diff
changeset
|
63 void *context; |
f2aa58c2afd0
SEARCH CHARSET support. Currently we do it through iconv() and only ASCII
Timo Sirainen <tss@iki.fi>
parents:
444
diff
changeset
|
64 const char *hdr_field_name; /* for SEARCH_HEADER */ |
0 | 65 unsigned int not:1; |
66 | |
67 int result; | |
68 }; | |
69 | |
10
82b7de533f98
s/user_data/context/ and some s/Data/Context/
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
70 typedef void (*MailSearchForeachFunc)(MailSearchArg *arg, void *context); |
0 | 71 |
72 /* 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
|
73 MailSearchArg *mail_search_args_build(Pool pool, ImapArg *args, |
0 | 74 const char **error); |
75 | |
76 /* Reset the results in search arguments */ | |
77 void mail_search_args_reset(MailSearchArg *args); | |
78 | |
79 /* goes through arguments in list that don't have a result yet. | |
80 Returns 1 = search matched, -1 = search unmatched, 0 = don't know yet */ | |
81 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
|
82 void *context); |
0 | 83 |
84 /* Fills have_headers, have_body and have_text based on if such search | |
85 argument exists that needs to be checked. */ | |
86 void mail_search_args_analyze(MailSearchArg *args, int *have_headers, | |
87 int *have_body, int *have_text); | |
88 | |
89 #endif |