2 Unix SMB/CIFS implementation.
4 Python interface to ldb.
6 Copyright (C) 2007-2008 Jelmer Vernooij <jelmer@samba.org>
8 ** NOTE! The following LGPL license applies to the ldb
9 ** library. This does NOT imply that all of Samba is released
12 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Lesser General Public
14 License as published by the Free Software Foundation; either
15 version 3 of the License, or (at your option) any later version.
17 This library is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public
23 License along with this library; if not, see <http://www.gnu.org/licenses/>.
34 struct ldb_context
*ldb_ctx
;
37 #define pyldb_Ldb_AsLdbContext(pyobj) ((PyLdbObject *)pyobj)->ldb_ctx
45 PyObject
*pyldb_Dn_FromDn(struct ldb_dn
*);
46 bool pyldb_Object_AsDn(TALLOC_CTX
*mem_ctx
, PyObject
*object
, struct ldb_context
*ldb_ctx
, struct ldb_dn
**dn
);
47 #define pyldb_Dn_AsDn(pyobj) ((PyLdbDnObject *)pyobj)->dn
52 struct ldb_message
*msg
;
54 #define pyldb_Message_AsMessage(pyobj) ((PyLdbMessageObject *)pyobj)->msg
59 struct ldb_module
*mod
;
61 #define pyldb_Module_AsModule(pyobj) ((PyLdbModuleObject *)pyobj)->mod
66 struct ldb_message_element
*el
;
67 } PyLdbMessageElementObject
;
68 #define pyldb_MessageElement_AsMessageElement(pyobj) ((PyLdbMessageElementObject *)pyobj)->el
73 struct ldb_parse_tree
*tree
;
75 #define pyldb_Tree_AsTree(pyobj) ((PyLdbTreeObject *)pyobj)->tree
88 struct ldb_control
*data
;
91 #define PyErr_LDB_ERROR_IS_ERR_RAISE(err,ret,ldb) \
92 if (ret != LDB_SUCCESS) { \
93 PyErr_SetLdbError(err, ret, ldb); \
97 /* Picked out of thin air. To do this properly, we should probably have some part of the
98 * errors in LDB be allocated to bindings ? */
99 #define LDB_ERR_PYTHON_EXCEPTION 142
101 #endif /* _PYLDB_H_ */