#include "lasfileio.h"
ssize_t c_write ( int fd, const void *buf, size_t count, size_t size )
File descriptor of the file to be written. This file should be opened by the standard unix open call.
Pointer to a buffer for the data written to the file. The data is converted to big endian byte order before it is written.
Specifies the number of bytes to write to the file.
Specifies the size, in bytes, of each element written to the file. This is limited to be 1, 2, 4, or 8 bytes to match the sizes of standard data types. The count parameter must be an even multiple of the size parameter.
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_write() routine is the equivalent of the standard unix write routine, with the added size parameter, that will perform byte swapping on platforms that use little endian byte order.
c_write() returns the number of bytes successfully written. E_FAIL (-1) is returned if an error is encountered writting the data or if the size or count parameters are invalid.