(bind-func svm_read_line
(lambda (buf fp max_len)
(let ((res (fgets buf max_len fp)))
(cond ((null? res)
(if (<> (feof fp) 0)
(println "Warning: error reading string"))
#f)
((> (strnlen res max_len) max_len)
(println "Error: encountered line length longer than" max_len)
#f)
(else #t)))))