Strategies for finding binary dependencies
at main 28 lines 561 B view raw
1#define PY_SSIZE_T_CLEAN 2#include <Python.h> 3#include <signal.h> 4 5static PyObject * 6add(PyObject *self, PyObject *args) { 7 int a, b, result; 8 9 if (!PyArg_ParseTuple(args, "ii", &a, &b)) 10 return NULL; 11 12 result = a + b; 13 raise(SIGINT); 14 return PyLong_FromLong(result); 15} 16 17static PyMethodDef methods[] = { 18 { "add", add, METH_VARARGS, "" }, 19 { NULL, NULL, 0, NULL } 20}; 21 22static struct PyModuleDef module = { 23 PyModuleDef_HEAD_INIT, "add", NULL, -1, methods 24}; 25 26PyMODINIT_FUNC PyInit_mod(void) { 27 return PyModule_Create(&module); 28}