added reading seg to C library.  Added seg test