WIP c version of lsrc