mirror of
https://github.com/samba-team/samba.git
synced 2025-12-16 00:23:52 +03:00
Added functions to return Python tuples (error code, error string)
corresponding to NT and DOS errors.
This commit is contained in:
@@ -19,6 +19,23 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "Python.h"
|
||||
|
||||
/* Return a tuple of (error code, error string) from a WERROR */
|
||||
|
||||
PyObject *py_werror_tuple(WERROR werror)
|
||||
{
|
||||
return Py_BuildValue("is", W_ERROR_V(werror),
|
||||
dos_errstr(werror));
|
||||
}
|
||||
|
||||
/* Return a tuple of (error code, error string) from a WERROR */
|
||||
|
||||
PyObject *py_ntstatus_tuple(NTSTATUS ntstatus)
|
||||
{
|
||||
return Py_BuildValue("is", NT_STATUS_V(ntstatus),
|
||||
nt_errstr(ntstatus));
|
||||
}
|
||||
|
||||
/* Initialise samba client routines */
|
||||
|
||||
|
||||
@@ -24,5 +24,7 @@
|
||||
/* Function prototypes */
|
||||
|
||||
void py_samba_init(void);
|
||||
PyObject *py_werror_tuple(WERROR werror);
|
||||
PyObject *py_ntstatus_tuple(NTSTATUS ntstatus);
|
||||
|
||||
#endif /* _PY_COMMON_H */
|
||||
|
||||
Reference in New Issue
Block a user