PandA-2024.02
sum.c
Go to the documentation of this file.
1 #include "Python.h"
2 
3 #include "sum.h"
4 
5 __attribute__((no_sanitize_address))
6 long sum(long a, long b)
7 {
8  long sum = 0;
9  Py_Initialize();
10  PyObject *module_name = PyString_FromString("pysum");
11  PyObject *module = PyImport_Import(module_name);
12  PyObject *sum_function = PyObject_GetAttrString(module, "PySum");
13  PyObject *sum_args = Py_BuildValue("ii", a, b);
14  PyObject *result = PyObject_CallObject(sum_function, sum_args);
15  sum = PyInt_AsLong(result);
16  Py_Finalize();
17  return sum;
18 }
int sum(int *v, unsigned *n)
Definition: sum.c:4
__attribute__((no_sanitize_address))
Definition: sum.c:5
int result[SIZE]
Definition: adpcm.c:800
This class describes a generic module.

Generated on Mon Feb 12 2024 13:02:48 for PandA-2024.02 by doxygen 1.8.13