2 This file is part of notmuch.
4 Notmuch is free software: you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation, either version 3 of the License, or (at your
7 option) any later version.
9 Notmuch is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with notmuch. If not, see <http://www.gnu.org/licenses/>.
17 Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
20 from ctypes import CDLL, Structure, POINTER
22 #-----------------------------------------------------------------------------
23 #package-global instance of the notmuch library
25 nmlib = CDLL("libnotmuch.so.3")
27 raise ImportError("Could not find shared 'notmuch' library.")
29 from .compat import Python3StringMixIn, encode_utf8 as _str
32 """Provides ENUMS as "code=Enum(['a','b','c'])" where code.a=0 etc..."""
33 def __init__(self, names):
34 for number, name in enumerate(names):
35 setattr(self, name, number)
38 class NotmuchDatabaseS(Structure):
40 NotmuchDatabaseP = POINTER(NotmuchDatabaseS)
43 class NotmuchQueryS(Structure):
45 NotmuchQueryP = POINTER(NotmuchQueryS)
48 class NotmuchThreadsS(Structure):
50 NotmuchThreadsP = POINTER(NotmuchThreadsS)
53 class NotmuchThreadS(Structure):
55 NotmuchThreadP = POINTER(NotmuchThreadS)
58 class NotmuchMessagesS(Structure):
60 NotmuchMessagesP = POINTER(NotmuchMessagesS)
63 class NotmuchMessageS(Structure):
65 NotmuchMessageP = POINTER(NotmuchMessageS)
68 class NotmuchTagsS(Structure):
70 NotmuchTagsP = POINTER(NotmuchTagsS)
73 class NotmuchDirectoryS(Structure):
75 NotmuchDirectoryP = POINTER(NotmuchDirectoryS)
78 class NotmuchFilenamesS(Structure):
80 NotmuchFilenamesP = POINTER(NotmuchFilenamesS)