summaryrefslogtreecommitdiff
path: root/source4/scripting/swig/dcerpc.i
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-09-05 04:05:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:33 -0500
commit65b5a2297c766f5dcaf087800993554729aa6c69 (patch)
tree82bb664dfff06945ea2d707565fe830a92f4c1ba /source4/scripting/swig/dcerpc.i
parent86bf5cefa9798378ffb881a9a668c852fe56b2e2 (diff)
downloadsamba-65b5a2297c766f5dcaf087800993554729aa6c69.tar.gz
samba-65b5a2297c766f5dcaf087800993554729aa6c69.tar.bz2
samba-65b5a2297c766f5dcaf087800993554729aa6c69.zip
r2230: Wrapper for dcerpc_samr_Connect2(). All this glue code should be
automatically generated but at the moment it's hand coded. (This used to be commit e1a368050d3abb6a6ca6529315dc4228e8590c7f)
Diffstat (limited to 'source4/scripting/swig/dcerpc.i')
-rw-r--r--source4/scripting/swig/dcerpc.i28
1 files changed, 26 insertions, 2 deletions
diff --git a/source4/scripting/swig/dcerpc.i b/source4/scripting/swig/dcerpc.i
index 6130f85a60..c843ec3c36 100644
--- a/source4/scripting/swig/dcerpc.i
+++ b/source4/scripting/swig/dcerpc.i
@@ -50,6 +50,26 @@ void set_ntstatus_exception(int status)
PyErr_SetObject(ntstatus_exception, obj);
}
+char *get_string_property(PyObject *dict, char *key)
+{
+ PyObject *item = PyDict_GetItem(dict, PyString_FromString(key));
+
+ if (!item)
+ return 0; /* TODO: throw exception */
+
+ return PyString_AsString(item);
+}
+
+uint32 get_uint32_property(PyObject *dict, char *key)
+{
+ PyObject *item = PyDict_GetItem(dict, PyString_FromString(key));
+
+ if (!item)
+ return 0; /* TODO: throw exception */
+
+ return (uint32)PyInt_AsLong(item);
+}
+
%}
%include "samba.i"
@@ -61,8 +81,12 @@ void set_ntstatus_exception(int status)
ntstatus_exception = PyErr_NewException("dcerpc.NTSTATUS", NULL, NULL);
%}
-%typemap(in, numinputs=0) struct dcerpc_pipe **OUT (struct dcerpc_pipe *temp) {
- $1 = &temp;
+%typemap(in, numinputs=0) struct dcerpc_pipe **OUT (struct dcerpc_pipe *temp_dcerpc_pipe) {
+ $1 = &temp_dcerpc_pipe;
+}
+
+%typemap(in, numinputs=0) TALLOC_CTX * {
+ $1 = talloc_init("foo");
}
%typemap(argout) struct dcerpc_pipe ** {