Surely you could just write a library in C to do that?