Note: Sorry, this code is incredibly messy. I'm trying to make this work, but it does not yet at all.
I get a segmentation fault when calling the function passed by reference. Calling the main
xxx@linux-fkyc:~/Workspace/nyxbin/src> python3 example_build.py
generating ./_my_example.c
running build_ext
building '_my_example' extension
/usr/bin/gcc -Wno-unused-result -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fPIC -I/usr/include/python3.4m -c _my_example.c -o ./_my_example.o
gcc -pthread -shared ./_my_example.o -L/usr/lib64 -lpython3.4m -o ./_my_example.cpython-34m.so
xxx@linux-fkyc:~/Workspace/nyxbin/src> python3 loader.py
<cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x7f9d4ba509b0> ['dyndisp_negate', 'dyndisp_t2']
t2
t2: 2
Segmentation fault (core dumped)