123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- /*
- * Copyright (C) 2020 Weber Yann
- *
- * This file is part of pyrpn.
- *
- * pyrpn 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
- * any later version.
- *
- * pyrpn 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 pyrpn. If not, see <http://www.gnu.org/licenses/>.
- */
- #ifndef _PYTHON_IF_H__
- #define _PYTHON_IF_H__
-
- #include "config.h"
-
- #include <errno.h>
-
- #define PY_SSIZE_T_CLEAN
- #include <Python.h>
- #include "structmember.h"
-
- #include "rpn_if.h"
- #include "rpn_if_default.h"
- #include "python_rpnexpr.h"
-
- /**@defgroup python_if RPN Iterated Function Python class
- * @ingroup python_module
- * @brief Exposed Python class : RPNIterExpr
- *
- * Iterated expression are composed of RPN expressions, they are able to
- * iterate taking their parameters from a memory array and setting back values
- * in it on each iteration.
- *
- * @see ifs_if
- */
-
- /**@file python_if.h
- * @brief Python RPNIterExpr type headers
- * @ingroup python_if
- *
- * This file is the header of the RPNIterExpr Python class
- */
-
- /**@brief RPNIterExpr Python class methods list
- * @ingroup python_if */
- extern PyMethodDef RPNIterExpr_methods[];
- /**@brief RPNIterExpr Python class members list
- * @ingroup python_if */
- extern PyMemberDef RPNIterExpr_members[];
- /**@brief RPNIterExpr Python class type definition
- * @ingroup python_if */
- extern PyTypeObject RPNIterExprType;
-
- /**@brief Structure holding RPNIterExpr objects
- * @ingroup python_if */
- typedef struct
- {
- PyObject_VAR_HEAD;
-
- /**@brief Pointer on @ref rpn_if_s */
- rpn_if_t *rif;
-
- } PyRPNIterExpr_t;
-
- /**@brief RpnIterExpr __new__ method
- * @param subtype Type of object being created (pyrpn.RPNIterExpr)
- * @param args positional arguments for subtype
- * @param kwargs keyword argumenrs for subtype
- * @return The new Python RPNIterExpr object
- */
- PyObject* rpnif_new(PyTypeObject *subtype, PyObject* args, PyObject* kwds);
-
- /**@brief RpnIterExpr constructor
- * @param self New RPNIterExpr instance
- * @param args Positional arguments list
- * @param kwds Keywords arguments dict
- * @return 0 if no error else -1
- * @ingroup python_if
- */
- int rpnif_init(PyObject *self, PyObject *args, PyObject *kwds);
-
- /**@brief RPNIterExpr __del__ method
- * @param self RPNExpr instance
- * @ingroup python_type
- */
- void rpnif_del(PyObject *self);
-
- /**@brief RPNIterExpr __getstate__ method for pickling
- * @param cls RPNIterExpr type object
- * @param noargs Not an argument...
- * @return A bytes Python instance suitable as argument for
- * @ref rpnexpr_setstate
- */
- PyObject* rpnif_getstate(PyObject *cls, PyObject *noargs);
-
- /**@brief RPNIterExpr __setstate__ method for pickling
- * @param cls RPNIterExpr type object
- * @param state Should by a bytes Python instance returned by @ref
- * rpnexpr_getstate
- * @return A bytes Python instance suitable as argument for
- * @ref rpnexpr_setstate
- */
- PyObject* rpnif_setstate(PyObject *cls, PyObject *state);
-
- /**@brief RPNIterExpr.__repr__()
- * @param self RPNIterExpr instance
- * @ingroup python_type
- */
- PyObject* rpnif_repr(PyObject *self);
-
- /**@brief RPNIterExpr.__str__()
- * @param self RPNIterExpr instance
- * @ingroup python_type
- */
- PyObject* rpnif_str(PyObject *self);
-
- #endif
|