~ubuntu-branches/debian/sid/openchange/sid

« back to all changes in this revision

Viewing changes to pyopenchange/mapistore/pymapistore.h

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2012-04-12 20:07:57 UTC
  • mfrom: (11 sid)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20120412200757-k933d9trljmxj1l4
Tags: 1:1.0-4
* openchangeserver: Add dependency on openchangeproxy.
* Rebuild against newer version of Samba 4.
* Use dpkg-buildflags.
* Migrate to Git, update Vcs-Git header.
* Switch to debhelper 9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
   OpenChange MAPI implementation.
 
3
 
 
4
   Python interface to mapistore
 
5
 
 
6
   Copyright (C) Julien Kerihuel 2010.
 
7
 
 
8
   This program is free software; you can redistribute it and/or modify
 
9
   it under the terms of the GNU General Public License as published by
 
10
   the Free Software Foundation; either version 3 of the License, or
 
11
   (at your option) any later version.
 
12
   
 
13
   This program is distributed in the hope that it will be useful,
 
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
   GNU General Public License for more details.
 
17
   
 
18
   You should have received a copy of the GNU General Public License
 
19
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
*/
 
21
 
 
22
#ifndef __PYMAPISTORE_H_
 
23
#define __PYMAPISTORE_H_
 
24
 
 
25
#include <Python.h>
 
26
#include "mapiproxy/libmapistore/mapistore.h"
 
27
#include "mapiproxy/libmapistore/mapistore_errors.h"
 
28
#include "mapiproxy/libmapistore/mgmt/mapistore_mgmt.h"
 
29
#include "mapiproxy/libmapiproxy/libmapiproxy.h"
 
30
#include <tevent.h>
 
31
 
 
32
typedef struct {
 
33
        PyObject_HEAD
 
34
        TALLOC_CTX                      *mem_ctx;
 
35
        struct mapistore_context        *mstore_ctx;
 
36
        struct ldb_context              *samdb_ctx;
 
37
        struct ldb_context              *ocdb_ctx;
 
38
} PyMAPIStoreObject;
 
39
 
 
40
typedef struct {
 
41
        PyObject_HEAD
 
42
        TALLOC_CTX                      *mem_ctx;
 
43
        struct mapistore_mgmt_context   *mgmt_ctx;
 
44
        PyMAPIStoreObject               *parent;
 
45
} PyMAPIStoreMGMTObject;
 
46
 
 
47
typedef struct {
 
48
        PyObject_HEAD
 
49
        TALLOC_CTX                      *mem_ctx;
 
50
        struct mapistore_context        *mstore_ctx;
 
51
        struct ldb_context              *ocdb_ctx;
 
52
        uint64_t                        fid;
 
53
        void                            *folder_object;
 
54
        uint32_t                        context_id;
 
55
        PyMAPIStoreObject               *parent;
 
56
} PyMAPIStoreContextObject;
 
57
 
 
58
typedef struct {
 
59
        PyObject_HEAD
 
60
        PyMAPIStoreContextObject        *context;
 
61
        void                            *folder_object;
 
62
        uint64_t                        fid;
 
63
} PyMAPIStoreFolderObject;
 
64
 
 
65
typedef struct {
 
66
        PyObject_HEAD   
 
67
} PyMAPIStoreTableObject;
 
68
 
 
69
PyAPI_DATA(PyTypeObject)        PyMAPIStore;
 
70
PyAPI_DATA(PyTypeObject)        PyMAPIStoreMGMT;
 
71
PyAPI_DATA(PyTypeObject)        PyMAPIStoreContext;
 
72
PyAPI_DATA(PyTypeObject)        PyMAPIStoreFolder;
 
73
PyAPI_DATA(PyTypeObject)        PyMAPIStoreTable;
 
74
 
 
75
#ifndef __BEGIN_DECLS
 
76
#ifdef __cplusplus
 
77
#define __BEGIN_DECLS           extern "C" {
 
78
#define __END_DECLS             }
 
79
#else
 
80
#define __BEGIN_DECLS
 
81
#define __END_DECLS
 
82
#endif
 
83
#endif
 
84
 
 
85
__BEGIN_DECLS
 
86
void PyErr_SetMAPIStoreError(uint32_t);
 
87
__END_DECLS
 
88
 
 
89
#define PyErr_MAPIStore_IS_ERR_RAISE(retval)            \
 
90
        if (retval != MAPISTORE_SUCCESS) {              \
 
91
                PyErr_SetMAPIStoreError(retval);        \
 
92
                return NULL;                            \
 
93
        }
 
94
 
 
95
#endif  /* ! __PYMAPISTORE_H_ */