summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/swig/dcerpc.i50
1 files changed, 40 insertions, 10 deletions
diff --git a/source4/scripting/swig/dcerpc.i b/source4/scripting/swig/dcerpc.i
index 5ace564359..10dc4721e6 100644
--- a/source4/scripting/swig/dcerpc.i
+++ b/source4/scripting/swig/dcerpc.i
@@ -47,24 +47,54 @@ void set_ntstatus_exception(int status)
PyErr_SetObject(ntstatus_exception, obj);
}
-char *get_string_property(PyObject *dict, char *key)
+uint8 uint8_from_python(PyObject *obj)
{
- PyObject *item = PyDict_GetItem(dict, PyString_FromString(key));
+ return (uint8)PyInt_AsLong(obj);
+}
+
+uint16 uint16_from_python(PyObject *obj)
+{
+ return (uint16)PyInt_AsLong(obj);
+}
+
+uint32 uint32_from_python(PyObject *obj)
+{
+ return (uint32)PyInt_AsLong(obj);
+}
+
+int64 int64_from_python(PyObject *obj)
+{
+ return (int64)PyLong_AsLong(obj);
+}
- if (!item)
- return 0; /* TODO: throw exception */
+uint64 uint64_from_python(PyObject *obj)
+{
+ return (uint64)PyLong_AsLong(obj);
+}
+
+NTTIME NTTIME_from_python(PyObject *obj)
+{
+ return (NTTIME)PyLong_AsLong(obj);
+}
- return PyString_AsString(item);
+HYPER_T HYPER_T_from_python(PyObject *obj)
+{
+ return (HYPER_T)PyLong_AsLong(obj);
}
-uint32 get_uint32_property(PyObject *dict, char *key)
+struct policy_handle *policy_handle_from_python(PyObject *obj)
{
- PyObject *item = PyDict_GetItem(dict, PyString_FromString(key));
+ return (struct policy_handle *)PyString_AsString(obj);
+}
- if (!item)
- return 0; /* TODO: throw exception */
+struct security_descriptor *security_descriptor_from_python(PyObject *obj)
+{
+ return NULL;
+}
- return (uint32)PyInt_AsLong(item);
+char *string_from_python(PyObject *obj)
+{
+ return NULL;
}
%}