Author: tpot Date: 2004-09-10 12:20:25 +0000 (Fri, 10 Sep 2004) New Revision: 2278
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/scripting/swig&rev=2278&nolog=1 Log: Add some more helper functions. Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i Changeset: Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i =================================================================== --- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i 2004-09-10 12:18:56 UTC (rev 2277) +++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i 2004-09-10 12:20:25 UTC (rev 2278) @@ -47,26 +47,56 @@ 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); +} - if (!item) - return 0; /* TODO: throw exception */ +uint16 uint16_from_python(PyObject *obj) +{ + return (uint16)PyInt_AsLong(obj); +} - return PyString_AsString(item); +uint32 uint32_from_python(PyObject *obj) +{ + return (uint32)PyInt_AsLong(obj); } -uint32 get_uint32_property(PyObject *dict, char *key) +int64 int64_from_python(PyObject *obj) { - PyObject *item = PyDict_GetItem(dict, PyString_FromString(key)); + return (int64)PyLong_AsLong(obj); +} - if (!item) - return 0; /* TODO: throw exception */ +uint64 uint64_from_python(PyObject *obj) +{ + return (uint64)PyLong_AsLong(obj); +} - return (uint32)PyInt_AsLong(item); +NTTIME NTTIME_from_python(PyObject *obj) +{ + return (NTTIME)PyLong_AsLong(obj); } +HYPER_T HYPER_T_from_python(PyObject *obj) +{ + return (HYPER_T)PyLong_AsLong(obj); +} + +struct policy_handle *policy_handle_from_python(PyObject *obj) +{ + return (struct policy_handle *)PyString_AsString(obj); +} + +struct security_descriptor *security_descriptor_from_python(PyObject *obj) +{ + return NULL; +} + +char *string_from_python(PyObject *obj) +{ + return NULL; +} + %} %include "samba.i"