Write a byte (8 bits). Throws an exception of type (cfile_error *) if the OS returns an error on write
| 805 | // Write a byte (8 bits). |
| 806 | // Throws an exception of type (cfile_error *) if the OS returns an error on write |
| 807 | void cf_WriteByte(CFILE *cfp, int8_t b) { |
| 808 | if (fputc(b, cfp->file) == EOF) |
| 809 | ThrowCFileError(CFE_WRITING, cfp, strerror(errno)); |
| 810 | cfp->position++; |
| 811 | // If text file & writing newline, increment again for LF |
| 812 | if ((cfp->flags & CFF_TEXT) && (b == '\n')) // check for text mode newline |
| 813 | cfp->position++; |
| 814 | } |
| 815 | |
| 816 | // Write a float (32 bits) |
| 817 | // Throws an exception of type (cfile_error *) if the OS returns an error on write |
no test coverage detected