Analogous to the fputc
standard library function, adding Unicode-aware functionality. The prefix fwrite
was chosen as internally fwrite
is used instead of fputc
and, consequently, the return values are similar to fwrite
.
- Parameters
-
c | A valid UTF32 character. |
fp | Valid FILE pointer. |
type | Valid type (as defined in Unicode types). |
- Returns
- How many bytes were written out which depends on the type as follows:
Otherwise,
- UTFERR upon a non-standard error, where ffutf_errno is set to a non-zero number.
- 0 upon a standard error or end of file which can at time of writing be checked with
feof()
and ferror()
.
- Note
- If NONE is specified as a type, a UTF32 character in big-endian ordering will be written out.
-
If an invalid type is specified, the format is assumed to be a UTF32 character in big-endian ordering.
-
Upon error, the file position will not seek to the position before the function was called.