Strategies for finding binary dependencies
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add python-extension test

+32
+1
contrib/python-extension/.gitignore
··· 1 + *.so
+3
contrib/python-extension/build.sh
··· 1 + #!/bin/sh -eu 2 + 3 + gcc -shared -I/usr/include/python3.13 mod.c -o mod.so
+28
contrib/python-extension/mod.c
··· 1 + #define PY_SSIZE_T_CLEAN 2 + #include <Python.h> 3 + #include <signal.h> 4 + 5 + static PyObject * 6 + add(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 + 17 + static PyMethodDef methods[] = { 18 + { "add", add, METH_VARARGS, "" }, 19 + { NULL, NULL, 0, NULL } 20 + }; 21 + 22 + static struct PyModuleDef module = { 23 + PyModuleDef_HEAD_INIT, "add", NULL, -1, methods 24 + }; 25 + 26 + PyMODINIT_FUNC PyInit_mod(void) { 27 + return PyModule_Create(&module); 28 + }