58#include <sdfio/sdfio_export.h>
248 const void *src,
size_t rows);
322 const char *text,
size_t size);
Layout of a buffer in memory.
Reader of a file, memory or a stream.
struct sdfio_reader sdfio_reader
Opaque handle of a reader.
Definition reader.h:58
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
sdfio_status sdfio_write_trailer_field(sdfio_writer *writer, const char *name, const char *value)
Writes a line field = value of the trailer, which ISO-2.0 expects.
sdfio_status sdfio_writer_add_binary(sdfio_writer *writer)
Adds the binary format to the formats that the writer writes.
sdfio_status sdfio_writer_estimate_size(const sdfio_writer *writer, const sdfio_header *header, size_t *size)
Estimates the number of bytes that the writer writes for a header, without the trailer.
sdfio_status sdfio_writer_create(const sdfio_allocator *allocator, sdfio_writer **writer)
Creates a writer.
sdfio_status sdfio_copy_trailer(sdfio_reader *reader, sdfio_writer *writer)
Copies the trailer of the file that a reader has opened to the file of a writer.
struct sdfio_writer sdfio_writer
Opaque handle of a writer.
Definition writer.h:69
const char * sdfio_writer_error_message(const sdfio_writer *writer)
Returns a description of the most recent failure of the writer, or an empty string if none occurred.
sdfio_status sdfio_writer_set_buffer(sdfio_writer *writer, size_t size)
Sets the size in bytes of the buffer between the writer and its stream.
sdfio_status sdfio_write_data(sdfio_writer *writer, const sdfio_layout *layout, const void *src, size_t rows)
Writes the next rows of the data area.
void sdfio_writer_free(sdfio_writer *writer)
Releases a writer.
sdfio_status sdfio_writer_set_chunk(sdfio_writer *writer, size_t count)
Sets the number of values that the writer converts at a time.
sdfio_status sdfio_create_stream(sdfio_writer *writer, const sdfio_stream *stream, const sdfio_header *header)
Starts a file that the header describes, including the numbers of columns and rows.
sdfio_status sdfio_write_trailer_text(sdfio_writer *writer, const char *text, size_t size)
Writes text to the trailer.
sdfio_status sdfio_writer_add_ascii(sdfio_writer *writer)
Adds the ASCII format to the formats that the writer writes.
sdfio_status sdfio_write_heights(sdfio_writer *writer, const sdfio_layout *layout, const void *src)
Writes the whole data area from a matrix of heights in metres that lies in memory as the layout descr...
sdfio_status sdfio_writer_set_time_zone(sdfio_writer *writer, const sdfio_time_zone *time_zone)
Sets the conversion of the dates of ISO-1.0 files.
sdfio_status sdfio_writer_reset(sdfio_writer *writer)
Returns a writer to the state new, so that it can create another file on a path or a stream.
sdfio_status sdfio_end_file(sdfio_writer *writer)
Ends the file: closes the trailer, the last record, flushes the stream and, for a file that sdfio_cre...