s3:utils: let smbstatus report anonymous signing/encryption explicitly
[samba.git] / python / py3compat.h
1 /*
2    Unix SMB/CIFS implementation.
3    Python 3 compatibility macros
4    Copyright (C) Petr Viktorin <pviktori@redhat.com> 2015
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef _SAMBA_PY3COMPAT_H_
21 #define _SAMBA_PY3COMPAT_H_
22 #include "lib/replace/system/python.h"
23
24 /* Quick docs:
25  * Syntax for module initialization is as in Python 3, except the entrypoint
26  * function definition and declaration:
27  *     PyMODINIT_FUNC PyInit_modulename(void);
28  *     PyMODINIT_FUNC PyInit_modulename(void)
29  *     {
30  *         ...
31  *     }
32  * is replaced by:
33  *     MODULE_INIT_FUNC(modulename)
34  *     {
35  *         ...
36  *     }
37  *
38  * In the entrypoint, create a module using PyModule_Create and PyModuleDef,
39  * and return it. See Python 3 documentation for details.
40  */
41
42 #define MODULE_INIT_FUNC(name) \
43     PyMODINIT_FUNC PyInit_ ## name(void); \
44     PyMODINIT_FUNC PyInit_ ## name(void)
45
46 /* PyArg_ParseTuple/Py_BuildValue argument */
47
48 #define PYARG_BYTES_LEN "y#"
49 #define PYARG_STR_UNI "es"
50
51 #endif