]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/smbconf: move python smbconf type definition to header
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 23 Apr 2022 18:17:48 +0000 (14:17 -0400)
committerJeremy Allison <jra@samba.org>
Fri, 6 May 2022 17:16:30 +0000 (17:16 +0000)
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>
lib/smbconf/pysmbconf.c
lib/smbconf/pysmbconf.h [new file with mode: 0644]

index abf77ddc1eb6dd012834ced838397f556ebed88d..5250a03684fb5859643e79e80f98bd6ca296b152 100644 (file)
 
 #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 (file)
index 0000000..e8c6c99
--- /dev/null
@@ -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_ */