summaryrefslogtreecommitdiff
path: root/source3/python/py_lsa.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-05-14 02:37:47 +0000
committerTim Potter <tpot@samba.org>2002-05-14 02:37:47 +0000
commit520b40e4235f26cf2bc670128ff277141084e53c (patch)
tree94443ce711bd98b635f640d509c3de93b46fac55 /source3/python/py_lsa.c
parent0c9e6bb88f6ce7fddd561a6a4ef9107f4d77eca7 (diff)
downloadsamba-520b40e4235f26cf2bc670128ff277141084e53c.tar.gz
samba-520b40e4235f26cf2bc670128ff277141084e53c.tar.bz2
samba-520b40e4235f26cf2bc670128ff277141084e53c.zip
General cleanup of compiler warnings etc.
(This used to be commit 18aeadc591b69bbbd874b7285ecaed50ff587e68)
Diffstat (limited to 'source3/python/py_lsa.c')
-rw-r--r--source3/python/py_lsa.c42
1 files changed, 32 insertions, 10 deletions
diff --git a/source3/python/py_lsa.c b/source3/python/py_lsa.c
index 82ae99c53e..23566282f6 100644
--- a/source3/python/py_lsa.c
+++ b/source3/python/py_lsa.c
@@ -18,9 +18,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "includes.h"
-#include "Python.h"
-
#include "python/py_lsa.h"
PyObject *new_lsa_policy_hnd_object(struct cli_state *cli, TALLOC_CTX *mem_ctx,
@@ -300,15 +297,18 @@ static PyMethodDef lsa_hnd_methods[] = {
/* SIDs<->names */
- { "lookup_sids", lsa_lookup_sids, METH_VARARGS | METH_KEYWORDS,
+ { "lookup_sids", (PyCFunction)lsa_lookup_sids,
+ METH_VARARGS | METH_KEYWORDS,
"Convert sids to names." },
- { "lookup_names", lsa_lookup_names, METH_VARARGS | METH_KEYWORDS,
+ { "lookup_names", (PyCFunction)lsa_lookup_names,
+ METH_VARARGS | METH_KEYWORDS,
"Convert names to sids." },
/* Trusted domains */
- { "enum_trusted_domains", lsa_enum_trust_dom, METH_VARARGS,
+ { "enum_trusted_domains", (PyCFunction)lsa_enum_trust_dom,
+ METH_VARARGS,
"Enumerate trusted domains." },
{ NULL }
@@ -346,17 +346,39 @@ static PyMethodDef lsa_methods[] = {
/* Open/close lsa handles */
- { "open_policy", lsa_open_policy, METH_VARARGS | METH_KEYWORDS,
+ { "open_policy", (PyCFunction)lsa_open_policy,
+ METH_VARARGS | METH_KEYWORDS,
"Open a policy handle" },
- { "close", lsa_close, METH_VARARGS, "Close a policy handle" },
+ { "close", (PyCFunction)lsa_close,
+ METH_VARARGS,
+ "Close a policy handle" },
+
+ { NULL }
+};
+static struct const_vals {
+ char *name;
+ uint32 value;
+} module_const_vals[] = {
{ NULL }
};
+static void const_init(PyObject *dict)
+{
+ struct const_vals *tmp;
+ PyObject *obj;
+
+ for (tmp = module_const_vals; tmp->name; tmp++) {
+ obj = PyInt_FromLong(tmp->value);
+ PyDict_SetItemString(dict, tmp->name, obj);
+ Py_DECREF(obj);
+ }
+}
+
/*
* Module initialisation
-*/
+ */
void initlsa(void)
{
@@ -379,7 +401,7 @@ void initlsa(void)
/* Initialise constants */
-// const_init(dict);
+ const_init(dict);
/* Do samba initialisation */