This provides an example of how to use eaarlio_file_tld_opener.
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
if(argc != 3 || 0 == strncmp(argv[1], "-h", 3) || 0 == strncmp(argv[1], "--help", 7)) {
printf("Usage: example_file_tld_opener [-h] <tld path> <tld file>\n");
printf("Example of using eaarlio_tld_opener\n");
printf("\n");
printf("Note that the directory component and filename component of the TLD file\n");
printf("must be provided separately.\n");
printf("\n");
printf(" -h, --help display this help and exit\n");
printf(" <tld path> directory that the TLD file is located in\n");
printf(" <tld file> filename of the TLD file\n");
return 1;
}
char const *tld_path = argv[1];
char const *tld_file = argv[2];
int failed;
int include_pulses = 0;
int include_waveforms = 0;
if(failed)
return 1;
err = tld_opener.
open_tld(&tld_opener, &stream, tld_file);
if(failed)
return 1;
&stream, &raster, NULL, include_pulses, include_waveforms);
if(failed)
return 1;
printf(
"digitizer: %" PRIu8
"\n", raster.
digitizer);
printf(
"pulse_count: %" PRIu16
"\n", raster.
pulse_count);
if(failed)
return 1;
err = stream.
close(&stream);
if(failed)
return 1;
err = tld_opener.
close(&tld_opener);
if(failed)
return 1;
return 0;
}