libgta
1.0.4
Read and Write Generic Tagged Array (GTA) files
|
The libgta C interface. More...
Typedefs | |
typedef struct gta_internal_header_struct | gta_header_t |
The GTA header type. | |
typedef struct gta_internal_taglist_struct | gta_taglist_t |
The GTA tag list type. More... | |
typedef size_t(* | gta_read_t )(intptr_t userdata, void *buffer, size_t size, int *error) |
Custom input function. More... | |
typedef size_t(* | gta_write_t )(intptr_t userdata, const void *buffer, size_t size, int *error) |
Custom output function. More... | |
typedef void(* | gta_seek_t )(intptr_t userdata, intmax_t offset, int whence, int *error) |
Custom seek function. More... | |
typedef struct gta_internal_io_state_struct | gta_io_state_t |
State for element-based input/output. More... | |
Enumerations | |
enum | gta_type_t { GTA_INT8 = 1, GTA_UINT8 = 2, GTA_INT16 = 3, GTA_UINT16 = 4, GTA_INT32 = 5, GTA_UINT32 = 6, GTA_INT64 = 7, GTA_UINT64 = 8, GTA_INT128 = 9, GTA_UINT128 = 10, GTA_FLOAT32 = 11, GTA_FLOAT64 = 12, GTA_FLOAT128 = 13, GTA_CFLOAT32 = 14, GTA_CFLOAT64 = 15, GTA_CFLOAT128 = 16, GTA_BLOB = 0 } |
GTA data types. More... | |
enum | gta_compression_t { GTA_NONE = 0, GTA_ZLIB = 1, GTA_ZLIB1 = 4, GTA_ZLIB2 = 5, GTA_ZLIB3 = 6, GTA_ZLIB4 = 7, GTA_ZLIB5 = 8, GTA_ZLIB6 = 9, GTA_ZLIB7 = 10, GTA_ZLIB8 = 11, GTA_ZLIB9 = 12, GTA_BZIP2 = 2, GTA_XZ = 3 } |
GTA compression algorithms. More... | |
Functions | |||||||||||||||||||||||||||||||||||||
Read and Write Complete Arrays | |||||||||||||||||||||||||||||||||||||
These functions are intended to be used by applications that know that all the data will fit into memory. | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_copy_data (const gta_header_t *restrict read_header, gta_read_t read_fn, intptr_t read_userdata, const gta_header_t *restrict write_header, gta_write_t write_fn, intptr_t write_userdata) | ||||||||||||||||||||||||||||||||||||
Copy the complete data. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_copy_data_stream (const gta_header_t *restrict read_header, FILE *restrict read_f, const gta_header_t *restrict write_header, FILE *restrict write_f) | ||||||||||||||||||||||||||||||||||||
Copy the complete data between streams. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_copy_data_fd (const gta_header_t *restrict read_header, int read_fd, const gta_header_t *restrict write_header, int write_fd) | ||||||||||||||||||||||||||||||||||||
Copy the complete data between file descriptors. More... | |||||||||||||||||||||||||||||||||||||
Read and Write Array Elements | |||||||||||||||||||||||||||||||||||||
Get the address of an array element (non-modifiable).
These functions are intended to be used for filtering a complete array on a per-element basis. They read or write a given number of elements, and it is expected that they are used repeatedly until all elements of an array have been read or written. Theses function work for all GTAs, with or without compression, an the input and output streams do not need to be seekable. Element-based input/output needs a state structure. This structure must be allocated with gta_create_io_state() before the first element is read or written, and freed with gta_destroy_io_state() after the last element was read or written, or after an error occured. | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_clone_io_state (gta_io_state_t *restrict dst_io_state, const gta_io_state_t *restrict src_io_state) | ||||||||||||||||||||||||||||||||||||
Clone an input/output state. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_read_elements (const gta_header_t *restrict header, gta_io_state_t *restrict io_state, uintmax_t n, void *restrict buf, gta_read_t read_fn, intptr_t userdata) | ||||||||||||||||||||||||||||||||||||
Read array elements. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_read_elements_from_stream (const gta_header_t *restrict header, gta_io_state_t *restrict io_state, uintmax_t n, void *restrict buf, FILE *restrict f) | ||||||||||||||||||||||||||||||||||||
Read array elements. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_read_elements_from_fd (const gta_header_t *restrict header, gta_io_state_t *restrict io_state, uintmax_t n, void *restrict buf, int fd) | ||||||||||||||||||||||||||||||||||||
Read array elements. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_write_elements (const gta_header_t *restrict header, gta_io_state_t *restrict io_state, uintmax_t n, const void *restrict buf, gta_write_t write_fn, intptr_t userdata) | ||||||||||||||||||||||||||||||||||||
Write array elements. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_write_elements_to_stream (const gta_header_t *restrict header, gta_io_state_t *restrict io_state, uintmax_t n, const void *restrict buf, FILE *restrict f) | ||||||||||||||||||||||||||||||||||||
Write array elements. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_write_elements_to_fd (const gta_header_t *restrict header, gta_io_state_t *restrict io_state, uintmax_t n, const void *restrict buf, int fd) | ||||||||||||||||||||||||||||||||||||
Write array elements. More... | |||||||||||||||||||||||||||||||||||||
Read and Write Array Blocks | |||||||||||||||||||||||||||||||||||||
These functions can only be used if the data is not compression (see gta_get_compression()) and the input/output is seekable. | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_read_block (const gta_header_t *restrict header, intmax_t data_offset, const uintmax_t *restrict lower_coordinates, const uintmax_t *restrict higher_coordinates, void *restrict block, gta_read_t read_fn, gta_seek_t seek_fn, intptr_t userdata) | ||||||||||||||||||||||||||||||||||||
Read an array block. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_read_block_from_stream (const gta_header_t *restrict header, intmax_t data_offset, const uintmax_t *restrict lower_coordinates, const uintmax_t *restrict higher_coordinates, void *restrict block, FILE *restrict f) | ||||||||||||||||||||||||||||||||||||
Read an array block from a stream. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_read_block_from_fd (const gta_header_t *restrict header, intmax_t data_offset, const uintmax_t *restrict lower_coordinates, const uintmax_t *restrict higher_coordinates, void *restrict block, int fd) | ||||||||||||||||||||||||||||||||||||
Read an array block from a file descriptor. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_write_block (const gta_header_t *restrict header, intmax_t data_offset, const uintmax_t *restrict lower_coordinates, const uintmax_t *restrict higher_coordinates, const void *restrict block, gta_write_t write_fn, gta_seek_t seek_fn, intptr_t userdata) | ||||||||||||||||||||||||||||||||||||
Write an array block. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_write_block_to_stream (const gta_header_t *restrict header, intmax_t data_offset, const uintmax_t *restrict lower_coordinates, const uintmax_t *restrict higher_coordinates, const void *restrict block, FILE *restrict f) | ||||||||||||||||||||||||||||||||||||
Write an array block to a stream. More... | |||||||||||||||||||||||||||||||||||||
gta_result_t | gta_write_block_to_fd (const gta_header_t *restrict header, intmax_t data_offset, const uintmax_t *restrict lower_coordinates, const uintmax_t *restrict higher_coordinates, const void *restrict block, int fd) | ||||||||||||||||||||||||||||||||||||
Write an array block to a file descriptor. More... | |||||||||||||||||||||||||||||||||||||
Variables | |
Access GTA Headers | |
const gta_taglist_t *gta_taglist_t * | uintmax_t |
Get the global tag list (non-modifiable). More... | |
gta_type_t | |
Get the type of a component. More... | |
gta_compression_t | |
Get the compression. More... | |
Create and destroy GTA Headers | |||||||
This function returns the version string "MAJOR.MINOR.PATCH". If the pointers major, minor, patch are not NULL, the requested version number will be stored there. | |||||||
gta_result_t | |||||||
Create a new GTA header structure and initialize it. More... | |||||||
void | |||||||
Destroy a GTA header structure and free its resources. More... | |||||||
gta_result_t | gta_clone_header (gta_header_t *restrict dst_header, const gta_header_t *restrict src_header) | ||||||
Clone a GTA header structure. More... | |||||||
Access Tag Lists | |
enum | gta_result_t { GTA_OK = 0, GTA_OVERFLOW = 1, GTA_UNSUPPORTED_DATA = 2, GTA_UNEXPECTED_EOF = 3, GTA_INVALID_DATA = 4, GTA_SYSTEM_ERROR = 5 } |
GTA result type. More... | |
gta_result_t | gta_clone_taglist (gta_taglist_t *restrict dst_taglist, const gta_taglist_t *restrict src_taglist) |
Clone a tag list. More... | |
The libgta C interface.
This document describes the C language interface of libgta.
typedef struct gta_internal_taglist_struct gta_taglist_t |
The GTA tag list type.
A tag consists of a name and a value. A tag list stores these name/value pairs.
Tag names are non-empty UTF-8 strings that must not contain '='.
Tag values are UTF-8 strings.
If you do not want to deal with conversions between the local character set and UTF-8, you must restrict names and values to ASCII.
typedef size_t(* gta_read_t)(intptr_t userdata, void *buffer, size_t size, int *error) |
Custom input function.
You can specify your own input function to read from your own custom sources.
It must read the given number of bytes into the given buffer.
Its return value must be the number of bytes successfully read.
If an error occured, the error flag must be set to true (1). The function must set errno to indicate the type of error. If the error type is unknown, errno should be set to EIO.
typedef size_t(* gta_write_t)(intptr_t userdata, const void *buffer, size_t size, int *error) |
Custom output function.
You can specify your own output function to write to your own custum destinations.
It must write the given number of bytes from the given buffer.
Its return value must be the number of bytes successfully written.
If an error occured, the error flag must be set to true (1). The function must set errno to indicate the type of error. If the error type is unknown, errno should be set to EIO.
typedef void(* gta_seek_t)(intptr_t userdata, intmax_t offset, int whence, int *error) |
Custom seek function.
You can specify your own seek function to seek in your own custum media.
It must change its file position indicator as indicated by the parameters offset and whence, just like fseeko() and lseek() do. The parameter whence can be SEEK_SET or SEEK_CUR (SEEK_END is never used).
If an error occured, the error flag must be set to true (1). The function must set errno to indicate the type of error. If the error type is unknown, errno should be set to EIO.
typedef struct gta_internal_io_state_struct gta_io_state_t |
State for element-based input/output.
See gta_read_elements() and gta_write_elements().
enum const char *const char *const char * gta_result_t |
GTA result type.
Get the tag name with the given index.
The return value of most GTA functions is of this type, to indicate failures and their causes.
taglist | The tag list. |
i | The tag index. |
taglist | The tag list. |
i | The tag index. |
taglist | The tag list. |
name | The tag name. |
taglist | The tag list. |
name | The name. |
value | The value. |
Sets the given tag, possibly overwriting an existing tag with the same name. The name and value must be valid UTF-8 strings without control characters. Additionally, the name must not contain the equal sign and must not be empty.
enum gta_type_t |
GTA data types.
Data types supported by GTA.
All integer types contain the exact number of bits indicated by their name and use the common two's complement representation.
All floating point types contain the exact number of bits indicated by their name and conform to the binary representation defined by IEEE 754.
The complex types (GTA_CFLOAT*) consist of two floating point values with the number of bits indicated by the name, as defined above. The first value is the real part, the second value is the imaginary part. For example, GTA_CFLOAT32 consists of two GTA_FLOAT32 values.
The name GTA_BLOB can be used for data types that are not defined in this list. In this case, the size of the data type must be given, and the data type must be independent of endianness.
enum gta_compression_t |
GTA compression algorithms.
Compression algorithms used to compress the array.
Only uncompressed files are suitable for out-of-core data access; compressed files must be decompressed first.
GTA_ZLIB compression is fast and achieves a moderate compression ratio. GTA_BZIP2 compression is moderately fast and achieves a good compression ratio. GTA_XZ compression is slow for compression, moderately fast for decompression, and achieves good or very good compression rates.
gta_result_t gta_clone_header | ( | gta_header_t *restrict | dst_header, |
const gta_header_t *restrict | src_header | ||
) |
Clone a GTA header structure.
dst_header | The destination header. |
src_header | The source header. |
Clones src_header into dst_header.
gta_result_t gta_clone_taglist | ( | gta_taglist_t *restrict | dst_taglist, |
const gta_taglist_t *restrict | src_taglist | ||
) |
Clone a tag list.
dst_taglist | The destination tag list. |
src_taglist | The source tag list. |
Copies src_taglist to dst_taglist.
gta_result_t gta_copy_data | ( | const gta_header_t *restrict | read_header, |
gta_read_t | read_fn, | ||
intptr_t | read_userdata, | ||
const gta_header_t *restrict | write_header, | ||
gta_write_t | write_fn, | ||
intptr_t | write_userdata | ||
) |
Copy the complete data.
read_header | The input header. |
read_fn | The custom input function. |
read_userdata | A parameter to the custom input function. |
write_header | The ourput header. |
write_fn | The custom output function. |
write_userdata | A parameter to the custom output function. |
Copies the complete data. The data encoding is altered as necessary (endianness correction, compression). Note that the data encoding may change even if read_header and write_header point to the same header!
gta_result_t gta_copy_data_stream | ( | const gta_header_t *restrict | read_header, |
FILE *restrict | read_f, | ||
const gta_header_t *restrict | write_header, | ||
FILE *restrict | write_f | ||
) |
Copy the complete data between streams.
read_header | The input header. |
read_f | The input stream. |
write_header | The output header. |
write_f | The output stream. |
Copies the complete data. The data encoding is altered as necessary (endianness correction, compression). Note that the data encoding may change even if read_header and write_header point to the same header!
gta_result_t gta_copy_data_fd | ( | const gta_header_t *restrict | read_header, |
int | read_fd, | ||
const gta_header_t *restrict | write_header, | ||
int | write_fd | ||
) |
Copy the complete data between file descriptors.
read_header | The input header. |
read_fd | The input file descriptor. |
write_header | The output header. |
write_fd | The output file descriptor. |
Copies the complete data. The data encoding is altered as necessary (endianness correction, compression). Note that the data encoding may change even if read_header and write_header point to the same header!
gta_result_t gta_clone_io_state | ( | gta_io_state_t *restrict | dst_io_state, |
const gta_io_state_t *restrict | src_io_state | ||
) |
Clone an input/output state.
dst_io_state | The destination state. |
src_io_state | The source state. |
Clones src_io_state into dst_io_state.
gta_result_t gta_read_elements | ( | const gta_header_t *restrict | header, |
gta_io_state_t *restrict | io_state, | ||
uintmax_t | n, | ||
void *restrict | buf, | ||
gta_read_t | read_fn, | ||
intptr_t | userdata | ||
) |
Read array elements.
header | The header. |
io_state | The input/output state. |
n | The number of elements to read. |
buf | The buffer for the elements. |
read_fn | The custom input function. |
userdata | A parameter to the custom input function. |
Reads the given number of elements into the given buffer, which must be large enough.
gta_result_t gta_read_elements_from_stream | ( | const gta_header_t *restrict | header, |
gta_io_state_t *restrict | io_state, | ||
uintmax_t | n, | ||
void *restrict | buf, | ||
FILE *restrict | f | ||
) |
Read array elements.
header | The header. |
io_state | The input/output state. |
n | The number of elements to read. |
buf | The buffer for the elements. |
f | The stream. |
Reads the given number of elements into the given buffer, which must be large enough.
gta_result_t gta_read_elements_from_fd | ( | const gta_header_t *restrict | header, |
gta_io_state_t *restrict | io_state, | ||
uintmax_t | n, | ||
void *restrict | buf, | ||
int | fd | ||
) |
Read array elements.
header | The header. |
io_state | The input/output state. |
n | The number of elements to read. |
buf | The buffer for the elements. |
fd | The file descriptor. |
Reads the given number of elements into the given buffer, which must be large enough.
gta_result_t gta_write_elements | ( | const gta_header_t *restrict | header, |
gta_io_state_t *restrict | io_state, | ||
uintmax_t | n, | ||
const void *restrict | buf, | ||
gta_write_t | write_fn, | ||
intptr_t | userdata | ||
) |
Write array elements.
header | The header. |
io_state | The input/output state. |
n | The number of elements to write. |
buf | The buffer for the elements. |
write_fn | The custom output function. |
userdata | A parameter to the custom output function. |
Writes the given number of elements from the given buffer.
gta_result_t gta_write_elements_to_stream | ( | const gta_header_t *restrict | header, |
gta_io_state_t *restrict | io_state, | ||
uintmax_t | n, | ||
const void *restrict | buf, | ||
FILE *restrict | f | ||
) |
Write array elements.
header | The header. |
io_state | The input/output state. |
n | The number of elements to write. |
buf | The buffer for the elements. |
f | The stream. |
Writes the given number of elements from the given buffer.
gta_result_t gta_write_elements_to_fd | ( | const gta_header_t *restrict | header, |
gta_io_state_t *restrict | io_state, | ||
uintmax_t | n, | ||
const void *restrict | buf, | ||
int | fd | ||
) |
Write array elements.
header | The header. |
io_state | The input/output state. |
n | The number of elements to write. |
buf | The buffer for the elements. |
fd | The file descriptor. |
Writes the given number of elements from the given buffer.
gta_result_t gta_read_block | ( | const gta_header_t *restrict | header, |
intmax_t | data_offset, | ||
const uintmax_t *restrict | lower_coordinates, | ||
const uintmax_t *restrict | higher_coordinates, | ||
void *restrict | block, | ||
gta_read_t | read_fn, | ||
gta_seek_t | seek_fn, | ||
intptr_t | userdata | ||
) |
Read an array block.
header | The header. |
data_offset | Offset of the first data byte. |
lower_coordinates | Coordinates of the lower corner element of the block. |
higher_coordinates | Coordinates of the higher corner element of the block. |
block | The block buffer. |
read_fn | The custom input function. |
seek_fn | The custom seek function. |
userdata | A parameter to the custom input function. |
Reads the given array block and copies it to the given block buffer, which must be large enough.
This function modifies the file position indicator of the input.
gta_result_t gta_read_block_from_stream | ( | const gta_header_t *restrict | header, |
intmax_t | data_offset, | ||
const uintmax_t *restrict | lower_coordinates, | ||
const uintmax_t *restrict | higher_coordinates, | ||
void *restrict | block, | ||
FILE *restrict | f | ||
) |
Read an array block from a stream.
header | The header. |
data_offset | Offset of the first data byte. |
lower_coordinates | Coordinates of the lower corner element of the block. |
higher_coordinates | Coordinates of the higher corner element of the block. |
block | The block buffer. |
f | The stream. |
Reads the given array block and copies it to the given block buffer, which must be large enough.
This function modifies the file position indicator of the input.
gta_result_t gta_read_block_from_fd | ( | const gta_header_t *restrict | header, |
intmax_t | data_offset, | ||
const uintmax_t *restrict | lower_coordinates, | ||
const uintmax_t *restrict | higher_coordinates, | ||
void *restrict | block, | ||
int | fd | ||
) |
Read an array block from a file descriptor.
header | The header. |
data_offset | Offset of the first data byte. |
lower_coordinates | Coordinates of the lower corner element of the block. |
higher_coordinates | Coordinates of the higher corner element of the block. |
block | The block buffer. |
fd | The file descriptor. |
Reads the given array block and copies it to the given block buffer, which must be large enough.
This function modifies the file position indicator of the input.
gta_result_t gta_write_block | ( | const gta_header_t *restrict | header, |
intmax_t | data_offset, | ||
const uintmax_t *restrict | lower_coordinates, | ||
const uintmax_t *restrict | higher_coordinates, | ||
const void *restrict | block, | ||
gta_write_t | write_fn, | ||
gta_seek_t | seek_fn, | ||
intptr_t | userdata | ||
) |
Write an array block.
header | The header. |
data_offset | Offset of the first data byte. |
lower_coordinates | Coordinates of the lower corner element of the block. |
higher_coordinates | Coordinates of the higher corner element of the block. |
block | The block buffer. |
write_fn | The custom output function. |
seek_fn | The custom seek function. |
userdata | A parameter to the custom output function. |
This function modifies the file position indicator of the output.
gta_result_t gta_write_block_to_stream | ( | const gta_header_t *restrict | header, |
intmax_t | data_offset, | ||
const uintmax_t *restrict | lower_coordinates, | ||
const uintmax_t *restrict | higher_coordinates, | ||
const void *restrict | block, | ||
FILE *restrict | f | ||
) |
Write an array block to a stream.
header | The header. |
data_offset | Offset of the first data byte. |
lower_coordinates | Coordinates of the lower corner element of the block. |
higher_coordinates | Coordinates of the higher corner element of the block. |
block | The block buffer. |
f | The stream. |
This function modifies the file position indicator of the output.
gta_result_t gta_write_block_to_fd | ( | const gta_header_t *restrict | header, |
intmax_t | data_offset, | ||
const uintmax_t *restrict | lower_coordinates, | ||
const uintmax_t *restrict | higher_coordinates, | ||
const void *restrict | block, | ||
int | fd | ||
) |
Write an array block to a file descriptor.
header | The header. |
data_offset | Offset of the first data byte. |
lower_coordinates | Coordinates of the lower corner element of the block. |
higher_coordinates | Coordinates of the higher corner element of the block. |
block | The block buffer. |
fd | The file descriptor. |
This function modifies the file position indicator of the output.
Create a new GTA header structure and initialize it.
Create and initialize a new input/output state.
Write the complete data to a file descriptor.
Write the complete data to a stream.
Write the complete data.
Skip the complete data from a file descriptor.
Skip the complete data from a stream.
Skip the complete data.
Read the complete data from a file descriptor.
Read the complete data from a stream.
Read the complete data.
Unset a tag.
Get the tag name with the given index.
Set the dimensions.
Set the components of an array element.
Write a GTA header to a file descriptor.
Write a GTA header to a stream.
Write a GTA header.
Read a GTA header from a file descriptor.
Read a GTA header from a stream.
Read a GTA header.
header | The header. |
Creates a new GTA header and initializes it. The GTA will initially be empty (zero element components, zero dimensions) and contain no tags. The compression method will be GTA_NONE.
header | The header. |
read_fn | The custom input function. |
userdata | A parameter to the custom input function. |
header | The header. |
f | The stream. |
Reads a GTA header from a stream.
The file position indicator will be positioned after the GTA header, on the first data byte.
header | The header. |
fd | The file descriptor. |
Reads a GTA header from a file descriptor.
The file position indicator will be positioned after the GTA header, on the first data byte.
header | The header. |
write_fn | The custom output function. |
userdata | A parameter to the custom output function. |
header | The header. |
f | The stream. |
header | The header. |
fd | The file descriptor. |
header | The header. |
n | The number of components. |
types | The types of the n components. |
sizes | NULL, or the sizes of the components that have type GTA_BLOB. |
Set the components of the array elements.
The sizes parameter can be NULL if no components have the type GTA_BLOB. Otherwise, it must point to a list that contains the sizes of these components (and only these components). For example, if there are five components, but only two have the type GTA_BLOB, then the sizes list must contain two size values.
All components will initially have an empty tag list.
header | The header. |
n | The number of dimensions. |
sizes | The array sizes in each of the dimensions. |
Sets the array dimensions.
All dimensions will initially have an empty tag list.
taglist | The tag list. |
i | The tag index. |
taglist | The tag list. |
i | The tag index. |
taglist | The tag list. |
name | The tag name. |
taglist | The tag list. |
name | The name. |
value | The value. |
Sets the given tag, possibly overwriting an existing tag with the same name. The name and value must be valid UTF-8 strings without control characters. Additionally, the name must not contain the equal sign and must not be empty.
taglist | The tag list. |
name | The tag name. |
Removes the tag with the given name, if it exists.
header | The header. |
data | The data buffer. |
read_fn | The custom input function. |
userdata | A parameter to the custom input function. |
Reads the complete data into the given buffer. The buffer must be large enough.
header | The header. |
data | The data buffer. |
f | The stream. |
Reads the complete data into the given buffer. The buffer must be large enough.
header | The header. |
data | The data buffer. |
fd | The file descriptor. |
Reads the complete data into the given buffer. The buffer must be large enough.
header | The header. |
read_fn | The custom input function. |
seek_fn | The custom seek function, or NULL for non-seekable input. |
userdata | A parameter to the custom input and seek functions. |
Skips the complete data, so that the next GTA header can be read.
header | The header. |
f | The stream. |
Skips the complete data, so that the next GTA header can be read.
header | The header. |
fd | The file descriptor. |
Skips the complete data, so that the next GTA header can be read.
header | The header. |
data | The data buffer. |
write_fn | The custom output function. |
userdata | A parameter to the custom output function. |
Writes the complete data.
header | The header. |
data | The data buffer. |
f | The stream. |
Writes the complete data.
header | The header. |
data | The data buffer. |
fd | The file descriptor. |
Writes the complete data.
io_state | The input/output state. |
Creates and initializes a state structure for element-based input/output.
void |
Destroy a GTA header structure and free its resources.
Destroy input/output state and free its resources.
Transform a linear index to array indices.
Unset all tags.
Set the compression.
header | The header. |
Destroys a GTA header structure and fress all of its resources.
header | The header. |
compression | The compression type. |
Sets the compression type for writing the header and data.
See gta_compression_t for more information on compression types.
taglist | The tag list. |
Removes all tags from the tag list.
header | The header. |
index | The linear index. |
indices | The array indices. |
io_state | The input/output state. |
Destroys a state structure for element-based input/output and frees its resources.
const gta_taglist_t *gta_taglist_t * uintmax_t |
Get the global tag list (non-modifiable).
Transform array indices to a linear index.
Get the number of tags in a tag list.
Get the total size of the array data.
Get the tag list of a dimension (non-modifiable).
Get the size in a dimension.
Get the tag list of a component (non-modifiable).
Get the size of a component.
Get the number of components.
header | The header. |
header | The header. |
header | The header. |
header | The header. |
header | The header. |
i | The component index. |
header | The header. |
i | The component index. |
header | The header. |
i | The component index. |
header | The header. |
header | The header. |
i | The dimension index. |
header | The header. |
i | The dimension index. |
header | The header. |
i | The dimension index. |
header | The header. |
header | The header. |
taglist | The tag list. |
header | The header. |
indices | The array indices. |
Get the type of a component.
header | The header. |
i | The component index. |
Get the compression.
header | The header. |
Gets the compression type for the header and data.
See gta_compression_t for more information on compression types.
Compressed data is always stored in chunks, while uncompressed data is never stored in chunks.