diff options
author | Tim Potter <tpot@samba.org> | 2005-02-12 00:53:32 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:44 -0500 |
commit | 55006da0436b108f9f56b8736e58eee2777bd361 (patch) | |
tree | a071d2e8ea5900cddd869e4f2f765d0b669ab1e5 /source4/scripting/swig | |
parent | 8cd9d7095bb431d78ed146f1e03a6a036cf66249 (diff) | |
download | samba-55006da0436b108f9f56b8736e58eee2777bd361.tar.gz samba-55006da0436b108f9f56b8736e58eee2777bd361.tar.bz2 samba-55006da0436b108f9f56b8736e58eee2777bd361.zip |
r5350: Implement an input typemap for NTSTATUS.
(This used to be commit 076ec6008e4dbd130044893f34c3fd7212bf667d)
Diffstat (limited to 'source4/scripting/swig')
-rw-r--r-- | source4/scripting/swig/samba.i | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/scripting/swig/samba.i b/source4/scripting/swig/samba.i index db48b3c4ba..c7b8b46e66 100644 --- a/source4/scripting/swig/samba.i +++ b/source4/scripting/swig/samba.i @@ -46,6 +46,17 @@ $result = PyLong_FromUnsignedLong($1); } +%typemap(in) NTSTATUS { + if (PyLong_Check($input)) + $1 = NT_STATUS(PyLong_AsUnsignedLong($input)); + else if (PyInt_Check($input)) + $1 = NT_STATUS(PyInt_AsLong($input)); + else { + PyErr_SetString(PyExc_TypeError, "Expected a long or an int"); + return NULL; + } +} + %typemap(out) NTSTATUS { $result = PyLong_FromUnsignedLong(NT_STATUS_V($1)); } |