Issue#27: C interface implementation

following issue #27
Note `length` and `location` bellow are of size_t type too so best to return `size_t` instead of `int` here. 

```
warning: implicit conversion loses integer precision: 'const size_t' (aka 'const unsigned long') to 'int' [-Wshorten-64-to-32]
```