1
/* $Id: Keys.h,v 1.13 2004/08/24 21:52:39 terpstra Exp $
3
* Keys.h - What prefixs various database keys
5
* Copyright (C) 2002 - Wesley W. Terpstra
9
* Authors: 'Wesley W. Terpstra' <wesley@terpstra.ca>
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; version 2.1.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34
// These must have length 1
35
#define LU_THREADING "t"
36
#define LU_KEYWORD "k"
37
#define LU_SUMMARY "s"
39
#define LU_NEW_TOPICS "n"
41
#define LU_MESSAGE_DELETED 'd'
42
#define LU_MESSAGE_AUTHOR_EMAIL 'e'
43
#define LU_MESSAGE_AUTHOR_NAME 'n'
44
#define LU_MESSAGE_SUBJECT 's'
45
#define LU_MESSAGE_MBOX 'x'
47
/* special keywords */
48
#define LU_KEYWORD_DELETED "id:deleted" /* a deleted message */
50
/* fields indexed early */
51
#define LU_KEYWORD_EVERYTHING "id:any" /* empty search */
52
#define LU_KEYWORD_MESSAGE_ID "id:" /* Message id */
53
#define LU_KEYWORD_REPLY_TO "rt:" /* Reply-to */
54
#define LU_KEYWORD_THREAD "th:" /* THread */
56
/* lu_import_message */
57
#define LU_KEYWORD_LIST "ml:" /* Mailing List */
58
#define LU_KEYWORD_AUTHOR "au:" /* AUthor */
59
#define LU_KEYWORD_SUBJECT "sb:" /* SuBject */
61
/* magic automatic keywords */
62
#define LU_KEYWORD_GROUP "gr:" /* Mailing group */
63
#define LU_KEYWORD_LANGUAGE "lang:" /* Language */
65
/* import processing */
66
#define LU_KEYWORD_WORD "" /* body keywords */
68
/* The longest length a keyword can be */
69
#define LU_KEYWORD_LEN 80
71
/* Analyze the string for keywords. */
72
extern int my_keyword_digest_string(
76
int (*writefn)(const char* keyword, void* arg),
80
const char* skipSubjectStart(const char* subject);
81
string subject_hash(const char* subject);
82
vector<string> extract_message_ids(const char* str);
84
/* The database has these types:
95
* DELETED/AUTHOR_EMAIL/AUTHOR_NAME/SUBJECT/MBOX
96
* ... if it has any of these then it must have all of them, in that order
97
* For all except the MBOX+DELETED, one has just a string value.
99
* <mailbox-as-string> '\0' <64bit offset> <32bit length>
109
* import timestamp as 4 bytes in bigendian order