#include <Python.h>
#include "python/py3compat.h"
#include "includes.h"
+#include "python/modules.h"
#include "param/pyparam.h"
#include "auth/gensec/gensec.h"
#include "auth/gensec/gensec_internal.h" /* TODO: remove this */
Py_RETURN_NONE;
}
-static PyObject *py_gensec_session_info(PyObject *self)
+static PyObject *py_gensec_session_info(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
TALLOC_CTX *mem_ctx;
NTSTATUS status;
return py_session_info;
}
-static PyObject *py_gensec_session_key(PyObject *self)
+static PyObject *py_gensec_session_key(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
TALLOC_CTX *mem_ctx;
NTSTATUS status;
Py_RETURN_NONE;
}
-static PyObject *py_gensec_max_update_size(PyObject *self)
+static PyObject *py_gensec_max_update_size(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
unsigned int max_update_size = gensec_max_update_size(security);
}
static PyMethodDef py_gensec_security_methods[] = {
- { "start_client", (PyCFunction)py_gensec_start_client, METH_VARARGS|METH_KEYWORDS|METH_CLASS,
+ { "start_client", PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_gensec_start_client),
+ METH_VARARGS|METH_KEYWORDS|METH_CLASS,
"S.start_client(settings) -> gensec" },
- { "start_server", (PyCFunction)py_gensec_start_server, METH_VARARGS|METH_KEYWORDS|METH_CLASS,
+ { "start_server", PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_gensec_start_server),
+ METH_VARARGS|METH_KEYWORDS|METH_CLASS,
"S.start_server(auth_ctx, settings) -> gensec" },
{ "set_credentials", (PyCFunction)py_gensec_set_credentials, METH_VARARGS,
"S.start_client(credentials)" },
#include <Python.h>
#include "python/py3compat.h"
#include "includes.h"
+#include "python/modules.h"
#include "libcli/util/pyerrors.h"
#include "param/param.h"
#include "pyauth.h"
static PyMethodDef py_auth_methods[] = {
{ "system_session", (PyCFunction)py_system_session, METH_VARARGS, NULL },
{ "admin_session", (PyCFunction)py_admin_session, METH_VARARGS, NULL },
- { "user_session", (PyCFunction)py_user_session, METH_VARARGS|METH_KEYWORDS, NULL },
+ { "user_session", PY_DISCARD_FUNC_SIG(PyCFunction,py_user_session),
+ METH_VARARGS|METH_KEYWORDS, NULL },
{ "session_info_fill_unix",
- (PyCFunction)py_session_info_fill_unix,
+ PY_DISCARD_FUNC_SIG(PyCFunction,py_session_info_fill_unix),
METH_VARARGS|METH_KEYWORDS,
NULL },
{ "copy_session_info",
- (PyCFunction)py_copy_session_info,
+ PY_DISCARD_FUNC_SIG(PyCFunction,py_copy_session_info),
METH_VARARGS|METH_KEYWORDS,
NULL },
{ NULL },
#include <Python.h>
#include "python/py3compat.h"
#include "includes.h"
+#include "python/modules.h"
#include <pyldb.h>
#include <pytalloc.h>
#include "dns_server/dnsserver_common.h"
static PyMethodDef py_dsdb_dns_methods[] = {
- { "lookup", (PyCFunction)py_dsdb_dns_lookup,
+ { "lookup", PY_DISCARD_FUNC_SIG(PyCFunction, py_dsdb_dns_lookup),
METH_VARARGS|METH_KEYWORDS,
"Get the DNS database entries for a DNS name"},
{ "replace", (PyCFunction)py_dsdb_dns_replace,
Py_RETURN_NONE;
}
-static PyObject *py_irpc_add_name(PyObject *self, PyObject *args, PyObject *kwargs)
+static PyObject *py_irpc_add_name(PyObject *self, PyObject *args)
{
imessaging_Object *iface = (imessaging_Object *)self;
char *server_name;
Py_RETURN_NONE;
}
-static PyObject *py_irpc_remove_name(PyObject *self, PyObject *args, PyObject *kwargs)
+static PyObject *py_irpc_remove_name(PyObject *self, PyObject *args)
{
imessaging_Object *iface = (imessaging_Object *)self;
char *server_name;
Py_RETURN_NONE;
}
-static PyObject *py_irpc_servers_byname(PyObject *self, PyObject *args, PyObject *kwargs)
+static PyObject *py_irpc_servers_byname(PyObject *self, PyObject *args)
{
imessaging_Object *iface = (imessaging_Object *)self;
char *server_name;
return pylist;
}
-static PyObject *py_irpc_all_servers(PyObject *self, PyObject *args, PyObject *kwargs)
+static PyObject *py_irpc_all_servers(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
imessaging_Object *iface = (imessaging_Object *)self;
PyObject *pylist;
}
static PyMethodDef py_imessaging_methods[] = {
- { "send", (PyCFunction)py_imessaging_send, METH_VARARGS|METH_KEYWORDS,
+ { "send", PY_DISCARD_FUNC_SIG(PyCFunction, py_imessaging_send),
+ METH_VARARGS|METH_KEYWORDS,
"S.send(target, msg_type, data) -> None\nSend a message" },
- { "register", (PyCFunction)py_imessaging_register, METH_VARARGS|METH_KEYWORDS,
+ { "register", PY_DISCARD_FUNC_SIG(PyCFunction, py_imessaging_register),
+ METH_VARARGS|METH_KEYWORDS,
"S.register((callback, context), msg_type=None) -> msg_type\nRegister a message handler. "
"The callback and context must be supplied as a two-element tuple." },
- { "deregister", (PyCFunction)py_imessaging_deregister, METH_VARARGS|METH_KEYWORDS,
+ { "deregister", PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_imessaging_deregister),
+ METH_VARARGS|METH_KEYWORDS,
"S.deregister((callback, context), msg_type) -> None\nDeregister a message handler "
"The callback and context must be supplied as the exact same two-element tuple "
"as was used as registration time." },
- { "loop_once", (PyCFunction)py_imessaging_loop_once, METH_VARARGS|METH_KEYWORDS,
+ { "loop_once", PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_imessaging_loop_once),
+ METH_VARARGS|METH_KEYWORDS,
"S.loop_once(timeout) -> None\n"
"Loop on the internal event context until we get an event "
"(which might be a message calling the callback), "
#include <Python.h>
#include "python/py3compat.h"
#include "includes.h"
+#include "python/modules.h"
#include "libcli/util/pyerrors.h"
#include "lib/registry/registry.h"
#include <pytalloc.h>
Py_RETURN_NONE;
}
-static PyObject *py_hive_key_flush(PyObject *self)
+static PyObject *py_hive_key_flush(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
{
WERROR result;
struct hive_key *key = PyHiveKey_AsHiveKey(self);
}
static PyMethodDef py_registry_methods[] = {
- { "open_samba", (PyCFunction)py_open_samba, METH_VARARGS|METH_KEYWORDS, "open_samba() -> reg" },
- { "open_ldb", (PyCFunction)py_open_ldb_file, METH_VARARGS|METH_KEYWORDS, "open_ldb(location, session_info=None, credentials=None, loadparm_context=None) -> key" },
- { "open_hive", (PyCFunction)py_open_hive, METH_VARARGS|METH_KEYWORDS, "open_hive(location, session_info=None, credentials=None, loadparm_context=None) -> key" },
+ { "open_samba", PY_DISCARD_FUNC_SIG(PyCFunction, py_open_samba),
+ METH_VARARGS|METH_KEYWORDS, "open_samba() -> reg" },
+ { "open_ldb", PY_DISCARD_FUNC_SIG(PyCFunction, py_open_ldb_file),
+ METH_VARARGS|METH_KEYWORDS, "open_ldb(location, session_info=None, credentials=None, loadparm_context=None) -> key" },
+ { "open_hive", PY_DISCARD_FUNC_SIG(PyCFunction, py_open_hive),
+ METH_VARARGS|METH_KEYWORDS, "open_hive(location, session_info=None, credentials=None, loadparm_context=None) -> key" },
{ "str_regtype", py_str_regtype, METH_VARARGS, "str_regtype(int) -> str" },
{ "get_predef_name", py_get_predef_name, METH_VARARGS, "get_predef_name(hkey) -> str" },
{ NULL }
#include <Python.h>
#include "python/py3compat.h"
#include "includes.h"
+#include "python/modules.h"
#include <pyldb.h>
#include <pytalloc.h>
#include "libnet.h"
"Find a DC with the specified 'server_type' bits. The 'domain' and/or 'address' have to be used as additional search criteria. Returns the whole netlogon struct";
static PyMethodDef net_obj_methods[] = {
- {"join_member", (PyCFunction)py_net_join_member, METH_VARARGS|METH_KEYWORDS, py_net_join_member_doc},
- {"change_password", (PyCFunction)py_net_change_password, METH_VARARGS|METH_KEYWORDS, py_net_change_password_doc},
- {"set_password", (PyCFunction)py_net_set_password, METH_VARARGS|METH_KEYWORDS, py_net_set_password_doc},
- {"time", (PyCFunction)py_net_time, METH_VARARGS|METH_KEYWORDS, py_net_time_doc},
- {"create_user", (PyCFunction)py_net_user_create, METH_VARARGS|METH_KEYWORDS, py_net_create_user_doc},
- {"delete_user", (PyCFunction)py_net_user_delete, METH_VARARGS|METH_KEYWORDS, py_net_delete_user_doc},
- {"replicate_init", (PyCFunction)py_net_replicate_init, METH_VARARGS|METH_KEYWORDS, py_net_replicate_init_doc},
- {"replicate_chunk", (PyCFunction)py_net_replicate_chunk, METH_VARARGS|METH_KEYWORDS, py_net_replicate_chunk_doc},
- {"replicate_decrypt", (PyCFunction)py_net_replicate_decrypt, METH_VARARGS|METH_KEYWORDS, py_net_replicate_decrypt_doc},
- {"finddc", (PyCFunction)py_net_finddc, METH_VARARGS|METH_KEYWORDS, py_net_finddc_doc},
- { NULL }
+ {
+ .ml_name = "join_member",
+ .ml_meth = PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_net_join_member),
+ .ml_flags = METH_VARARGS|METH_KEYWORDS,
+ .ml_doc = py_net_join_member_doc
+ },
+ {
+ .ml_name = "change_password",
+ .ml_meth = PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_net_change_password),
+ .ml_flags = METH_VARARGS|METH_KEYWORDS,
+ .ml_doc = py_net_change_password_doc
+ },
+ {
+ .ml_name = "set_password",
+ .ml_meth = PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_net_set_password),
+ .ml_flags = METH_VARARGS|METH_KEYWORDS,
+ .ml_doc = py_net_set_password_doc
+ },
+ {
+ .ml_name = "time",
+ .ml_meth = PY_DISCARD_FUNC_SIG(PyCFunction, py_net_time),
+ .ml_flags = METH_VARARGS|METH_KEYWORDS,
+ .ml_doc = py_net_time_doc
+ },
+ {
+ .ml_name = "create_user",
+ .ml_meth = PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_net_user_create),
+ .ml_flags = METH_VARARGS|METH_KEYWORDS,
+ .ml_doc = py_net_create_user_doc
+ },
+ {
+ .ml_name = "delete_user",
+ .ml_meth = PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_net_user_delete),
+ .ml_flags = METH_VARARGS|METH_KEYWORDS,
+ .ml_doc = py_net_delete_user_doc
+ },
+ {
+ .ml_name = "replicate_init",
+ .ml_meth = PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_net_replicate_init),
+ .ml_flags = METH_VARARGS|METH_KEYWORDS,
+ .ml_doc = py_net_replicate_init_doc
+ },
+ {
+ .ml_name = "replicate_chunk",
+ .ml_meth = PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_net_replicate_chunk),
+ .ml_flags = METH_VARARGS|METH_KEYWORDS,
+ .ml_doc = py_net_replicate_chunk_doc
+ },
+ {
+ .ml_name = "replicate_decrypt",
+ .ml_meth = PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_net_replicate_decrypt),
+ .ml_flags = METH_VARARGS|METH_KEYWORDS,
+ .ml_doc = py_net_replicate_decrypt_doc
+ },
+ {
+ .ml_name = "finddc",
+ .ml_meth = PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_net_finddc),
+ .ml_flags = METH_VARARGS|METH_KEYWORDS,
+ .ml_doc = py_net_finddc_doc
+ },
+ { .ml_name = NULL }
};
static void py_net_dealloc(py_net_Object *self)
#include <Python.h>
#include "includes.h"
#include "python/py3compat.h"
+#include "python/modules.h"
#include "py_net.h"
#include "libnet_export_keytab.h"
"Export the DC keytab to a keytab file.";
static PyMethodDef export_keytab_method_table[] = {
- {"export_keytab", (PyCFunction)py_net_export_keytab, METH_VARARGS|METH_KEYWORDS, py_net_export_keytab_doc},
+ {"export_keytab", PY_DISCARD_FUNC_SIG(PyCFunction,
+ py_net_export_keytab),
+ METH_VARARGS|METH_KEYWORDS, py_net_export_keytab_doc},
{ NULL, NULL, 0, NULL }
};
.tp_flags = Py_TPFLAGS_DEFAULT,
};
-static PyObject *py_default_path(PyObject *self)
+static PyObject *py_default_path(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return PyStr_FromString(lp_default_path());
}
-static PyObject *py_setup_dir(PyObject *self)
+static PyObject *py_setup_dir(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return PyStr_FromString(dyn_SETUPDIR);
}
-static PyObject *py_modules_dir(PyObject *self)
+static PyObject *py_modules_dir(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return PyStr_FromString(dyn_MODULESDIR);
}
-static PyObject *py_bin_dir(PyObject *self)
+static PyObject *py_bin_dir(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return PyStr_FromString(dyn_BINDIR);
}
-static PyObject *py_sbin_dir(PyObject *self)
+static PyObject *py_sbin_dir(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return PyStr_FromString(dyn_SBINDIR);
}
static PyMethodDef pyparam_methods[] = {
- { "default_path", (PyCFunction)py_default_path, METH_NOARGS,
+ { "default_path", (PyCFunction)py_default_path, METH_NOARGS,
"Returns the default smb.conf path." },
{ "setup_dir", (PyCFunction)py_setup_dir, METH_NOARGS,
"Returns the compiled in location of provision tempates." },