summaryrefslogtreecommitdiff
path: root/source4/libcli/util/errors.i
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-11-21 13:07:16 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:45:59 +0100
commit39adc2418a0586261c6c4aea36f72596c6cf8897 (patch)
tree279396139bc8648aee80b0ae32b9ff7a23157593 /source4/libcli/util/errors.i
parentf2b9a9ae11f43e4c283a151ca6d2d72f3e4d2283 (diff)
downloadsamba-39adc2418a0586261c6c4aea36f72596c6cf8897.tar.gz
samba-39adc2418a0586261c6c4aea36f72596c6cf8897.tar.bz2
samba-39adc2418a0586261c6c4aea36f72596c6cf8897.zip
r26088: Import some native-python python modules and move original python swig torture code to common python directory as well.
(This used to be commit cbf656ff054ab2b0b5ca81e1d4f16ac54c8098f1)
Diffstat (limited to 'source4/libcli/util/errors.i')
-rw-r--r--source4/libcli/util/errors.i11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/libcli/util/errors.i b/source4/libcli/util/errors.i
index 61cb7a090a..d51c9e0ded 100644
--- a/source4/libcli/util/errors.i
+++ b/source4/libcli/util/errors.i
@@ -36,4 +36,15 @@
}
};
+%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;
+ }
+}
+
#endif