This provides a contrived example of writing out an EDB file. For a better example of how to create an EDB file, see programs/eaarlio_edb_create.c.
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
if(argc != 2 || 0 == strncmp(argv[1], "-h", 3) || 0 == strncmp(argv[1], "--help", 7)) {
printf("Usage: example_edb_write [-h] <edb file>\n");
printf("Example of writing to an EDB, using fixed sample data\n");
printf("\n");
printf(" -h, --help display this help and exit\n");
printf(" <edb file> EDB file to write\n");
return 1;
}
char const *edb_file = argv[1];
int failed;
{
.time_fraction = 191852,
.record_offset = 0,
.record_length = 123718,
.file_index = 1,
.pulse_count = 119,
.digitizer = 0,
},
{
.time_seconds = 1383685470,
.time_fraction = 223381,
.record_offset = 123718,
.record_length = 123674,
.file_index = 1,
.pulse_count = 119,
.digitizer = 1,
},
{
.time_seconds = 1383685470,
.time_fraction = 253827,
.record_offset = 0,
.record_length = 123654,
.file_index = 2,
.pulse_count = 119,
.digitizer = 0,
},
};
char const *files[] = {
"131105-210430.tld", "131105-210513.tld",
};
edb.
files = (
char **)&files;
if(failed)
return 1;
if(failed)
return 1;
err = stream.
close(&stream);
if(failed)
return 1;
return 0;
}