2
OpenChange MAPI implementation.
4
Copyright (C) Jelmer Vernooij <jelmer@openchange.org> 2008.
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 3 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
20
#include "pymapi/pymapi.h"
24
static PyObject *py_get_proptag_value(PyObject *mod, PyObject *args)
27
if (!PyArg_ParseTuple(args, "s", &propname))
30
return PyInt_FromLong(get_proptag_value(propname));
33
static PyObject *py_get_proptag_name(PyObject *mod, PyObject *args)
37
if (!PyArg_ParseTuple(args, "i", &proptag))
40
name = get_proptag_name(proptag);
43
return PyString_FromString(name);
46
static PyObject *py_get_importance(PyObject *mod, PyObject *args)
50
if (!PyArg_ParseTuple(args, "i", &importance))
53
name = get_importance(importance);
56
return PyString_FromString(name);
59
static PyObject *py_get_task_status(PyObject *mod, PyObject *args)
63
if (!PyArg_ParseTuple(args, "i", &task_status))
66
name = get_task_status(task_status);
69
return PyString_FromString(name);
72
static PyMethodDef mapi_methods[] = {
73
{ "get_proptag_value", (PyCFunction)py_get_proptag_value, METH_VARARGS, NULL },
74
{ "get_proptag_name", (PyCFunction)py_get_proptag_name, METH_VARARGS, NULL },
75
{ "get_importance", (PyCFunction)py_get_importance, METH_VARARGS, NULL },
76
{ "get_task_status", (PyCFunction)py_get_task_status, METH_VARARGS, NULL },
84
if (PyType_Ready(&PyMapiSessionType) < 0)
87
if (PyType_Ready(&PyMapiObjectType) < 0)
90
if (PyType_Ready(&PyMapiMsgStoreType) < 0)
93
m = Py_InitModule3("mapi", mapi_methods, "MAPI/RPC Python bindings");
97
Py_INCREF((PyObject *)&PyMapiSessionType);
98
PyModule_AddObject(m, "Session", (PyObject *)&PyMapiSessionType);
100
Py_INCREF((PyObject *)&PyMapiObjectType);
101
PyModule_AddObject(m, "Object", (PyObject *)&PyMapiObjectType);
103
Py_INCREF((PyObject *)&PyMapiMsgStoreType);
104
PyModule_AddObject(m, "MessageStore", (PyObject *)&PyMapiMsgStoreType);