ocssw
V2022
|
fread_swap.c File Reference
Include dependency graph for fread_swap.c:
Go to the source code of this file.
Functions | |
size_t | fread_swap (int little_endian, void *ptr, size_t size, size_t nmemb, FILE *stream) |
size_t | fwrite_swap (int little_endian, const void *ptr, size_t size, size_t nmemb, FILE *stream) |
Function Documentation
◆ fread_swap()
size_t fread_swap | ( | int | little_endian, |
void * | ptr, | ||
size_t | size, | ||
size_t | nmemb, | ||
FILE * | stream | ||
) |
read a binary file and swap bytes if necessary
- Parameters
-
little_endian set to 0 for big endian files, 1 for little endian files ptr memory to read into size size of object to read in bytes nmemb number of objects to read stream file to read from
- Returns
- number of objects read
Definition at line 4 of file fread_swap.c.
◆ fwrite_swap()
size_t fwrite_swap | ( | int | little_endian, |
const void * | ptr, | ||
size_t | size, | ||
size_t | nmemb, | ||
FILE * | stream | ||
) |
write a binary file and swap bytes if necessary
- Parameters
-
little_endian set to 0 for big endian files, 1 for little endian files ptr memory to write size size of object to write in bytes nmemb number of objects to write stream file to write to
- Returns
- number of objects written
Definition at line 15 of file fread_swap.c.