0 if successful; line contains the string.
1 if the end of file was reached; line contains the string.
-1 if an error occurred; line contains a description of the error.