From: John Mulligan Date: Sat, 23 Apr 2022 18:17:48 +0000 (-0400) Subject: lib/smbconf: move python smbconf type definition to header X-Git-Tag: talloc-2.3.4~240 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f74d163ef088eb279110dfc872a18a2fc0d8fb71;p=thirdparty%2Fsamba.git 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 Reviewed-by: Jeremy Allison Reviewed-by: Douglas Bagnall --- 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 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 . + */ + +#ifndef _PYSMBCONF_H_ +#define _PYSMBCONF_H_ + +#include +#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_ */