#include <stdio.h>
#include <stdlib.h>
int main(void)
{
FILE *infile, *outfile;
void *element;
uintmax_t i;
infile = fopen("input.gta", "r");
if (!infile) {
return 1;
}
return 1;
}
return 1;
}
outfile = fopen("output.gta", "w");
if (!outfile) {
return 1;
}
return 1;
}
return 1;
}
return 1;
}
return 1;
}
return 1;
}
return 1;
}
if (!element) {
return 1;
}
return 1;
}
return 1;
}
}
free(element);
fclose(infile);
fclose(outfile);
return 0;
}
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.
uintmax_t gta_get_element_size(const gta_header_t *restrict header)
Return the size of an array element.
void gta_destroy_io_state(gta_io_state_t *restrict io_state)
Destroy input/output state and free its resources.
gta_result_t gta_create_io_state(gta_io_state_t *restrict *restrict io_state)
Create and initialize a new input/output state.
gta_result_t
GTA result type.
Definition: gta.h:213
@ GTA_OK
Success / no error.
Definition: gta.h:214
void gta_destroy_header(gta_header_t *restrict header)
Destroy a GTA header structure and free its resources.
struct gta_internal_io_state_struct gta_io_state_t
State for element-based input/output.
Definition: gta.h:353
gta_result_t gta_write_header_to_stream(const gta_header_t *restrict header, FILE *restrict f)
Write a GTA header to a stream.
struct gta_internal_header_struct gta_header_t
The GTA header type.
Definition: gta.h:193
uintmax_t gta_get_elements(const gta_header_t *restrict header)
Get the total number of elements in the array.
gta_result_t gta_create_header(gta_header_t *restrict *restrict header)
Create a new GTA header structure and initialize it.
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.
gta_result_t gta_read_header_from_stream(gta_header_t *restrict header, FILE *restrict f)
Read a GTA header from a stream.
gta_result_t gta_clone_header(gta_header_t *restrict dst_header, const gta_header_t *restrict src_header)
Clone a GTA header structure.