From d58270c5373416997cc70fe392b307a4522e43d9 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 22 Dec 2008 04:38:57 +0100 Subject: [PATCH] Add header for pyparam. --- source4/auth/credentials/pycredentials.c | 4 +--- source4/auth/pyauth.c | 5 +---- source4/lib/registry/pyregistry.c | 2 +- source4/librpc/rpc/pyrpc.c | 2 +- source4/param/provision.c | 2 +- source4/param/pyparam.h | 25 ++++++++++++++++++++++++ source4/scripting/python/pyglue.c | 2 +- 7 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 source4/param/pyparam.h diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c index 5f3801cdf63..4fa9fe56963 100644 --- a/source4/auth/credentials/pycredentials.c +++ b/source4/auth/credentials/pycredentials.c @@ -22,9 +22,7 @@ #include "lib/cmdline/credentials.h" #include "librpc/gen_ndr/samr.h" /* for struct samr_Password */ #include "libcli/util/pyerrors.h" - -/* Here until param/param.i gets rewritten in "manual" C */ -extern struct loadparm_context *lp_from_py_object(PyObject *py_obj); +#include "param/pyparam.h" struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj) { diff --git a/source4/auth/pyauth.c b/source4/auth/pyauth.c index cc717bf42f5..e97174fcc3a 100644 --- a/source4/auth/pyauth.c +++ b/source4/auth/pyauth.c @@ -20,10 +20,7 @@ #include "param/param.h" #include "pyauth.h" #include "auth/system_session_proto.h" - -/* FIXME: These should be in a header file somewhere, once we finish moving - * away from SWIG .. */ -extern struct loadparm_context *lp_from_py_object(PyObject *py_obj); +#include "param/pyparam.h" PyTypeObject PyAuthSession = { .tp_name = "AuthSession", diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c index b93071f7031..2d2f2fb6859 100644 --- a/source4/lib/registry/pyregistry.c +++ b/source4/lib/registry/pyregistry.c @@ -24,8 +24,8 @@ #include "scripting/python/modules.h" /* for py_iconv_convenience() */ #include #include +#include "param/pyparam.h" -extern struct loadparm_context *lp_from_py_object(PyObject *py_obj); extern struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj); PyAPI_DATA(PyTypeObject) PyRegistryKey; diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c index a59f355d436..83bd6425817 100644 --- a/source4/librpc/rpc/pyrpc.c +++ b/source4/librpc/rpc/pyrpc.c @@ -23,6 +23,7 @@ #include "librpc/rpc/pyrpc.h" #include "librpc/rpc/dcerpc.h" #include "lib/events/events.h" +#include "param/pyparam.h" static PyObject *py_dcerpc_run_function(dcerpc_InterfaceObject *iface, struct PyNdrRpcMethodDef *md, PyObject *args, PyObject *kwargs) { @@ -315,7 +316,6 @@ static PyObject *dcerpc_interface_new(PyTypeObject *self, PyObject *args, PyObje const char *kwnames[] = { "binding", "syntax", "lp_ctx", "credentials", "basis_connection", NULL }; - extern struct loadparm_context *lp_from_py_object(PyObject *py_obj); extern struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj); struct ndr_interface_table *table; diff --git a/source4/param/provision.c b/source4/param/provision.c index b207cf61459..7a06f77d968 100644 --- a/source4/param/provision.c +++ b/source4/param/provision.c @@ -28,12 +28,12 @@ #include #include "scripting/python/modules.h" #include "lib/ldb/pyldb.h" +#include "param/pyparam.h" NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, struct provision_settings *settings, struct provision_result *result) { - extern struct loadparm_context *lp_from_py_object(PyObject *py_obj); PyObject *provision_mod, *provision_dict, *provision_fn, *py_result, *parameters; DEBUG(0,("Provision for Become-DC test using python\n")); diff --git a/source4/param/pyparam.h b/source4/param/pyparam.h new file mode 100644 index 00000000000..4d7e32d9082 --- /dev/null +++ b/source4/param/pyparam.h @@ -0,0 +1,25 @@ +/* + Unix SMB/CIFS implementation. + Samba utility functions + Copyright (C) Jelmer Vernooij 2008 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _PYPARAM_H_ +#define _PYPARAM_H_ + +struct loadparm_context *lp_from_py_object(PyObject *py_obj); + +#endif /* _PYPARAM_H_ */ diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c index fc9c4a94b56..1b599784778 100644 --- a/source4/scripting/python/pyglue.c +++ b/source4/scripting/python/pyglue.c @@ -29,10 +29,10 @@ #include "libcli/util/pyerrors.h" #include "libcli/security/security.h" #include "auth/pyauth.h" +#include "param/pyparam.h" /* FIXME: These should be in a header file somewhere, once we finish moving * away from SWIG .. */ -extern struct loadparm_context *lp_from_py_object(PyObject *py_obj); extern struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj); #define PyErr_LDB_OR_RAISE(py_ldb, ldb) \ -- 2.34.1