Added C utility functions: read_line and read_until