Changeset 740 for vendor/current/source4/librpc/rpc/pyrpc.h
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified vendor/current/source4/librpc/rpc/pyrpc.h ¶
r414 r740 22 22 23 23 #include "libcli/util/pyerrors.h" 24 #include "librpc/rpc/dcerpc.h" 24 25 #ifndef Py_TYPE /* Py_TYPE is only available on Python > 2.6 */ 26 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) 27 #endif 25 28 26 29 #define PY_CHECK_TYPE(type, var, fail) \ 27 30 if (!PyObject_TypeCheck(var, type)) {\ 28 PyErr_Format(PyExc_TypeError, "Expected type %s", (type)->tp_name); \31 PyErr_Format(PyExc_TypeError, __location__ ": Expected type '%s' for '%s' of type '%s'", (type)->tp_name, #var, Py_TYPE(var)->tp_name); \ 29 32 fail; \ 30 33 } … … 37 40 #define dom_sid28_Check dom_sid_Check 38 41 39 /* This macro is only provided by Python >= 2.3 */40 #ifndef PyAPI_DATA41 # define PyAPI_DATA(RTYPE) extern RTYPE42 #endif43 44 42 typedef struct { 45 43 PyObject_HEAD 44 TALLOC_CTX *mem_ctx; 46 45 struct dcerpc_pipe *pipe; 46 struct dcerpc_binding_handle *binding_handle; 47 47 } dcerpc_InterfaceObject; 48 48 49 PyAPI_DATA(PyTypeObject) dcerpc_InterfaceType;50 49 51 #define PyErr_FromNdrError(err) Py_BuildValue("(is)", err, ndr_map_error2string(err)) 52 53 #define PyErr_SetNdrError(err) \ 54 PyErr_SetObject(PyExc_RuntimeError, PyErr_FromNdrError(err)) 55 56 void PyErr_SetDCERPCStatus(struct dcerpc_pipe *pipe, NTSTATUS status); 57 58 typedef bool (*py_data_pack_fn) (PyObject *args, PyObject *kwargs, void *r); 59 typedef PyObject *(*py_data_unpack_fn) (void *r); 60 61 struct PyNdrRpcMethodDef { 62 const char *name; 63 const char *doc; 64 dcerpc_call_fn call; 65 py_data_pack_fn pack_in_data; 66 py_data_unpack_fn unpack_out_data; 67 uint32_t opnum; 68 const struct ndr_interface_table *table; 69 }; 70 71 bool PyInterface_AddNdrRpcMethods(PyTypeObject *object, const struct PyNdrRpcMethodDef *mds); 72 PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs, const struct ndr_interface_table *table); 50 /* 51 these prototypes should be generated by the python pidl backend, but 52 aren't yet. They are needed when one module that has python access 53 is accessed by another module 54 */ 55 union netr_LogonLevel *py_export_netr_LogonLevel(TALLOC_CTX *mem_ctx, int level, PyObject *in); 56 union netr_Validation; 57 PyObject *py_import_netr_Validation(TALLOC_CTX *mem_ctx, int level, union netr_Validation *in); 73 58 74 59 #endif /* _PYRPC_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.