MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / cf_WriteByte

Function cf_WriteByte

cfile/cfile.cpp:807–814  ·  view source on GitHub ↗

Write a byte (8 bits). Throws an exception of type (cfile_error *) if the OS returns an error on write

Source from the content-addressed store, hash-verified

805// Write a byte (8 bits).
806// Throws an exception of type (cfile_error *) if the OS returns an error on write
807void 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

Callers 15

mng_WriteShipPageFunction · 0.85
mng_WriteNewShipPageFunction · 0.85
mng_WriteSoundPageFunction · 0.85
mng_WriteGamefilePageFunction · 0.85
mng_MakeLockerFunction · 0.85
mng_WritePagelockFunction · 0.85
mng_WriteUnknownPageFunction · 0.85
StartManagePageFunction · 0.85
mng_ReplacePageFunction · 0.85
mng_DeletePageFunction · 0.85
mng_WriteLightingChunkFunction · 0.85

Calls 1

ThrowCFileErrorFunction · 0.85

Tested by

no test coverage detected