complete initial implementation of lsrc in C