#include "lasfileio.h"
size_t c_fread ( void *buf, size_t size, size_t count, FILE *stream )
Pointer to a buffer for the data read from the file. The data is converted from big endian byte order to the local byte order.
Specifies the size, in bytes, of each element read from the file. This is limited to be 1, 2, 4, or 8 bytes to match the sizes of standard data types.
Specifies the number of elements of size bytes to read from the file.
Pointer to the file to read. This file should be opened by the standard C fopen call.
All data files for LAS are written using big endian byte order. This is the byte order used by Mips, Sparc, and Motorola processors. The c_fread() routine is the equivalent of the standard C fread routine that will perform byte swapping on platforms that use little endian byte order.
c_fread() returns the number of items successfully read. If an error occurs, or the end-of-file is reached, the return value is a short item count. E_FAIL (-1) may be returned if the size or count parameters are invalid.