Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs generated from: feat: add IO.fgetc (#1405)
* feat: add feof and ferror These are C stdio functions that enable programmers to determine if a file read resulted in an error or EOF encounter. We can use these to power a definition of IO.fgetc, which is currently not defined. * feat: implement missing IO.fgetc IO defined a function, fgetc (distinct from IO.Raw.fgetc) which actually produced invalid code, since the name was not overridden and C does not define IO_fgetc. There was also a TODO to handle EOF conditions; so, I've implemented the function, checking for EOF and error conditions using the Raw stdio wrappers. IO.fgetc returns a Char in Success on success and an error string on failure. * refactor: distinguish EOF from errors in IO.fgetc We now report whether or not the error encountered in fgetc was EOF. Note that we don't yet report on the contents of other errors.
- Loading branch information