git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b2c3c7
)
r5350: Implement an input typemap for NTSTATUS.
author
Tim Potter
<tpot@samba.org>
Sat, 12 Feb 2005 00:53:32 +0000
(
00:53
+0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 18:09:44 +0000
(13:09 -0500)
source/scripting/swig/samba.i
patch
|
blob
|
history
diff --git
a/source/scripting/swig/samba.i
b/source/scripting/swig/samba.i
index db48b3c4ba9f8f699a1a7cc54108a6ba17127864..c7b8b46e665900ac066c44902538d5f1ea2d94f2 100644
(file)
--- a/
source/scripting/swig/samba.i
+++ b/
source/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));
}