cbar.h: use intptr_t for priv argument
tests.c: add gpio emulator
make the shit allocatable
add allocation test