47#include <sdfio/sdfio_export.h>
322 size_t capacity,
size_t *size);
Layout of a buffer in memory.
const char * sdfio_reader_magic(const sdfio_reader *reader, size_t index)
Returns a magic that a file can start with, for example "bISO-2.0": the letter b or a for the binary ...
sdfio_status sdfio_reader_set_buffer(sdfio_reader *reader, size_t size)
Sets the size in bytes of the buffer between the reader and its stream.
sdfio_status sdfio_read_data(sdfio_reader *reader, const sdfio_layout *layout, void *dst, size_t rows)
Reads the next rows of the data area as the file codes them.
sdfio_status sdfio_reader_set_time_zone(sdfio_reader *reader, const sdfio_time_zone *time_zone)
Sets the conversion of the dates of ISO-1.0 files.
sdfio_status sdfio_reader_set_chunk(sdfio_reader *reader, size_t count)
Sets the number of values that the reader converts at a time.
sdfio_status sdfio_reader_add_binary(sdfio_reader *reader)
Adds the binary format to the formats that the reader reads, the version numbers bISO-1....
const sdfio_header * sdfio_reader_header(const sdfio_reader *reader)
Returns the header of the opened file, or null if no file is open.
sdfio_status sdfio_open_memory(sdfio_reader *reader, const void *data, size_t size)
Opens a block of memory as the source and reads the header.
sdfio_status sdfio_open_stream(sdfio_reader *reader, const sdfio_stream *stream)
Opens a stream as the source and reads the header.
struct sdfio_reader sdfio_reader
Opaque handle of a reader.
Definition reader.h:58
sdfio_status sdfio_reader_add_ascii(sdfio_reader *reader)
Adds the ASCII format to the formats that the reader reads, the version numbers aISO-1....
sdfio_status sdfio_reader_create(const sdfio_allocator *allocator, sdfio_reader **reader)
Creates a reader.
sdfio_status sdfio_read_trailer(sdfio_reader *reader, char *buffer, size_t capacity, size_t *size)
Reads the next part of the trailer, the free text after the data area, into a buffer of the caller.
size_t sdfio_reader_magic_count(const sdfio_reader *reader)
Returns the number of magics that a file can start with for the formats that the reader adds: two for...
sdfio_status sdfio_read_heights(sdfio_reader *reader, const sdfio_layout *layout, void *dst)
Reads the remaining rows as heights in metres into a buffer that lies in memory as the layout describ...
const char * sdfio_reader_error_message(const sdfio_reader *reader)
Returns a description of the most recent failure of the reader, or an empty string if none occurred.
void sdfio_reader_free(sdfio_reader *reader)
Releases a reader and closes the file that sdfio_open_file() opened, if any.
sdfio_status sdfio_reader_reset(sdfio_reader *reader)
Returns a reader to the state new, so that it can open another file, block of memory or stream.
Memory management callbacks that replace malloc() and free(), for example with a pool or a bump alloc...
Definition types.h:180
Description of a buffer of the caller for heights or for the values of the data area: the type of its...
Definition layout.h:45
Callbacks that provide or accept the bytes of a file.
Definition types.h:213
Conversion of the dates of ISO-1.0 files between the local clock of the writer and UTC.
Definition types.h:311
Status codes, enumerations, constants, and the structures for allocator, stream and time zone.
sdfio_status
Result of a function call.
Definition types.h:31