git add -f bin/default/librpc/gen_ndr/*.[ch] bin/default/source*/librpc/gen_ndr/...
[metze/samba/wip.git] / bin.gen_ndr / default / librpc / gen_ndr / py_scerpc.c
1
2 /* Python wrapper functions auto-generated by pidl */
3 #include <Python.h>
4 #include "includes.h"
5 #include <pytalloc.h>
6 #include "librpc/rpc/pyrpc.h"
7 #include "librpc/rpc/pyrpc_util.h"
8 #include "bin/default/librpc/gen_ndr/ndr_scerpc.h"
9 #include "bin/default/librpc/gen_ndr/ndr_scerpc_c.h"
10
11 staticforward PyTypeObject scerpc_InterfaceType;
12
13 void initscerpc(void);static PyTypeObject *ClientConnection_Type;
14
15 static bool pack_py_scerpc_Unknown0_args_in(PyObject *args, PyObject *kwargs, struct scerpc_Unknown0 *r)
16 {
17         const char *kwnames[] = {
18                 NULL
19         };
20
21         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":scerpc_Unknown0", discard_const_p(char *, kwnames))) {
22                 return false;
23         }
24
25         return true;
26 }
27
28 static PyObject *unpack_py_scerpc_Unknown0_args_out(struct scerpc_Unknown0 *r)
29 {
30         PyObject *result;
31         result = Py_None;
32         Py_INCREF(result);
33         if (!W_ERROR_IS_OK(r->out.result)) {
34                 PyErr_SetWERROR(r->out.result);
35                 return NULL;
36         }
37
38         return result;
39 }
40
41 const struct PyNdrRpcMethodDef py_ndr_scerpc_methods[] = {
42         { "Unknown0", "S.Unknown0() -> None", (py_dcerpc_call_fn)dcerpc_scerpc_Unknown0_r, (py_data_pack_fn)pack_py_scerpc_Unknown0_args_in, (py_data_unpack_fn)unpack_py_scerpc_Unknown0_args_out, 0, &ndr_table_scerpc },
43         { NULL }
44 };
45
46 static PyObject *interface_scerpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
47 {
48         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_scerpc);
49 }
50
51 #define PY_DOC_SCERPC "Security Configuration Editor"
52 static PyTypeObject scerpc_InterfaceType = {
53         PyObject_HEAD_INIT(NULL) 0,
54         .tp_name = "scerpc.scerpc",
55         .tp_basicsize = sizeof(dcerpc_InterfaceObject),
56         .tp_doc = "scerpc(binding, lp_ctx=None, credentials=None) -> connection\n"
57 "\n"
58 "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
59 "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
60 "credentials should be a credentials.Credentials object.\n\n"PY_DOC_SCERPC,
61         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
62         .tp_new = interface_scerpc_new,
63 };
64
65 static PyMethodDef scerpc_methods[] = {
66         { NULL, NULL, 0, NULL }
67 };
68
69 void initscerpc(void)
70 {
71         PyObject *m;
72         PyObject *dep_samba_dcerpc_base;
73
74         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
75         if (dep_samba_dcerpc_base == NULL)
76                 return;
77
78         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
79         if (ClientConnection_Type == NULL)
80                 return;
81
82         scerpc_InterfaceType.tp_base = ClientConnection_Type;
83
84         if (PyType_Ready(&scerpc_InterfaceType) < 0)
85                 return;
86         if (!PyInterface_AddNdrRpcMethods(&scerpc_InterfaceType, py_ndr_scerpc_methods))
87                 return;
88
89 #ifdef PY_SCERPC_PATCH
90         PY_SCERPC_PATCH(&scerpc_InterfaceType);
91 #endif
92
93         m = Py_InitModule3("scerpc", scerpc_methods, "scerpc DCE/RPC");
94         if (m == NULL)
95                 return;
96
97         Py_INCREF((PyObject *)(void *)&scerpc_InterfaceType);
98         PyModule_AddObject(m, "scerpc", (PyObject *)(void *)&scerpc_InterfaceType);
99 #ifdef PY_MOD_SCERPC_PATCH
100         PY_MOD_SCERPC_PATCH(m);
101 #endif
102
103 }