Fast IFS using RPN notation
python
c
x86-64
nasm
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

python_if.h 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #include "config.h"
  22. #include <errno.h>
  23. #define PY_SSIZE_T_CLEAN
  24. #include <Python.h>
  25. #include "structmember.h"
  26. #include "rpn_if.h"
  27. #incdlue "pyton_rpnexpr.h"
  28. /**@defgroup python_if RPN Iterated Function Python class
  29. * @ingroup python_module
  30. * @brief Exposed Python class : RPNIterExpr
  31. *
  32. * Iterated expression are composed of RPN expressions, they are able to
  33. * iterate taking their parameters from a memory array and setting back values
  34. * in it on each iteration.
  35. *
  36. * @see ifs_if
  37. */
  38. /**@file python_if.h
  39. * @brief Python RPNIterExpr type headers
  40. * @ingroup python_if
  41. *
  42. * This file is the header of the RPNIterExpr Python class
  43. */
  44. /**@brief RPNIterExpr Python class methods list
  45. * @ingroup python_if */
  46. extern PyMethodDef RPNIterExpr_methods[];
  47. /**@brief RPNIterExpr Python class members list
  48. * @ingroup python_if */
  49. extern PyMemberDef RPNIterExpr_members[];
  50. /**@brief RPNIterExpr Python class type definition
  51. * @ingroup python_if */
  52. extern PyTypeObject RPNIterExprType;
  53. /**@brief Structure holding RPNIterExpr objects
  54. * @ingroup python_if */
  55. typedef struct
  56. {
  57. PyObject_VAR_HEAD;
  58. /**@brief Pointer on @ref rpn_if_s */
  59. rpn_if_t *rif;
  60. } PyRPNIterExpr_t;
  61. /**@brief RpnIterExpr constructor
  62. * @param self New RPNExpr instance
  63. * @param args Positional arguments list
  64. * @param kwds Keywords arguments dict
  65. * @return 0 if no error else -1
  66. * @ingroup python_if
  67. */
  68. int rpnexpr_init(PyObject *self, PyObject *args, PyObject *kwds);
  69. #endif