Ext support for c

Adapted the C++ implementation/tests to C