diff options
author | John Mulligan <jmulligan@redhat.com> | 2022-04-23 14:17:48 -0400 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2022-05-06 17:16:30 +0000 |
commit | f74d163ef088eb279110dfc872a18a2fc0d8fb71 (patch) | |
tree | 9bddacf85b207c9e9e9ec55191b342bef5976017 /lib/smbconf | |
parent | f0e157747fab81eda6e749320dd673f4cd1a1c73 (diff) | |
download | samba-f74d163ef088eb279110dfc872a18a2fc0d8fb71.tar.gz |
lib/smbconf: move python smbconf type definition to header
Moving the definition of the type to a header file will allow
future reuse of the C-type fields in a different C-API python
module.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'lib/smbconf')
-rw-r--r-- | lib/smbconf/pysmbconf.c | 9 | ||||
-rw-r--r-- | lib/smbconf/pysmbconf.h | 36 |
2 files changed, 37 insertions, 8 deletions
diff --git a/lib/smbconf/pysmbconf.c b/lib/smbconf/pysmbconf.c index abf77ddc1eb..5250a03684f 100644 --- a/lib/smbconf/pysmbconf.c +++ b/lib/smbconf/pysmbconf.c @@ -24,17 +24,10 @@ #include "lib/smbconf/smbconf.h" #include "lib/smbconf/smbconf_txt.h" +#include "lib/smbconf/pysmbconf.h" static PyObject *PyExc_SMBConfError; -typedef struct { - PyObject_HEAD - - /* C values embedded in our python type */ - TALLOC_CTX * mem_ctx; - struct smbconf_ctx *conf_ctx; -} py_SMBConf_Object; - static void py_raise_SMBConfError(sbcErr err) { PyObject *v = NULL; diff --git a/lib/smbconf/pysmbconf.h b/lib/smbconf/pysmbconf.h new file mode 100644 index 00000000000..e8c6c9998e3 --- /dev/null +++ b/lib/smbconf/pysmbconf.h @@ -0,0 +1,36 @@ +/* + * Unix SMB/CIFS implementation. + * libsmbconf - Samba configuration library - Python bindings + * + * Copyright (C) John Mulligan <phlogistonjohn@asynchrono.us> 2022 + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#ifndef _PYSMBCONF_H_ +#define _PYSMBCONF_H_ + +#include <Python.h> +#include "lib/smbconf/smbconf.h" + +typedef struct { + PyObject_HEAD + + /* C values embedded in our python type */ + TALLOC_CTX * mem_ctx; + struct smbconf_ctx *conf_ctx; +} py_SMBConf_Object; + + +#endif /* _PYSMBCONF_H_ */ |