|
@@ -0,0 +1,81 @@
|
|
1
|
+/*
|
|
2
|
+ * Copyright (C) 2020 Weber Yann
|
|
3
|
+ *
|
|
4
|
+ * This file is part of pyrpn.
|
|
5
|
+ *
|
|
6
|
+ * pyrpn 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
|
+ * any later version.
|
|
10
|
+ *
|
|
11
|
+ * pyrpn 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 pyrpn. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+ */
|
|
19
|
+#ifndef _PYTHON_IF_H__
|
|
20
|
+#define _PYTHON_IF_H__
|
|
21
|
+
|
|
22
|
+#include "config.h"
|
|
23
|
+
|
|
24
|
+#include <errno.h>
|
|
25
|
+
|
|
26
|
+#define PY_SSIZE_T_CLEAN
|
|
27
|
+#include <Python.h>
|
|
28
|
+#include "structmember.h"
|
|
29
|
+
|
|
30
|
+#include "rpn_if.h"
|
|
31
|
+#incdlue "pyton_rpnexpr.h"
|
|
32
|
+
|
|
33
|
+/**@defgroup python_if RPN Iterated Function Python class
|
|
34
|
+ * @ingroup python_module
|
|
35
|
+ * @brief Exposed Python class : RPNIterExpr
|
|
36
|
+ *
|
|
37
|
+ * Iterated expression are composed of RPN expressions, they are able to
|
|
38
|
+ * iterate taking their parameters from a memory array and setting back values
|
|
39
|
+ * in it on each iteration.
|
|
40
|
+ *
|
|
41
|
+ * @see ifs_if
|
|
42
|
+ */
|
|
43
|
+
|
|
44
|
+/**@file python_if.h
|
|
45
|
+ * @brief Python RPNIterExpr type headers
|
|
46
|
+ * @ingroup python_if
|
|
47
|
+ *
|
|
48
|
+ * This file is the header of the RPNIterExpr Python class
|
|
49
|
+ */
|
|
50
|
+
|
|
51
|
+/**@brief RPNIterExpr Python class methods list
|
|
52
|
+ * @ingroup python_if */
|
|
53
|
+extern PyMethodDef RPNIterExpr_methods[];
|
|
54
|
+/**@brief RPNIterExpr Python class members list
|
|
55
|
+ * @ingroup python_if */
|
|
56
|
+extern PyMemberDef RPNIterExpr_members[];
|
|
57
|
+/**@brief RPNIterExpr Python class type definition
|
|
58
|
+ * @ingroup python_if */
|
|
59
|
+extern PyTypeObject RPNIterExprType;
|
|
60
|
+
|
|
61
|
+/**@brief Structure holding RPNIterExpr objects
|
|
62
|
+ * @ingroup python_if */
|
|
63
|
+typedef struct
|
|
64
|
+{
|
|
65
|
+ PyObject_VAR_HEAD;
|
|
66
|
+
|
|
67
|
+ /**@brief Pointer on @ref rpn_if_s */
|
|
68
|
+ rpn_if_t *rif;
|
|
69
|
+} PyRPNIterExpr_t;
|
|
70
|
+
|
|
71
|
+/**@brief RpnIterExpr constructor
|
|
72
|
+ * @param self New RPNExpr instance
|
|
73
|
+ * @param args Positional arguments list
|
|
74
|
+ * @param kwds Keywords arguments dict
|
|
75
|
+ * @return 0 if no error else -1
|
|
76
|
+ * @ingroup python_if
|
|
77
|
+ */
|
|
78
|
+int rpnexpr_init(PyObject *self, PyObject *args, PyObject *kwds);
|
|
79
|
+
|
|
80
|
+#endif
|
|
81
|
+
|