(WIP) port of clib-search(1) to C